<p>fixeria has uploaded this change for <strong>review</strong>.</p><p><a href="https://gerrit.osmocom.org/c/osmo-trx/+/22456">View Change</a></p><pre style="font-family: monospace,monospace; white-space: pre-wrap;">Transceiver: use proper factor for amplitude scaling<br><br>In Transceiver::addRadioVector() we scale the I/Q samples by scaling<br>the output voltage of the DAC.   A relative factor/divisor/ration in<br>the voltage domain cannot be used 1:1 in the power domain.<br><br>There exist two similar formulas:<br><br>  a) X_dB = 10 * log10(X_lin / X_ref)<br>  b) Y_db = 20 * log10(Y_lin / Y_ref)<br><br>both of them are correct, and according to [1]:<br><br>  a) If you convert a quantity X that relates to power or energy,<br>     => the factor is 10.<br>  b) If you convert a quantity Y that relates to amplitude,<br>     => the factor is 20.<br><br>Therefore we should be using 20 instead of 10.  This change makes<br>osmo-trx apply per-lchan attenuation values correctly.  Otherwise<br>it would double the values indicated in TRXD messages.<br><br>[1] https://dspillustrations.com/pages/posts/misc/decibel-conversion-factor-10-or-factor-20.html<br><br>Change-Id: I98bc00bd25df4913d45e55eb008d715aca76fc7c<br>Related: SYS#4918<br>---<br>M Transceiver52M/Transceiver.cpp<br>1 file changed, 1 insertion(+), 1 deletion(-)<br><br></pre><pre style="font-family: monospace,monospace; white-space: pre-wrap;">git pull ssh://gerrit.osmocom.org:29418/osmo-trx refs/changes/56/22456/1</pre><pre style="font-family: monospace,monospace; white-space: pre-wrap;"><span>diff --git a/Transceiver52M/Transceiver.cpp b/Transceiver52M/Transceiver.cpp</span><br><span>index 3188c70..6de266c 100644</span><br><span>--- a/Transceiver52M/Transceiver.cpp</span><br><span>+++ b/Transceiver52M/Transceiver.cpp</span><br><span>@@ -396,7 +396,7 @@</span><br><span>   else</span><br><span>     burst = modulateBurst(bits, 8 + (wTime.TN() % 4 == 0), cfg->tx_sps);</span><br><span> </span><br><span style="color: hsl(0, 100%, 40%);">-  scaleVector(*burst, txFullScale * pow(10, (double) -RSSI / 10));</span><br><span style="color: hsl(120, 100%, 40%);">+  scaleVector(*burst, txFullScale * pow(10, (double) -RSSI / 20));</span><br><span> </span><br><span>   radio_burst = new radioVector(wTime, burst);</span><br><span> </span><br><span></span><br></pre><p>To view, visit <a href="https://gerrit.osmocom.org/c/osmo-trx/+/22456">change 22456</a>. To unsubscribe, or for help writing mail filters, visit <a href="https://gerrit.osmocom.org/settings">settings</a>.</p><div itemscope itemtype="http://schema.org/EmailMessage"><div itemscope itemprop="action" itemtype="http://schema.org/ViewAction"><link itemprop="url" href="https://gerrit.osmocom.org/c/osmo-trx/+/22456"/><meta itemprop="name" content="View Change"/></div></div>

<div style="display:none"> Gerrit-Project: osmo-trx </div>
<div style="display:none"> Gerrit-Branch: master </div>
<div style="display:none"> Gerrit-Change-Id: I98bc00bd25df4913d45e55eb008d715aca76fc7c </div>
<div style="display:none"> Gerrit-Change-Number: 22456 </div>
<div style="display:none"> Gerrit-PatchSet: 1 </div>
<div style="display:none"> Gerrit-Owner: fixeria <vyanitskiy@sysmocom.de> </div>
<div style="display:none"> Gerrit-MessageType: newchange </div>