diff options
author | Alexander Chemeris <Alexander.Chemeris@gmail.com> | 2017-03-17 17:22:33 -0700 |
---|---|---|
committer | Alexander Chemeris <Alexander.Chemeris@gmail.com> | 2017-03-22 18:31:03 +0000 |
commit | 132fb247b101292818afaf72f7508b594625cc25 (patch) | |
tree | 4ac8d820bbb050e915436a65bd94c6f8a0619938 /Transceiver52M/sigProcLib.cpp | |
parent | 1c0b8b355ccbb31048973e838933d0e29039ad32 (diff) |
sigProcLib: Slice SoftVector instead of signalVector for GMSK demod.
This makes it similar to 8-PSK demod and also saves a bit of lines ofcode and
should give us a tiny improvement in performance.
Ideally we need to remove vector slicing at all, because in osmo-bts-trx
we convert back to +-1.0 again (actually to +-127, but it doesn't mater).
So we should rather transmit +-1.0 values to avoid double conversion.
Change-Id: If9ed6f0f80fbe88c994b2f9c3cae91d0d57f4442
Diffstat (limited to 'Transceiver52M/sigProcLib.cpp')
-rw-r--r-- | Transceiver52M/sigProcLib.cpp | 44 |
1 files changed, 20 insertions, 24 deletions
diff --git a/Transceiver52M/sigProcLib.cpp b/Transceiver52M/sigProcLib.cpp index 0a1fd44..56a1a58 100644 --- a/Transceiver52M/sigProcLib.cpp +++ b/Transceiver52M/sigProcLib.cpp @@ -737,20 +737,6 @@ bool vectorSlicer(SoftVector *x) return true; } -bool vectorSlicer(signalVector *x) -{ - - signalVector::iterator xP = x->begin(); - signalVector::iterator xPEnd = x->end(); - while (xP < xPEnd) { - *xP = (complex) (0.5*(xP->real()+1.0F)); - if (xP->real() > 1.0) *xP = 1.0; - if (xP->real() < 0.0) *xP = 0.0; - xP++; - } - return true; -} - static signalVector *rotateBurst(const BitVector &wBurst, int guardPeriodLength, int sps) { @@ -2020,6 +2006,22 @@ static SoftVector *softSliceEdgeBurst(signalVector &burst) } /* + * Convert signalVector to SoftVector by taking real part of the signal. + */ +static SoftVector *signalToSoftVector(signalVector *dec) +{ + SoftVector *bits = new SoftVector(dec->size()); + + SoftVector::iterator bit_itr = bits->begin(); + signalVector::iterator burst_itr = dec->begin(); + + for (; burst_itr < dec->end(); burst_itr++) + *bit_itr++ = burst_itr->real(); + + return bits; +} + +/* * Shared portion of GMSK and EDGE demodulators consisting of timing * recovery and single tap channel correction. For 4 SPS (if activated), * the output is downsampled prior to the 1 SPS modulation specific @@ -2062,18 +2064,12 @@ SoftVector *demodGmskBurst(signalVector &rxBurst, int sps, /* Shift up by a quarter of a frequency */ GMSKReverseRotate(*dec, 1); - vectorSlicer(dec); - - bits = new SoftVector(dec->size()); - - SoftVector::iterator bit_itr = bits->begin(); - signalVector::iterator burst_itr = dec->begin(); - - for (; burst_itr < dec->end(); burst_itr++) - *bit_itr++ = burst_itr->real(); - + /* Take real part of the signal */ + bits = signalToSoftVector(dec); delete dec; + vectorSlicer(bits); + return bits; } |