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
This commit is contained in:
ttsou 2012-12-06 15:43:55 +00:00
parent 9eafbe9c88
commit e8dde02a66
1 changed files with 4 additions and 1 deletions

View File

@ -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) {