aboutsummaryrefslogtreecommitdiffstats
path: root/Transceiver52M
diff options
context:
space:
mode:
authorThomas Tsou <tom@tsou.cc>2013-10-18 10:50:52 -0400
committerThomas Tsou <tom@tsou.cc>2013-10-18 13:10:18 -0400
commita1a3ab4babf591cf9c0d233d93b1188f747f5259 (patch)
tree2e5bbb98ea50e1ab712f5a3448cabc45d69e930d /Transceiver52M
parentfa3a787ccbb250d929ebf78993047dd05e8765cb (diff)
Transceiver52M: Update RSSI calculation
Use the same measurement method for RSSI as the noise level. Previous method was to use the peak correlation amplitude relative to the expected value. This created two very different amplitude approaches between the noise measurement and RSSI measurement, which would throw off the upper layer MS power control loop. Signed-off-by: Thomas Tsou <tom@tsou.cc>
Diffstat (limited to 'Transceiver52M')
-rw-r--r--Transceiver52M/Transceiver.cpp7
1 files changed, 4 insertions, 3 deletions
diff --git a/Transceiver52M/Transceiver.cpp b/Transceiver52M/Transceiver.cpp
index bd7e7c6..9a62365 100644
--- a/Transceiver52M/Transceiver.cpp
+++ b/Transceiver52M/Transceiver.cpp
@@ -329,6 +329,7 @@ SoftVector *Transceiver::pullRadioVector(GSM::Time &wTime,
// Update noise level
mNoiseLev = mNoises.avg();
+ avg = sqrt(avg);
// run the proper correlator
if (corrType==TSC) {
@@ -372,7 +373,7 @@ SoftVector *Transceiver::pullRadioVector(GSM::Time &wTime,
}
else {
channelResponse[timeslot] = NULL;
- mNoises.insert(sqrt(avg));
+ mNoises.insert(avg);
}
}
else {
@@ -380,7 +381,7 @@ SoftVector *Transceiver::pullRadioVector(GSM::Time &wTime,
if (success = detectRACHBurst(*vectorBurst, 6.0, mSPSRx, &amplitude, &TOA))
channelResponse[timeslot] = NULL;
else
- mNoises.insert(sqrt(avg));
+ mNoises.insert(avg);
}
// demodulate burst
@@ -397,7 +398,7 @@ SoftVector *Transceiver::pullRadioVector(GSM::Time &wTime,
*DFEFeedback[timeslot]);
}
wTime = rxBurst->getTime();
- RSSI = (int) floor(20.0*log10(rxFullScale/amplitude.abs()));
+ RSSI = (int) floor(20.0*log10(rxFullScale/avg));
LOG(DEBUG) << "RSSI: " << RSSI;
timingOffset = (int) round(TOA * 256.0 / mSPSRx);
}