diff options
author | Josh Blum <josh@joshknows.com> | 2010-07-14 16:36:59 -0700 |
---|---|---|
committer | Josh Blum <josh@joshknows.com> | 2010-07-14 16:36:59 -0700 |
commit | bf1e3de7ae69aa2f3ba7671ce1e4b85073e567e8 (patch) | |
tree | 4b8dce95206f771f70777cd348ec0765b85b3acf /host/lib | |
parent | 959669e383c75fdcbd11091466516bd5af66cfb5 (diff) | |
download | uhd-bf1e3de7ae69aa2f3ba7671ce1e4b85073e567e8.tar.gz uhd-bf1e3de7ae69aa2f3ba7671ce1e4b85073e567e8.tar.bz2 uhd-bf1e3de7ae69aa2f3ba7671ce1e4b85073e567e8.zip |
uhd: bug in dsp freq word return calculation (signedness)
Diffstat (limited to 'host/lib')
-rw-r--r-- | host/lib/usrp/dsp_utils.hpp | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/host/lib/usrp/dsp_utils.hpp b/host/lib/usrp/dsp_utils.hpp index 3fd5f1811..13186f354 100644 --- a/host/lib/usrp/dsp_utils.hpp +++ b/host/lib/usrp/dsp_utils.hpp @@ -85,13 +85,13 @@ namespace dsp_type1{ UHD_ASSERT_THROW(std::abs(freq) < codec_rate/2.0); static const double scale_factor = std::pow(2.0, 32); - //calculate the freq register word - boost::uint32_t freq_word = boost::math::iround((freq / codec_rate) * scale_factor); + //calculate the freq register word (signed) + boost::int32_t freq_word = boost::math::iround((freq / codec_rate) * scale_factor); //update the actual frequency freq = (double(freq_word) / scale_factor) * codec_rate; - return freq_word; + return boost::uint32_t(freq_word); } /*! |