aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorttsou <ttsou@19bc5d8c-e614-43d4-8b26-e1612bc8e597>2012-12-06 15:43:55 +0000
committerttsou <ttsou@19bc5d8c-e614-43d4-8b26-e1612bc8e597>2012-12-06 15:43:55 +0000
commite8dde02a66a3776eead8d89441a04921fd55f274 (patch)
tree17111db57f20cba925df60fd86daa72ea1f2f137
parent9eafbe9c88c67b1b3b05659a933bab7da9bb4612 (diff)
transceiver52m: reset energy threshold on receive gain changes
The adaptive energy detection threshold does not scale relative to signal level. In other words, the adjustment factor will be the same whether the at 40% of signal level or 4%. If the receive gain is reduced by a large amount, suppose 20 dB, the receiver may take minutes to adjust to the new level. When the receive gain is changed, reset the threshold back to the initial level. This reduces issues of runtime gain adjustment and prevents blocking bursts while the threhold level slowly adjusts. Signed-off-by: Thomas Tsou <tom@tsou.cc> git-svn-id: http://wush.net/svn/range/software/public/openbts/trunk@4595 19bc5d8c-e614-43d4-8b26-e1612bc8e597
-rw-r--r--Transceiver52M/Transceiver.cpp5
1 files changed, 4 insertions, 1 deletions
diff --git a/Transceiver52M/Transceiver.cpp b/Transceiver52M/Transceiver.cpp
index f5fa822..ff5de49 100644
--- a/Transceiver52M/Transceiver.cpp
+++ b/Transceiver52M/Transceiver.cpp
@@ -44,6 +44,8 @@
# define USB_LATENCY_MIN 1,1
#endif
+#define INIT_ENERGY_THRSHD 5.0f
+
Transceiver::Transceiver(int wBasePort,
const char *TRXAddress,
int wSamplesPerSymbol,
@@ -101,7 +103,7 @@ Transceiver::Transceiver(int wBasePort,
mTxFreq = 0.0;
mRxFreq = 0.0;
mPower = -10;
- mEnergyThreshold = 5.0; // based on empirical data
+ mEnergyThreshold = INIT_ENERGY_THRSHD;
prevFalseDetectionTime = startTime;
}
@@ -506,6 +508,7 @@ void Transceiver::driveControl()
int newGain;
sscanf(buffer,"%3s %s %d",cmdcheck,command,&newGain);
newGain = mRadioInterface->setRxGain(newGain);
+ mEnergyThreshold = INIT_ENERGY_THRSHD;
sprintf(response,"RSP SETRXGAIN 0 %d",newGain);
}
else if (strcmp(command,"NOISELEV")==0) {