aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAlexander Chemeris <Alexander.Chemeris@gmail.com>2015-03-25 14:22:37 +0300
committerTom Tsou <tom@tsou.cc>2015-04-06 18:38:43 -0700
commitc401802eaa6d7b7c4a058fb2800644a8c8ffbd7d (patch)
tree13c19eed8f67369bd0d619e9949fb3bd905912b7
parent3051f34953e3ffdb148329c702348260c2a398d7 (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 6386dee..5fa8d12 100644
--- a/Transceiver52M/UHDDevice.cpp
+++ b/Transceiver52M/UHDDevice.cpp
@@ -39,7 +39,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)
/*
@@ -333,8 +334,8 @@ public:
TIMESTAMP initialWriteTimestamp();
TIMESTAMP initialReadTimestamp();
- 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);
@@ -1250,6 +1251,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;