diff options
author | Tom Tsou <tom.tsou@ettus.com> | 2016-03-06 22:33:20 -0800 |
---|---|---|
committer | Tom Tsou <tom.tsou@ettus.com> | 2016-03-08 17:45:53 -0800 |
commit | 7fec3030d46b2c35c34d90507feab253cddb9c01 (patch) | |
tree | afcac79e07015df47ba2d9a658d59aed6ed31bf7 /Transceiver52M | |
parent | af717b2d3c7fd9197edec715c3c0be70697c591a (diff) |
EDGE: Combine shared GMSK and 8-PSK demodulator sections
Timing recovery and single tap channel compensation are identical
in both GMSK and EDGE receivers. This is the section ahead of and
including the optional 4-1 downsampler. GMSK and EDGE specific
sections operate at 1 SPS.
Signed-off-by: Tom Tsou <tom.tsou@ettus.com>
Diffstat (limited to 'Transceiver52M')
-rw-r--r-- | Transceiver52M/sigProcLib.cpp | 57 |
1 files changed, 35 insertions, 22 deletions
diff --git a/Transceiver52M/sigProcLib.cpp b/Transceiver52M/sigProcLib.cpp index cf2c257..f3fa4f0 100644 --- a/Transceiver52M/sigProcLib.cpp +++ b/Transceiver52M/sigProcLib.cpp @@ -1964,6 +1964,32 @@ static SoftVector *softSliceEdgeBurst(signalVector &burst) } /* + * 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 + * stages. + */ +static signalVector *demodCommon(signalVector &burst, int sps, + complex chan, float toa) +{ + signalVector *delay, *dec; + + if ((sps != 1) && (sps != 4)) + return NULL; + + scaleVector(burst, (complex) 1.0 / chan); + delay = delayVector(&burst, NULL, -toa * (float) sps); + + if (sps == 1) + return delay; + + dec = downsampleBurst(*delay); + + delete delay; + return dec; +} + +/* * Demodulate GSMK burst. Prior to symbol rotation, operate at * 4 SPS (if activated) to minimize distortion through the fractional * delay filters. Symbol rotation and after always operates at 1 SPS. @@ -1972,17 +1998,11 @@ SoftVector *demodulateBurst(signalVector &rxBurst, int sps, complex channel, float TOA) { SoftVector *bits; - signalVector *delay, *dec; - - scaleVector(rxBurst, ((complex) 1.0) / channel); - delay = delayVector(&rxBurst, NULL, -TOA * (float) sps); + signalVector *dec; - if (sps == 4) { - dec = downsampleBurst(*delay); - delete delay; - } else { - dec = delay; - } + dec = demodCommon(rxBurst, sps, channel, TOA); + if (!dec) + return NULL; /* Shift up by a quarter of a frequency */ GMSKReverseRotate(*dec, 1); @@ -2015,24 +2035,17 @@ SoftVector *demodEdgeBurst(signalVector &burst, int sps, complex chan, float toa) { SoftVector *bits; - signalVector *delay, *dec, *rot, *eq; + signalVector *dec, *rot, *eq; - if ((sps != 1) && (sps != 4)) + dec = demodCommon(burst, sps, chan, toa); + if (!dec) return NULL; - scaleVector(burst, ((complex) 1.0) / chan); - delay = delayVector(&burst, NULL, -toa * (float) sps); - - if (sps == 4) { - dec = downsampleBurst(*delay); - delete delay; - } else { - dec = delay; - } - + /* Equalize and derotate */ eq = convolve(dec, GSMPulse4->c0_inv, NULL, NO_DELAY); rot = derotateEdgeBurst(*eq, 1); + /* Soft slice and normalize */ bits = softSliceEdgeBurst(*dec); vectorSlicer(bits); |