From a84e162672b1ccca94994f132b89fb024bcd15d4 Mon Sep 17 00:00:00 2001 From: Tom Tsou Date: Wed, 29 Jun 2016 14:50:25 -0700 Subject: sigproc: Adjust burst detection threshold criteria Reduce the burst detection threshold to pass more bursts to upper layers, but force stricter requirements on the computation itself. For the latter, we now require at least 5 samples (rather than 2) to compute a peak-to-average value. End result is increased burst detection at low SNR conditions with a small increase in false positive bursts when no signal is present. Signed-off-by: Tom Tsou --- Transceiver52M/Transceiver.cpp | 18 +++++++++++++----- Transceiver52M/sigProcLib.cpp | 15 +++++++++++++-- 2 files changed, 26 insertions(+), 7 deletions(-) (limited to 'Transceiver52M') diff --git a/Transceiver52M/Transceiver.cpp b/Transceiver52M/Transceiver.cpp index d4ca4b9..2e09512 100644 --- a/Transceiver52M/Transceiver.cpp +++ b/Transceiver52M/Transceiver.cpp @@ -44,6 +44,15 @@ using namespace GSM; /* Number of running values use in noise average */ #define NOISE_CNT 20 +/* + * Burst detection threshold + * + * Decision threshold value for burst gating on peak-to-average value of + * correlated synchronization sequences. Lower values pass more bursts up + * to upper layers but will increase the false detection rate. + */ +#define BURST_THRESH 4.0 + TransceiverState::TransceiverState() : mRetrans(false), mNoiseLev(0.0), mNoises(NOISE_CNT), mPower(0.0) { @@ -534,23 +543,22 @@ Transceiver::CorrType Transceiver::expectedCorrType(GSM::Time currTime, int Transceiver::detectBurst(signalVector &burst, complex &, float &toa, CorrType type) { - float threshold = 5.0, rc = 0; + int rc = 0; switch (type) { case EDGE: - rc = detectEdgeBurst(burst, mTSC, threshold, mSPSRx, + rc = detectEdgeBurst(burst, mTSC, BURST_THRESH, mSPSRx, amp, toa, mMaxExpectedDelayNB); if (rc > 0) break; else type = TSC; case TSC: - rc = analyzeTrafficBurst(burst, mTSC, threshold, mSPSRx, + rc = analyzeTrafficBurst(burst, mTSC, BURST_THRESH, mSPSRx, amp, toa, mMaxExpectedDelayNB); break; case RACH: - threshold = 6.0; - rc = detectRACHBurst(burst, threshold, mSPSRx, amp, toa, + rc = detectRACHBurst(burst, BURST_THRESH, mSPSRx, amp, toa, mMaxExpectedDelayAB); break; default: diff --git a/Transceiver52M/sigProcLib.cpp b/Transceiver52M/sigProcLib.cpp index 6495b1e..3682227 100644 --- a/Transceiver52M/sigProcLib.cpp +++ b/Transceiver52M/sigProcLib.cpp @@ -1678,6 +1678,17 @@ release: return status; } +/* + * Peak-to-average computation +/- range from peak in symbols + */ +#define COMPUTE_PEAK_MIN 2 +#define COMPUTE_PEAK_MAX 5 + +/* + * Minimum number of values needed to compute peak-to-average + */ +#define COMPUTE_PEAK_CNT 5 + static float computePeakRatio(signalVector *corr, int sps, float toa, complex amp) { @@ -1691,7 +1702,7 @@ static float computePeakRatio(signalVector *corr, peak = corr->begin() + (int) rint(toa); - for (int i = 2 * sps; i <= 5 * sps; i++) { + for (int i = COMPUTE_PEAK_MIN * sps; i <= COMPUTE_PEAK_MAX * sps; i++) { if (peak - i >= corr->begin()) { avg += (peak - i)->norm2(); num++; @@ -1702,7 +1713,7 @@ static float computePeakRatio(signalVector *corr, } } - if (num < 2) + if (num < COMPUTE_PEAK_CNT) return 0.0; rms = sqrtf(avg / (float) num) + 0.00001; -- cgit v1.2.3