diff options
author | cswiger | 2007-04-27 17:36:29 +0000 |
---|---|---|
committer | cswiger | 2007-04-27 17:36:29 +0000 |
commit | 1a1b74dee68348803521593223dd095e1257343f (patch) | |
tree | f32067f9764dc36ffc37186c4a9c7852578250b6 | |
parent | 43819f0f33498239970b4479684f12aa080859e6 (diff) | |
download | gnuradio-1a1b74dee68348803521593223dd095e1257343f.tar.gz gnuradio-1a1b74dee68348803521593223dd095e1257343f.tar.bz2 gnuradio-1a1b74dee68348803521593223dd095e1257343f.zip |
Fixed filter delay offset pointers in atsc_equalizer
git-svn-id: http://gnuradio.org/svn/gnuradio/trunk@5155 221aa14e-8319-0410-a670-987f0aec2ac5
-rw-r--r-- | gr-atsc/src/lib/atsc_equalizer.cc | 22 | ||||
-rw-r--r-- | gr-atsc/src/lib/atsc_equalizer.h | 1 |
2 files changed, 16 insertions, 7 deletions
diff --git a/gr-atsc/src/lib/atsc_equalizer.cc b/gr-atsc/src/lib/atsc_equalizer.cc index f5ad6d0d8..145ba836e 100644 --- a/gr-atsc/src/lib/atsc_equalizer.cc +++ b/gr-atsc/src/lib/atsc_equalizer.cc @@ -59,17 +59,16 @@ atsc_equalizer::forecast (int noutput_items, gr_vector_int &ninput_items_require { int ntaps = d_equalizer->ntaps (); - int npretaps = d_equalizer->npretaps (); - - assert (ntaps >= 1); - assert (npretaps >= 0 && npretaps < ntaps); unsigned ninputs = ninput_items_required.size(); for (unsigned i = 0; i < ninputs; i++) - ninput_items_required[i] = fixed_rate_noutput_to_ninput (noutput_items); + ninput_items_required[i] = fixed_rate_noutput_to_ninput (noutput_items + ntaps); + + } + int atsc_equalizer::work (int noutput_items, gr_vector_const_void_star &input_items, @@ -82,16 +81,25 @@ atsc_equalizer::work (int noutput_items, assert(sizeof(float) == sizeof(atsc::syminfo)); + int ntaps = d_equalizer->ntaps (); + int npretaps = d_equalizer->npretaps (); + + assert (ntaps >= 1); + assert (npretaps >= 0 && npretaps < ntaps); + + int offset = ntaps - npretaps - 1; + assert (offset >= 0 && offset < ntaps); + // peform the actual equalization - d_equalizer->filter (in, in_tags, + d_equalizer->filter (in, in_tags + offset, out, noutput_items); // write the output tags for (int i = 0; i < noutput_items; i++) - out_tags[i] = in_tags[i]; + out_tags[i] = in_tags[i + offset]; return noutput_items; } diff --git a/gr-atsc/src/lib/atsc_equalizer.h b/gr-atsc/src/lib/atsc_equalizer.h index 769902bff..1c2ac7e7d 100644 --- a/gr-atsc/src/lib/atsc_equalizer.h +++ b/gr-atsc/src/lib/atsc_equalizer.h @@ -45,6 +45,7 @@ class atsc_equalizer : public gr_sync_block public: void forecast (int noutput_items, gr_vector_int &ninput_items_required); + int work (int noutput_items, gr_vector_const_void_star &input_items, gr_vector_void_star &output_items); |