Change in osmo-trx[master]: Transceiver: fix integer division in addRadioVector()

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/.

fixeria gerrit-no-reply at lists.osmocom.org
Wed Jan 20 23:32:49 UTC 2021


fixeria has uploaded this change for review. ( https://gerrit.osmocom.org/c/osmo-trx/+/22350 )


Change subject: Transceiver: fix integer division in addRadioVector()
......................................................................

Transceiver: fix integer division in addRadioVector()

By default, C/C++ compiler does assume integer division.  The
lack of explicit cast to 'double' causes the transceiver to
ignore non-decimal attenuation values (x % 10 > 0):

  txFullScale * 10 ^ ( -3 / 10)
	== txFullScale * 10 ^ 0
	== txFullScale * 1.0

  txFullScale * 10 ^ ( -8 / 10)
	== txFullScale * 10 ^ 0
	== txFullScale * 1.0

  txFullScale * 10 ^ (-10 / 10)
	== txFullScale * 10 ^ -1
	== txFullScale * 0.1

  txFullScale * 10 ^ (-18 / 10)
	== txFullScale * 10 ^ -1
	== txFullScale * 0.1

Change-Id: I85b1063f57f630d90c6da32827bec4a05afc6514
Related: SYS#4918
---
M Transceiver52M/Transceiver.cpp
1 file changed, 1 insertion(+), 1 deletion(-)



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

diff --git a/Transceiver52M/Transceiver.cpp b/Transceiver52M/Transceiver.cpp
index 9c93e98..3188c70 100644
--- a/Transceiver52M/Transceiver.cpp
+++ b/Transceiver52M/Transceiver.cpp
@@ -396,7 +396,7 @@
   else
     burst = modulateBurst(bits, 8 + (wTime.TN() % 4 == 0), cfg->tx_sps);
 
-  scaleVector(*burst, txFullScale * pow(10, -RSSI / 10));
+  scaleVector(*burst, txFullScale * pow(10, (double) -RSSI / 10));
 
   radio_burst = new radioVector(wTime, burst);
 

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

Gerrit-Project: osmo-trx
Gerrit-Branch: master
Gerrit-Change-Id: I85b1063f57f630d90c6da32827bec4a05afc6514
Gerrit-Change-Number: 22350
Gerrit-PatchSet: 1
Gerrit-Owner: fixeria <vyanitskiy at sysmocom.de>
Gerrit-MessageType: newchange
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.osmocom.org/pipermail/gerrit-log/attachments/20210120/22317c27/attachment.htm>


More information about the gerrit-log mailing list