Change in ...osmo-trx[master]: Transceiver: Move calculation of normalized values (rssiOffset) to pu...

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
Mon Jul 1 19:09:12 UTC 2019


pespin has uploaded this change for review. ( https://gerrit.osmocom.org/c/osmo-trx/+/14640


Change subject: Transceiver: Move calculation of normalized values (rssiOffset) to pullRadioVector()
......................................................................

Transceiver: Move calculation of normalized values (rssiOffset) to pullRadioVector()

That's were all the filling logic happens, while in driveReceiveFIFO we
mostly want to take the burst, generate a message and sent it over the
socket.
In pullRadioVector this way we always provide normalized values based on
user configuration (VTY rssi-offset).

Related: OS#4006
Change-Id: I1ee28daf21dc287bec564d45d58086d63655c0f6
---
M Transceiver52M/Transceiver.cpp
M Transceiver52M/Transceiver.h
2 files changed, 11 insertions(+), 13 deletions(-)



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

diff --git a/Transceiver52M/Transceiver.cpp b/Transceiver52M/Transceiver.cpp
index a0ff4cd..5a6b652 100644
--- a/Transceiver52M/Transceiver.cpp
+++ b/Transceiver52M/Transceiver.cpp
@@ -606,19 +606,19 @@
   burst = radio_burst->getVector(max_i);
   avg = sqrt(avg / radio_burst->chans());
 
-  bi->rssi = 20.0 * log10(rxFullScale / avg);
+  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);
+    bi->noise = 20.0 * log10(rxFullScale / state->mNoiseLev) + rssiOffset;
 
     delete radio_burst;
     return false;
   } else {
     /* Do not update noise levels */
-    bi->noise = 20.0 * log10(rxFullScale / state->mNoiseLev);
+    bi->noise = 20.0 * log10(rxFullScale / state->mNoiseLev) + rssiOffset;
   }
 
   unsigned max_toa = (type == RACH || type == EXT_RACH) ?
@@ -906,22 +906,21 @@
   }
 }
 
-void Transceiver::logRxBurst(size_t chan, const struct trx_ul_burst_ind *bi, double dbm)
+void Transceiver::logRxBurst(size_t chan, const struct trx_ul_burst_ind *bi)
 {
   LOG(DEBUG) << std::fixed << std::right
     << " chan: "   << chan
     << " time: "   << bi->burstTime
-    << " RSSI: "   << std::setw(5) << std::setprecision(1) << bi->rssi
-                   << "dBFS/" << std::setw(6) << -dbm << "dBm"
-    << " noise: "  << std::setw(5) << std::setprecision(1) << bi->noise
-                   << "dBFS/" << std::setw(6) << -(bi->noise + rssiOffset) << "dBm"
+    << " RSSI: "   << std::setw(5) << std::setprecision(1) << (bi->rssi - rssiOffset)
+                   << "dBFS/" << std::setw(6) << -bi->rssi << "dBm"
+    << " noise: "  << std::setw(5) << std::setprecision(1) << (bi->noise - rssiOffset)
+                   << "dBFS/" << std::setw(6) << -bi->noise << "dBm"
     << " TOA: "    << std::setw(5) << std::setprecision(2) << bi->toa
     << " bits: "   << *(bi->rxBurst);
 }
 
 void Transceiver::driveReceiveFIFO(size_t chan)
 {
-  double dBm;  // in dBm
   int TOAint;  // in 1/256 symbols
 
   struct trx_ul_burst_ind bi;
@@ -932,8 +931,7 @@
   // Convert -1..+1 soft bits to 0..1 soft bits
   vectorSlicer(bi.rxBurst);
 
-  dBm = bi.rssi + rssiOffset;
-  logRxBurst(chan, &bi, dBm);
+  logRxBurst(chan, &bi);
 
   TOAint = (int) (bi.toa * 256.0 + 0.5); // round to closest integer
 
@@ -943,7 +941,7 @@
   pkt->common.reserved = 0;
   pkt->common.tn = bi.burstTime.TN();
   osmo_store32be(bi.burstTime.FN(), &pkt->common.fn);
-  pkt->v0.rssi = dBm;
+  pkt->v0.rssi = bi.rssi;
   osmo_store16be(TOAint, &pkt->v0.toa);
   SoftVector::iterator burstItr = bi.rxBurst->begin();
 
diff --git a/Transceiver52M/Transceiver.h b/Transceiver52M/Transceiver.h
index d7c6182..7963519 100644
--- a/Transceiver52M/Transceiver.h
+++ b/Transceiver52M/Transceiver.h
@@ -271,7 +271,7 @@
   /** set priority on current thread */
   void setPriority(float prio = 0.5) { mRadioInterface->setPriority(prio); }
 
-  void logRxBurst(size_t chan, const struct trx_ul_burst_ind *bi, double dbm);
+  void logRxBurst(size_t chan, const struct trx_ul_burst_ind *bi);
 };
 
 void *RxUpperLoopAdapter(TransceiverChannel *);

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

Gerrit-Project: osmo-trx
Gerrit-Branch: master
Gerrit-Change-Id: I1ee28daf21dc287bec564d45d58086d63655c0f6
Gerrit-Change-Number: 14640
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/20190701/ab057a28/attachment.htm>


More information about the gerrit-log mailing list