diff options
author | Tom <trondeau@vt.edu> | 2009-10-19 23:49:11 -0400 |
---|---|---|
committer | Tom <trondeau@vt.edu> | 2009-10-19 23:49:11 -0400 |
commit | 3f60c94858810b605c2f8a343375c57c78a660dc (patch) | |
tree | dc78aa2db75f664b07f441d6e5ad1b14111fd1a5 /gnuradio-core/src/lib | |
parent | c1bca33715f76655c34e35515961eccd3eaa292b (diff) |
Resampler seems to be working for all values of rate
Diffstat (limited to 'gnuradio-core/src/lib')
-rw-r--r-- | gnuradio-core/src/lib/filter/gr_pfb_arb_resampler_ccf.cc | 10 | ||||
-rw-r--r-- | gnuradio-core/src/lib/filter/gr_pfb_arb_resampler_ccf.h | 1 |
2 files changed, 8 insertions, 3 deletions
diff --git a/gnuradio-core/src/lib/filter/gr_pfb_arb_resampler_ccf.cc b/gnuradio-core/src/lib/filter/gr_pfb_arb_resampler_ccf.cc index 392f38a8f5..d00ba67398 100644 --- a/gnuradio-core/src/lib/filter/gr_pfb_arb_resampler_ccf.cc +++ b/gnuradio-core/src/lib/filter/gr_pfb_arb_resampler_ccf.cc @@ -64,6 +64,8 @@ gr_pfb_arb_resampler_ccf::gr_pfb_arb_resampler_ccf (float rate, // Store the last filter between calls to work d_last_filter = 0; + + d_start_index = 0; d_filters = std::vector<gr_fir_ccf*>(d_int_rate); @@ -148,7 +150,7 @@ gr_pfb_arb_resampler_ccf::general_work (int noutput_items, return 0; // history requirements may have changed. } - int i = 0, j, count = 0; + int i = 0, j, count = d_start_index; gr_complex o0, o1; // Restore the last filter position @@ -190,9 +192,11 @@ gr_pfb_arb_resampler_ccf::general_work (int noutput_items, } } - // Store the current filter position + // Store the current filter position and start of next sample d_last_filter = j; + d_start_index = std::max(0, count - ninput_items[0]); - consume_each(count); + // consume all we've processed but no more than we can + consume_each(std::min(count, ninput_items[0])); return i; } diff --git a/gnuradio-core/src/lib/filter/gr_pfb_arb_resampler_ccf.h b/gnuradio-core/src/lib/filter/gr_pfb_arb_resampler_ccf.h index d4c886ec37..bc5b91a5ec 100644 --- a/gnuradio-core/src/lib/filter/gr_pfb_arb_resampler_ccf.h +++ b/gnuradio-core/src/lib/filter/gr_pfb_arb_resampler_ccf.h @@ -118,6 +118,7 @@ class gr_pfb_arb_resampler_ccf : public gr_block float d_flt_rate; // residual rate for the linear interpolation float d_acc; unsigned int d_last_filter; + int d_start_index; unsigned int d_taps_per_filter; bool d_updated; |