summaryrefslogtreecommitdiffstats
path: root/host
diff options
context:
space:
mode:
authorJason Abele <jason@ettus.com>2010-05-04 17:34:54 -0700
committerJason Abele <jason@ettus.com>2010-05-04 17:34:54 -0700
commit23e0f3d215a320a30731a70590d50003bd718378 (patch)
tree298d453cdb226e809157e1c9440acefa156e28e6 /host
parentad0eb1dcb0e19936d55a7f7f0ab1334a040fb059 (diff)
downloaduhd-23e0f3d215a320a30731a70590d50003bd718378.tar.gz
uhd-23e0f3d215a320a30731a70590d50003bd718378.tar.bz2
uhd-23e0f3d215a320a30731a70590d50003bd718378.zip
Inverted logic in halfband selection
Diffstat (limited to 'host')
-rw-r--r--host/lib/usrp/usrp2/dsp_impl.cpp8
1 files changed, 6 insertions, 2 deletions
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;
}