summaryrefslogtreecommitdiff
path: root/gnuradio-core/src
diff options
context:
space:
mode:
authornldudok12007-12-09 17:40:08 +0000
committernldudok12007-12-09 17:40:08 +0000
commit100e6105278e91ab07ae37e88e83b1ab738594c9 (patch)
tree8425af0760ea9bc68d8bfa70de8d1eee9ab40ec1 /gnuradio-core/src
parenta81fada7ab253d3b8a48eab7c301c69c038c118d (diff)
downloadgnuradio-100e6105278e91ab07ae37e88e83b1ab738594c9.tar.gz
gnuradio-100e6105278e91ab07ae37e88e83b1ab738594c9.tar.bz2
gnuradio-100e6105278e91ab07ae37e88e83b1ab738594c9.zip
bugfix for indexnumbers in IIR filter
git-svn-id: http://gnuradio.org/svn/gnuradio/trunk@7089 221aa14e-8319-0410-a670-987f0aec2ac5
Diffstat (limited to 'gnuradio-core/src')
-rw-r--r--gnuradio-core/src/lib/filter/gri_iir.h13
1 files changed, 7 insertions, 6 deletions
diff --git a/gnuradio-core/src/lib/filter/gri_iir.h b/gnuradio-core/src/lib/filter/gri_iir.h
index 5bc67df53..61d3be44d 100644
--- a/gnuradio-core/src/lib/filter/gri_iir.h
+++ b/gnuradio-core/src/lib/filter/gri_iir.h
@@ -143,12 +143,6 @@ gri_iir<i_type, o_type, tap_type>::filter (const i_type input)
for (i = 1; i < m; i ++)
acc += (d_fbtaps[i] * d_prev_output[latest_m + i]);
- // store the values twice to avoid having to handle wrap-around in the loop
- d_prev_output[latest_m] = acc;
- d_prev_output[latest_m+m] = acc;
- d_prev_input[latest_n] = input;
- d_prev_input[latest_n+n] = input;
-
latest_n--;
latest_m--;
if (latest_n < 0)
@@ -156,6 +150,13 @@ gri_iir<i_type, o_type, tap_type>::filter (const i_type input)
if (latest_m < 0)
latest_m += m;
+ // store the values twice to avoid having to handle wrap-around in the loop
+ d_prev_output[latest_m] = acc;
+ d_prev_output[latest_m+m] = acc;
+ d_prev_input[latest_n] = input;
+ d_prev_input[latest_n+n] = input;
+
+
d_latest_m = latest_m;
d_latest_n = latest_n;
return (o_type) acc;