diff options
author | Alexander Chemeris <Alexander.Chemeris@gmail.com> | 2017-03-18 13:27:48 -0700 |
---|---|---|
committer | Alexander Chemeris <Alexander.Chemeris@gmail.com> | 2017-03-28 14:24:22 +0000 |
commit | e0c12189d455eb0d17299e4504749ce36629e18b (patch) | |
tree | c1d96b9168dd106e800ebac262d71042fc4d0b3a | |
parent | sigProcLib: constify signalVector arguments for detectBurst() functions. (diff) | |
download | OsmoTRX-e0c12189d455eb0d17299e4504749ce36629e18b.tar.xz OsmoTRX-e0c12189d455eb0d17299e4504749ce36629e18b.zip |
sigProcLib: Constify demodulation functions burst argument.
demodCommon() used to scale input vector in place which changed original data.
That's a bad practice and is not really necessary, so I've changed the code to
scale burst after it's copied to a new vector during a delay operation.
Change-Id: Ic45f71b634e48808356d68925bb9f5783e0bf0d3
-rw-r--r-- | Transceiver52M/sigProcLib.cpp | 12 | ||||
-rw-r--r-- | Transceiver52M/sigProcLib.h | 8 |
2 files changed, 10 insertions, 10 deletions
diff --git a/Transceiver52M/sigProcLib.cpp b/Transceiver52M/sigProcLib.cpp index eaaae34..4c2222c 100644 --- a/Transceiver52M/sigProcLib.cpp +++ b/Transceiver52M/sigProcLib.cpp @@ -1253,7 +1253,7 @@ void generateDelayFilters() } } -signalVector *delayVector(signalVector *in, signalVector *out, float delay) +signalVector *delayVector(const signalVector *in, signalVector *out, float delay) { int whole, index; float frac; @@ -2060,7 +2060,7 @@ static SoftVector *signalToSoftVector(signalVector *dec) * the output is downsampled prior to the 1 SPS modulation specific * stages. */ -static signalVector *demodCommon(signalVector &burst, int sps, +static signalVector *demodCommon(const signalVector &burst, int sps, complex chan, float toa) { signalVector *delay, *dec; @@ -2068,8 +2068,8 @@ static signalVector *demodCommon(signalVector &burst, int sps, if ((sps != 1) && (sps != 4)) return NULL; - scaleVector(burst, (complex) 1.0 / chan); delay = delayVector(&burst, NULL, -toa * (float) sps); + scaleVector(*delay, (complex) 1.0 / chan); if (sps == 1) return delay; @@ -2085,7 +2085,7 @@ static signalVector *demodCommon(signalVector &burst, int sps, * 4 SPS (if activated) to minimize distortion through the fractional * delay filters. Symbol rotation and after always operates at 1 SPS. */ -SoftVector *demodGmskBurst(signalVector &rxBurst, int sps, +SoftVector *demodGmskBurst(const signalVector &rxBurst, int sps, complex channel, float TOA) { SoftVector *bits; @@ -2114,7 +2114,7 @@ SoftVector *demodGmskBurst(signalVector &rxBurst, int sps, * through the fractional delay filters at 1 SPS renders signal * nearly unrecoverable. */ -SoftVector *demodEdgeBurst(signalVector &burst, int sps, +SoftVector *demodEdgeBurst(const signalVector &burst, int sps, complex chan, float toa) { SoftVector *bits; @@ -2138,7 +2138,7 @@ SoftVector *demodEdgeBurst(signalVector &burst, int sps, return bits; } -SoftVector *demodAnyBurst(signalVector &burst, int sps, complex amp, +SoftVector *demodAnyBurst(const signalVector &burst, int sps, complex amp, float toa, CorrType type) { if (type == EDGE) diff --git a/Transceiver52M/sigProcLib.h b/Transceiver52M/sigProcLib.h index a67b0ca..4318fe0 100644 --- a/Transceiver52M/sigProcLib.h +++ b/Transceiver52M/sigProcLib.h @@ -152,7 +152,7 @@ signalVector *generateDummyBurst(int sps, int tn); float sinc(float x); /** Delay a vector */ -signalVector *delayVector(signalVector *in, signalVector *out, float delay); +signalVector *delayVector(const signalVector *in, signalVector *out, float delay); /** Add two vectors in-place */ bool addVector(signalVector &x, @@ -311,7 +311,7 @@ signalVector *decimateVector(signalVector &wVector, size_t factor); @param TOA The time-of-arrival of the received burst. @return The demodulated bit sequence. */ -SoftVector *demodGmskBurst(signalVector &rxBurst, int sps, +SoftVector *demodGmskBurst(const signalVector &rxBurst, int sps, complex channel, float TOA); /** @@ -322,11 +322,11 @@ SoftVector *demodGmskBurst(signalVector &rxBurst, int sps, @param TOA The time-of-arrival of the received burst. @return The demodulated bit sequence. */ -SoftVector *demodEdgeBurst(signalVector &rxBurst, int sps, +SoftVector *demodEdgeBurst(const signalVector &rxBurst, int sps, complex channel, float TOA); /** Demodulate burst basde on type and output soft bits */ -SoftVector *demodAnyBurst(signalVector &burst, int sps, +SoftVector *demodAnyBurst(const signalVector &burst, int sps, complex amp, float toa, CorrType type); #endif /* SIGPROCLIB_H */ |