aboutsummaryrefslogtreecommitdiffstats
path: root/Transceiver52M/sigProcLib.cpp
diff options
context:
space:
mode:
authorAlexander Chemeris <Alexander.Chemeris@gmail.com>2017-03-18 13:27:48 -0700
committerAlexander Chemeris <Alexander.Chemeris@gmail.com>2017-03-28 14:24:22 +0000
commite0c12189d455eb0d17299e4504749ce36629e18b (patch)
treec1d96b9168dd106e800ebac262d71042fc4d0b3a /Transceiver52M/sigProcLib.cpp
parent1470fcdb5a9abd9dd1e3b5ed401df88ef9e87cc3 (diff)
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
Diffstat (limited to 'Transceiver52M/sigProcLib.cpp')
-rw-r--r--Transceiver52M/sigProcLib.cpp12
1 files changed, 6 insertions, 6 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)