transceiver: fix energy threshold bug
If no bursts were received over a long enough duration then the threshold would roll into negative territory. The energy detection is based on a comparison with the squared threshold, so all handsets would become effectively barred after a certain period of inactivity. In theory, this bug also exists in the mainline tree, but there the daughterboard receive gain is fixed at max, which always allows the ADC to generate sufficient noise to trigger the energy dectector and keep the system in a valid steady state. To fix, simply add a negative value check like those already in place for other locations. Signed-off-by: Thomas Tsou <ttsou@vt.edu>
This commit is contained in:
parent
f398757fe6
commit
3896e7499f
|
@ -301,6 +301,9 @@ SoftVector *Transceiver::pullRadioVector(GSM::Time &wTime,
|
|||
double framesElapsed = rxBurst->time()-prevFalseDetectionTime;
|
||||
if (framesElapsed > 50) { // if we haven't had any false detections for a while, lower threshold
|
||||
mEnergyThreshold -= 10.0;
|
||||
if (mEnergyThreshold < 0.0)
|
||||
mEnergyThreshold = 0.0;
|
||||
|
||||
prevFalseDetectionTime = rxBurst->time();
|
||||
}
|
||||
delete rxBurst;
|
||||
|
|
|
@ -303,6 +303,9 @@ SoftVector *Transceiver::pullRadioVector(GSM::Time &wTime,
|
|||
double framesElapsed = rxBurst->time()-prevFalseDetectionTime;
|
||||
if (framesElapsed > 50) { // if we haven't had any false detections for a while, lower threshold
|
||||
mEnergyThreshold -= 10.0/10.0;
|
||||
if (mEnergyThreshold < 0.0)
|
||||
mEnergyThreshold = 0.0;
|
||||
|
||||
prevFalseDetectionTime = rxBurst->time();
|
||||
}
|
||||
delete rxBurst;
|
||||
|
|
Reference in New Issue