aboutsummaryrefslogtreecommitdiffstats
path: root/host/lib/usrp/dsp_utils.hpp
diff options
context:
space:
mode:
authorJosh Blum <josh@joshknows.com>2010-07-22 23:27:57 -0700
committerJosh Blum <josh@joshknows.com>2010-07-22 23:27:57 -0700
commit1e2f457ee118f55d753a4c124315ab17f8eb5f1b (patch)
tree0a65dae004c693504c1f9a8f6734c3a311d190a1 /host/lib/usrp/dsp_utils.hpp
parentab4304f827cdfb5d46e392a14bad012378e4c4e7 (diff)
downloaduhd-1e2f457ee118f55d753a4c124315ab17f8eb5f1b.tar.gz
uhd-1e2f457ee118f55d753a4c124315ab17f8eb5f1b.tar.bz2
uhd-1e2f457ee118f55d753a4c124315ab17f8eb5f1b.zip
usrp: fix the N/2 cordic tune issue, use boost math sign inplace of my signum
Diffstat (limited to 'host/lib/usrp/dsp_utils.hpp')
-rw-r--r--host/lib/usrp/dsp_utils.hpp4
1 files changed, 2 insertions, 2 deletions
diff --git a/host/lib/usrp/dsp_utils.hpp b/host/lib/usrp/dsp_utils.hpp
index 2f246c788..ebed12c41 100644
--- a/host/lib/usrp/dsp_utils.hpp
+++ b/host/lib/usrp/dsp_utils.hpp
@@ -82,11 +82,11 @@ namespace dsp_type1{
double &freq,
double codec_rate
){
- UHD_ASSERT_THROW(freq >= -codec_rate/2.0 and freq < codec_rate/2.0);
+ 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 (signed)
- boost::int32_t freq_word = boost::math::iround((freq / codec_rate) * scale_factor);
+ boost::int32_t freq_word = boost::int32_t(boost::math::round((freq / codec_rate) * scale_factor));
//update the actual frequency
freq = (double(freq_word) / scale_factor) * codec_rate;