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

This is merely a historical archive of years 2008-2021, before the migration to mailman3.

A maintained and still updated list archive can be found at https://lists.osmocom.org/hyperkitty/list/gerrit-log@lists.osmocom.org/.

pespin gerrit-no-reply at lists.osmocom.org
Wed Jul 3 14:41:55 UTC 2019


pespin has uploaded this change for review. ( 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(-)



  git pull ssh://gerrit.osmocom.org:29418/osmo-trx refs/changes/61/14661/1

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-MessageType: newchange
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.osmocom.org/pipermail/gerrit-log/attachments/20190703/d853d5e4/attachment.htm>


More information about the gerrit-log mailing list