aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAlexander Chemeris <Alexander.Chemeris@gmail.com>2015-03-25 14:22:37 +0300
committerTom Tsou <tom.tsou@ettus.com>2015-05-18 16:35:25 -0700
commit88bbf1aafd4c5701608a319693a8e69222981eba (patch)
treef9adafb69d37b8fb3cf02f2792dd22cb59aeddaa
parent2cc2ddda41f10ec2f1981c352fae4468cac03237 (diff)
uhd: Use full DAC scale with UmTRX to improve signal quality.
Signed-off-by: Tom Tsou <tom@tsou.cc>
-rw-r--r--Transceiver52M/UHDDevice.cpp20
1 files 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;