uhd: Use full DAC scale with UmTRX to improve signal quality.

Signed-off-by: Tom Tsou <tom@tsou.cc>
This commit is contained in:
Alexander Chemeris 2015-03-25 14:22:37 +03:00 committed by Tom Tsou
parent 2cc2ddda41
commit 88bbf1aafd
1 changed files with 17 additions and 3 deletions

View File

@ -36,7 +36,8 @@
#define E1XX_CLK_RT 52e6 #define E1XX_CLK_RT 52e6
#define B100_BASE_RT 400000 #define B100_BASE_RT 400000
#define USRP2_BASE_RT 390625 #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) #define SAMPLE_BUF_SZ (1 << 20)
/* /*
@ -305,8 +306,8 @@ public:
inline TIMESTAMP initialWriteTimestamp() { return ts_initial * sps; } inline TIMESTAMP initialWriteTimestamp() { return ts_initial * sps; }
inline TIMESTAMP initialReadTimestamp() { return ts_initial; } inline TIMESTAMP initialReadTimestamp() { return ts_initial; }
inline double fullScaleInputValue() { return 32000 * TX_AMPL; } double fullScaleInputValue();
inline double fullScaleOutputValue() { return 32000; } double fullScaleOutputValue();
double setRxGain(double db, size_t chan); double setRxGain(double db, size_t chan);
double getRxGain(size_t chan); double getRxGain(size_t chan);
@ -1182,6 +1183,19 @@ double uhd_device::getRxFreq(size_t chan)
return rx_freqs[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() bool uhd_device::recv_async_msg()
{ {
uhd::async_metadata_t md; uhd::async_metadata_t md;