diff options
authorHarald Welte <laforge@gnumonks.org>2018-11-26 19:17:00 +0100
committerHarald Welte <laforge@gnumonks.org>2018-11-29 13:23:08 +0100
commit0277b58f6de295046ce53dc1722a3ed0b29af6ce (patch)
parentbe8a83f681368307ca1c2d8726d27f5b98973231 (diff)
lms: User correct scale factor for transmit samples
Due to (I believe) a copy+paste mistake from the USRP1 code, we were using only a scale range of up to 9830 when transmitting samples, rather than the full 16 bit signed integer range up to 32767. As a result, we were loosing almost two bits (MSBs) of resolution as well as a lot of transmit power. This changes the scale factor to 0.707 (1/sqrt(2)). Please note that the much higher DAC output level means that the analog gain should be reduced. The theoretic range of up to 73dB should not be used, but Lime Microsystems suggest a value of 61..67 dB. This can be achieved by using a "osmotrx tx-attenuation" value of 6..12 inside the osmo-bts-trx configuration file. Related: OS#3341 Related: OS#3342 Change-Id: I71702feaa11f53e7614a6938a984dd748405474a
1 files changed, 8 insertions, 1 deletions
diff --git a/Transceiver52M/device/lms/LMSDevice.h b/Transceiver52M/device/lms/LMSDevice.h
index 349efbb..6635c13 100644
--- a/Transceiver52M/device/lms/LMSDevice.h
+++ b/Transceiver52M/device/lms/LMSDevice.h
@@ -28,7 +28,14 @@
#include <iostream>
#include <lime/LimeSuite.h>
-#define LIMESDR_TX_AMPL 0.3
+/* Definition of LIMESDR_TX_AMPL limits maximum amplitude of I and Q
+ * channels separately. Hence LIMESDR_TX_AMPL value must be 1/sqrt(2) =
+ * 0.7071.... to get an amplitude of 1 of the complex signal:
+ * A^2 = I^2 + Q^2
+ * A^2 = (1/sqrt(2))^2 + (1/sqrt(2))^2
+ * A^2 = 1/2 + 1/2
+ * A^2 = 1 */
+#define LIMESDR_TX_AMPL 0.707
/** A class to handle a LimeSuite supported device */
class LMSDevice:public RadioDevice {