From 23e0f3d215a320a30731a70590d50003bd718378 Mon Sep 17 00:00:00 2001 From: Jason Abele Date: Tue, 4 May 2010 17:34:54 -0700 Subject: Inverted logic in halfband selection --- host/lib/usrp/usrp2/dsp_impl.cpp | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) (limited to 'host/lib/usrp/usrp2') diff --git a/host/lib/usrp/usrp2/dsp_impl.cpp b/host/lib/usrp/usrp2/dsp_impl.cpp index e6e905fdc..fc4c5479e 100644 --- a/host/lib/usrp/usrp2/dsp_impl.cpp +++ b/host/lib/usrp/usrp2/dsp_impl.cpp @@ -52,13 +52,17 @@ static boost::uint32_t calculate_freq_word_and_update_actual_freq(double &freq, return freq_word; } +// Check if requested decim/interp rate is: +// multiple of 4, enable two halfband filters +// multiple of 2, enable one halfband filter +// handle remainder in CIC static boost::uint32_t calculate_cic_word(size_t rate){ int hb0 = 0, hb1 = 0; - if (rate & 0x1){ + if (not (rate & 0x1)){ hb0 = 1; rate /= 2; } - if (rate & 0x1){ + if (not (rate & 0x1)){ hb1 = 1; rate /= 2; } -- cgit v1.2.3