diff options
author | Pau Espin Pedrol <pespin@sysmocom.de> | 2021-09-01 19:42:46 +0200 |
---|---|---|
committer | Pau Espin Pedrol <pespin@sysmocom.de> | 2021-09-01 19:43:11 +0200 |
commit | 8803f923f9c439c841492391182de273b3920e68 (patch) | |
tree | 22c6f4f1f71a878e8a00cbfe8080894592a0b452 | |
parent | ecea734b97357126daee5ca73ebf82d5bde9839b (diff) |
detectBurst(): Clear downsampling code path
downsampleBurst() and the Resampler below it clearly only support or are
confgiured for 1<->4 setup currently.
Change-Id: Iebaff7a34bd24e56627f148182859918accbfa82
-rw-r--r-- | Transceiver52M/sigProcLib.cpp | 20 |
1 files changed, 12 insertions, 8 deletions
diff --git a/Transceiver52M/sigProcLib.cpp b/Transceiver52M/sigProcLib.cpp index b7c41ba..ff5e32f 100644 --- a/Transceiver52M/sigProcLib.cpp +++ b/Transceiver52M/sigProcLib.cpp @@ -34,6 +34,7 @@ #include "Resampler.h" extern "C" { +#include <osmocom/core/panic.h> #include "convolve.h" #include "scale.h" #include "mult.h" @@ -1500,12 +1501,18 @@ static int detectBurst(const signalVector &burst, complex xcorr; int rc = 1; - if (sps == 4) { - dec = downsampleBurst(burst); - corr_in = dec; - sps = 1; - } else { + switch (sps) { + case 1: corr_in = &burst; + break; + case 4: + dec = downsampleBurst(burst); + /* Running at the downsampled rate at this point: */ + corr_in = dec; + sps = 1; + break; + default: + osmo_panic("%s:%d SPS %d not supported! Only 1 or 4 supported", __FILE__, __LINE__, sps); } /* Correlate */ @@ -1515,9 +1522,6 @@ static int detectBurst(const signalVector &burst, goto del_ret; } - /* Running at the downsampled rate at this point */ - sps = 1; - /* Peak detection - place restrictions at correlation edges */ ebp->amp = fastPeakDetect(corr, &ebp->toa); |