mirror of
https://gitea.osmocom.org/cellular-infrastructure/osmo-trx.git
synced 2025-11-03 21:53:18 +00:00
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
This commit is contained in:
@@ -631,19 +631,18 @@ bool Transceiver::pullRadioVector(size_t chan, struct trx_ul_burst_ind *bi)
|
||||
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) ?
|
||||
|
||||
Reference in New Issue
Block a user