From 0277b58f6de295046ce53dc1722a3ed0b29af6ce Mon Sep 17 00:00:00 2001 From: Harald Welte Date: Mon, 26 Nov 2018 19:17:00 +0100 Subject: 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 --- Transceiver52M/device/lms/LMSDevice.h | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) 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 #include -#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 { -- cgit v1.2.3