diff options
author | Josh Blum <josh@joshknows.com> | 2010-07-16 13:11:10 -0700 |
---|---|---|
committer | Josh Blum <josh@joshknows.com> | 2010-07-16 13:11:10 -0700 |
commit | cc087a3417041c978d0be4ea155dbfc715c5b599 (patch) | |
tree | 3aca5504ac7372161f0ea278634711a3ec44476a /host/lib | |
parent | bbf57e94e9f18b5f31a2ab784f97428898901492 (diff) | |
download | uhd-cc087a3417041c978d0be4ea155dbfc715c5b599.tar.gz uhd-cc087a3417041c978d0be4ea155dbfc715c5b599.tar.bz2 uhd-cc087a3417041c978d0be4ea155dbfc715c5b599.zip |
uhd: include code_rate/2 as part of the tunable frequency range
Diffstat (limited to 'host/lib')
-rw-r--r-- | host/lib/usrp/mimo_usrp.cpp | 9 | ||||
-rw-r--r-- | host/lib/usrp/simple_usrp.cpp | 9 |
2 files changed, 14 insertions, 4 deletions
diff --git a/host/lib/usrp/mimo_usrp.cpp b/host/lib/usrp/mimo_usrp.cpp index b40f98226..fbb863022 100644 --- a/host/lib/usrp/mimo_usrp.cpp +++ b/host/lib/usrp/mimo_usrp.cpp @@ -33,6 +33,11 @@ using namespace uhd; using namespace uhd::usrp; +static inline freq_range_t add_dsp_shift(const freq_range_t &range, wax::obj dsp){ + double codec_rate = dsp[DSP_PROP_CODEC_RATE].as<double>(); + return freq_range_t(range.min - codec_rate/2.0, range.max + codec_rate/2.0); +} + /*********************************************************************** * MIMO USRP Implementation **********************************************************************/ @@ -188,7 +193,7 @@ public: } freq_range_t get_rx_freq_range(size_t chan){ - return _rx_subdevs.at(chan)[SUBDEV_PROP_FREQ_RANGE].as<freq_range_t>(); + return add_dsp_shift(_rx_subdevs.at(chan)[SUBDEV_PROP_FREQ_RANGE].as<freq_range_t>(), _rx_dsps.at(chan)); } void set_rx_gain(size_t chan, float gain){ @@ -251,7 +256,7 @@ public: } freq_range_t get_tx_freq_range(size_t chan){ - return _tx_subdevs.at(chan)[SUBDEV_PROP_FREQ_RANGE].as<freq_range_t>(); + return add_dsp_shift(_tx_subdevs.at(chan)[SUBDEV_PROP_FREQ_RANGE].as<freq_range_t>(), _tx_dsps.at(chan)); } void set_tx_gain(size_t chan, float gain){ diff --git a/host/lib/usrp/simple_usrp.cpp b/host/lib/usrp/simple_usrp.cpp index 56e82d7ee..f06cc9135 100644 --- a/host/lib/usrp/simple_usrp.cpp +++ b/host/lib/usrp/simple_usrp.cpp @@ -30,6 +30,11 @@ using namespace uhd; using namespace uhd::usrp; +static inline freq_range_t add_dsp_shift(const freq_range_t &range, wax::obj dsp){ + double codec_rate = dsp[DSP_PROP_CODEC_RATE].as<double>(); + return freq_range_t(range.min - codec_rate/2.0, range.max + codec_rate/2.0); +} + /*********************************************************************** * Simple USRP Implementation **********************************************************************/ @@ -126,7 +131,7 @@ public: } freq_range_t get_rx_freq_range(void){ - return _rx_subdev[SUBDEV_PROP_FREQ_RANGE].as<freq_range_t>(); + return add_dsp_shift(_rx_subdev[SUBDEV_PROP_FREQ_RANGE].as<freq_range_t>(), _rx_dsp); } void set_rx_gain(float gain){ @@ -181,7 +186,7 @@ public: } freq_range_t get_tx_freq_range(void){ - return _tx_subdev[SUBDEV_PROP_FREQ_RANGE].as<freq_range_t>(); + return add_dsp_shift(_tx_subdev[SUBDEV_PROP_FREQ_RANGE].as<freq_range_t>(), _tx_dsp); } void set_tx_gain(float gain){ |