aboutsummaryrefslogtreecommitdiffstats
path: root/Transceiver52M/Transceiver.cpp
diff options
context:
space:
mode:
authorAlexander Chemeris <Alexander.Chemeris@gmail.com>2015-06-04 00:14:51 -0400
committerTom Tsou <tom.tsou@ettus.com>2015-07-30 14:17:56 -0700
commitdbe26abcb9e095ce712802d3a64d337a88cae8df (patch)
tree4bc5ec8ee8a5e1219fba74f9462e665bdb0677aa /Transceiver52M/Transceiver.cpp
parente8905a03a540fa91aaba3970577edf9e562bb23d (diff)
Transceiver: Print noise level for each burst in debug mode.
Signed-off-by: Tom Tsou <tom.tsou@ettus.com>
Diffstat (limited to 'Transceiver52M/Transceiver.cpp')
-rw-r--r--Transceiver52M/Transceiver.cpp21
1 files changed, 12 insertions, 9 deletions
diff --git a/Transceiver52M/Transceiver.cpp b/Transceiver52M/Transceiver.cpp
index 71d5d0d..587ade6 100644
--- a/Transceiver52M/Transceiver.cpp
+++ b/Transceiver52M/Transceiver.cpp
@@ -619,7 +619,8 @@ SoftVector *Transceiver::demodulate(TransceiverState *state,
* and burst correlation type. Equalzation is currently disabled.
*/
SoftVector *Transceiver::pullRadioVector(GSM::Time &wTime, double &RSSI,
- double &timingOffset, size_t chan)
+ double &timingOffset, double &noise,
+ size_t chan)
{
bool success, equalize = false;
complex amp;
@@ -694,6 +695,7 @@ SoftVector *Transceiver::pullRadioVector(GSM::Time &wTime, double &RSSI,
wTime = time;
RSSI = 20.0 * log10(rxFullScale / avg);
timingOffset = toa / mSPSRx;
+ noise = 20.0 * log10(rxFullScale / state->mNoiseLev);
delete radio_burst;
@@ -899,21 +901,22 @@ void Transceiver::driveReceiveFIFO(size_t chan)
double dBm; // in dBm
double TOA; // in symbols
int TOAint; // in 1/256 symbols
+ double noise; // noise level in dBFS
GSM::Time burstTime;
- rxBurst = pullRadioVector(burstTime, RSSI, TOA, chan);
+ rxBurst = pullRadioVector(burstTime, RSSI, TOA, noise, chan);
if (rxBurst) {
dBm = RSSI+rssiOffset;
TOAint = (int) (TOA * 256.0 + 0.5); // round to closest integer
- LOG(DEBUG) << "burst parameters: " << std::fixed
- << " time: " << burstTime
- << " RSSI: " << std::setprecision(1) << RSSI
- << " dBm: " << std::setprecision(1) << dBm
- << " TOA: " << std::setprecision(2) << TOA
- << " bits: " << *rxBurst;
-
+ LOG(DEBUG) << std::fixed << std::right
+ << " time: " << burstTime
+ << " RSSI: " << std::setw(5) << std::setprecision(1) << RSSI << "dBFS/" << std::setw(6) << -dBm << "dBm"
+ << " noise: " << std::setw(5) << std::setprecision(1) << noise << "dBFS/" << std::setw(6) << -(noise+rssiOffset) << "dBm"
+ << " TOA: " << std::setw(5) << std::setprecision(2) << TOA
+ << " bits: " << *rxBurst;
+
char burstString[gSlotLen+10];
burstString[0] = burstTime.TN();
for (int i = 0; i < 4; i++)