From 88bbf1aafd4c5701608a319693a8e69222981eba Mon Sep 17 00:00:00 2001 From: Alexander Chemeris Date: Wed, 25 Mar 2015 14:22:37 +0300 Subject: uhd: Use full DAC scale with UmTRX to improve signal quality. Signed-off-by: Tom Tsou --- Transceiver52M/UHDDevice.cpp | 20 +++++++++++++++++--- 1 file changed, 17 insertions(+), 3 deletions(-) diff --git a/Transceiver52M/UHDDevice.cpp b/Transceiver52M/UHDDevice.cpp index 130a915..c9b71e1 100644 --- a/Transceiver52M/UHDDevice.cpp +++ b/Transceiver52M/UHDDevice.cpp @@ -36,7 +36,8 @@ #define E1XX_CLK_RT 52e6 #define B100_BASE_RT 400000 #define USRP2_BASE_RT 390625 -#define TX_AMPL 0.3 +#define USRP_TX_AMPL 0.3 +#define UMTRX_TX_AMPL 0.7 #define SAMPLE_BUF_SZ (1 << 20) /* @@ -305,8 +306,8 @@ public: inline TIMESTAMP initialWriteTimestamp() { return ts_initial * sps; } inline TIMESTAMP initialReadTimestamp() { return ts_initial; } - inline double fullScaleInputValue() { return 32000 * TX_AMPL; } - inline double fullScaleOutputValue() { return 32000; } + double fullScaleInputValue(); + double fullScaleOutputValue(); double setRxGain(double db, size_t chan); double getRxGain(size_t chan); @@ -1182,6 +1183,19 @@ double uhd_device::getRxFreq(size_t chan) return rx_freqs[chan]; } +double uhd_device::fullScaleInputValue() +{ + if (dev_type == UMTRX) + return (double) SHRT_MAX * UMTRX_TX_AMPL; + else + return (double) SHRT_MAX * USRP_TX_AMPL; +} + +double uhd_device::fullScaleOutputValue() +{ + return (double) SHRT_MAX; +} + bool uhd_device::recv_async_msg() { uhd::async_metadata_t md; -- cgit v1.2.3