aboutsummaryrefslogtreecommitdiffstats
path: root/Transceiver52M/Transceiver.cpp
diff options
context:
space:
mode:
authorVadim Yanitskiy <vyanitskiy@sysmocom.de>2021-01-26 23:55:22 +0100
committerVadim Yanitskiy <vyanitskiy@sysmocom.de>2021-01-27 01:01:50 +0100
commit2a637a5c9c1b6e77c00701004ba504ba9d020b28 (patch)
tree54d5ed98c0303e384d81fe52ffc9d1bcb0de3bce /Transceiver52M/Transceiver.cpp
parent819cad1776e09782fffdf433a2e843fe5720d6c8 (diff)
Transceiver: use proper factor for amplitude scaling
In Transceiver::addRadioVector() we scale the I/Q samples by scaling the output voltage of the DAC. A relative factor/divisor/ration in the voltage domain cannot be used 1:1 in the power domain. There exist two similar formulas: a) X_dB = 10 * log10(X_lin / X_ref) b) Y_db = 20 * log10(Y_lin / Y_ref) both of them are correct, and according to [1]: a) If you convert a quantity X that relates to power or energy, => the factor is 10. b) If you convert a quantity Y that relates to amplitude, => the factor is 20. Therefore we should be using 20 instead of 10. This change makes osmo-trx apply per-lchan attenuation values correctly. Otherwise it would double the values indicated in TRXD messages. [1] https://dspillustrations.com/pages/posts/misc/decibel-conversion-factor-10-or-factor-20.html Change-Id: I98bc00bd25df4913d45e55eb008d715aca76fc7c Related: SYS#4918
Diffstat (limited to 'Transceiver52M/Transceiver.cpp')
-rw-r--r--Transceiver52M/Transceiver.cpp2
1 files changed, 1 insertions, 1 deletions
diff --git a/Transceiver52M/Transceiver.cpp b/Transceiver52M/Transceiver.cpp
index 3188c70..6de266c 100644
--- a/Transceiver52M/Transceiver.cpp
+++ b/Transceiver52M/Transceiver.cpp
@@ -396,7 +396,7 @@ void Transceiver::addRadioVector(size_t chan, BitVector &bits,
else
burst = modulateBurst(bits, 8 + (wTime.TN() % 4 == 0), cfg->tx_sps);
- scaleVector(*burst, txFullScale * pow(10, (double) -RSSI / 10));
+ scaleVector(*burst, txFullScale * pow(10, (double) -RSSI / 20));
radio_burst = new radioVector(wTime, burst);