diff options
author | Thomas Tsou <tom@tsou.cc> | 2013-11-14 15:31:24 -0500 |
---|---|---|
committer | Thomas Tsou <tom@tsou.cc> | 2013-11-15 23:35:07 -0500 |
commit | ef25dba4e7c0564053f949ae22af2dd055bd2439 (patch) | |
tree | 6caecc4e67cec051204658c714d3007b521b4dfb | |
parent | 2d0c00bd3d8f52690aeb86001cb4a268fed59463 (diff) |
Transceiver52M: Ignore detected bursts at the noise floor
The transceiver has the ability to detect bursts below the noise floor,
but little hope in successful decoding, so don't even try. We still use
the detected burst to differentiate against noise vs actual data.
Signed-off-by: Thomas Tsou <tom@tsou.cc>
-rw-r--r-- | Transceiver52M/Transceiver.cpp | 9 |
1 files changed, 5 insertions, 4 deletions
diff --git a/Transceiver52M/Transceiver.cpp b/Transceiver52M/Transceiver.cpp index 33d22ad..3e2f838 100644 --- a/Transceiver52M/Transceiver.cpp +++ b/Transceiver52M/Transceiver.cpp @@ -429,7 +429,7 @@ SoftVector *Transceiver::pullRadioVector(GSM::Time &wTime, int &RSSI, float toa, pow, max = -1.0, avg = 0.0; int max_i = -1; signalVector *burst; - SoftVector *bits; + SoftVector *bits = NULL; /* Blocking FIFO read */ radioVector *radio_burst = mReceiveFIFO[chan]->read(); @@ -463,9 +463,8 @@ SoftVector *Transceiver::pullRadioVector(GSM::Time &wTime, int &RSSI, /* Average noise on diversity paths and update global levels */ burst = radio_burst->getVector(max_i); - avg = avg / radio_burst->chans(); + avg = sqrt(avg / radio_burst->chans()); mNoiseLev = mNoises.avg(); - avg = sqrt(avg); /* Detect normal or RACH bursts */ if (type == TSC) @@ -483,7 +482,9 @@ SoftVector *Transceiver::pullRadioVector(GSM::Time &wTime, int &RSSI, if (equalize && (type != TSC)) equalize = false; - bits = demodulate(&mStates[chan], *burst, amp, toa, time.TN(), equalize); + if (avg - mNoiseLev > 0.0) + bits = demodulate(&mStates[chan], *burst, amp, toa, time.TN(), equalize); + wTime = time; RSSI = (int) floor(20.0 * log10(rxFullScale / avg)); timingOffset = (int) round(toa * 256.0 / mSPSRx); |