Change in ...osmo-trx[master]: Transceiver: Avoid noise calculation formula in 2 branches in pullRad...

pespin gerrit-no-reply at lists.osmocom.org
Sun Jul 7 14:48:31 UTC 2019


pespin has submitted this change and it was merged. ( https://gerrit.osmocom.org/c/osmo-trx/+/14661 )

Change subject: Transceiver: Avoid noise calculation formula in 2 branches in pullRadioVector
......................................................................

Transceiver: Avoid noise calculation formula in 2 branches in pullRadioVector

Makes code easier to follow and will help in forthcoming refactoring
once idle frames are supported.

Change-Id: I56c84e9684ca460efd6c983d7e95d8e455bcac69
---
M Transceiver52M/Transceiver.cpp
1 file changed, 5 insertions(+), 6 deletions(-)

Approvals:
  Jenkins Builder: Verified
  fixeria: Looks good to me, but someone else must approve
  laforge: Looks good to me, approved



diff --git a/Transceiver52M/Transceiver.cpp b/Transceiver52M/Transceiver.cpp
index 58e8719..7f05a2c 100644
--- a/Transceiver52M/Transceiver.cpp
+++ b/Transceiver52M/Transceiver.cpp
@@ -631,19 +631,18 @@
   burst = radio_burst->getVector(max_i);
   avg = sqrt(avg / radio_burst->chans());
 
-  bi->rssi = 20.0 * log10(rxFullScale / avg) + rssiOffset;
-
   if (type == IDLE) {
     /* Update noise levels */
     state->mNoises.insert(avg);
     state->mNoiseLev = state->mNoises.avg();
-    bi->noise = 20.0 * log10(rxFullScale / state->mNoiseLev) + rssiOffset;
+  }
 
+  bi->rssi = 20.0 * log10(rxFullScale / avg) + rssiOffset;
+  bi->noise = 20.0 * log10(rxFullScale / state->mNoiseLev) + rssiOffset;
+
+  if (type == IDLE) {
     delete radio_burst;
     return false;
-  } else {
-    /* Do not update noise levels */
-    bi->noise = 20.0 * log10(rxFullScale / state->mNoiseLev) + rssiOffset;
   }
 
   unsigned max_toa = (type == RACH || type == EXT_RACH) ?

-- 
To view, visit https://gerrit.osmocom.org/c/osmo-trx/+/14661
To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings

Gerrit-Project: osmo-trx
Gerrit-Branch: master
Gerrit-Change-Id: I56c84e9684ca460efd6c983d7e95d8e455bcac69
Gerrit-Change-Number: 14661
Gerrit-PatchSet: 1
Gerrit-Owner: pespin <pespin at sysmocom.de>
Gerrit-Reviewer: Jenkins Builder
Gerrit-Reviewer: fixeria <axilirator at gmail.com>
Gerrit-Reviewer: laforge <laforge at gnumonks.org>
Gerrit-Reviewer: pespin <pespin at sysmocom.de>
Gerrit-MessageType: merged
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.osmocom.org/pipermail/gerrit-log/attachments/20190707/87d35ed1/attachment.html>


More information about the gerrit-log mailing list