From bf1e3de7ae69aa2f3ba7671ce1e4b85073e567e8 Mon Sep 17 00:00:00 2001 From: Josh Blum Date: Wed, 14 Jul 2010 16:36:59 -0700 Subject: uhd: bug in dsp freq word return calculation (signedness) --- host/lib/usrp/dsp_utils.hpp | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'host/lib') 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); } /*! -- cgit v1.2.3