aboutsummaryrefslogtreecommitdiffstats
path: root/host/lib/usrp/usrp2/dsp_impl.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'host/lib/usrp/usrp2/dsp_impl.cpp')
-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;
}