From 5faab4fbcf423cc614d53f0f3c557c2f055b7ed0 Mon Sep 17 00:00:00 2001 From: Tom Rondeau Date: Thu, 22 Dec 2011 18:19:28 -0500 Subject: filters: added accessor functions to FFT and FIR filter classes to return vector of taps. --- gnuradio-core/src/lib/filter/gr_fft_filter_ccc.cc | 7 +++++++ gnuradio-core/src/lib/filter/gr_fft_filter_ccc.h | 1 + gnuradio-core/src/lib/filter/gr_fft_filter_ccc.i | 1 + gnuradio-core/src/lib/filter/gr_fft_filter_fff.cc | 8 +++++++- gnuradio-core/src/lib/filter/gr_fft_filter_fff.h | 1 + gnuradio-core/src/lib/filter/gr_fft_filter_fff.i | 1 + gnuradio-core/src/lib/filter/gr_fir_filter_XXX.cc.t | 6 ++++++ gnuradio-core/src/lib/filter/gr_fir_filter_XXX.h.t | 1 + gnuradio-core/src/lib/filter/gr_fir_filter_XXX.i.t | 1 + 9 files changed, 26 insertions(+), 1 deletion(-) (limited to 'gnuradio-core/src/lib') diff --git a/gnuradio-core/src/lib/filter/gr_fft_filter_ccc.cc b/gnuradio-core/src/lib/filter/gr_fft_filter_ccc.cc index 02bfaf105..9fa98cc69 100644 --- a/gnuradio-core/src/lib/filter/gr_fft_filter_ccc.cc +++ b/gnuradio-core/src/lib/filter/gr_fft_filter_ccc.cc @@ -62,6 +62,7 @@ gr_fft_filter_ccc::gr_fft_filter_ccc (int decimation, const std::vectorset_taps(taps); set_output_multiple(d_nsamples); } @@ -78,6 +79,12 @@ gr_fft_filter_ccc::set_taps (const std::vector &taps) d_updated = true; } +std::vector +gr_fft_filter_ccc::taps () const +{ + return d_new_taps; +} + int gr_fft_filter_ccc::work (int noutput_items, gr_vector_const_void_star &input_items, diff --git a/gnuradio-core/src/lib/filter/gr_fft_filter_ccc.h b/gnuradio-core/src/lib/filter/gr_fft_filter_ccc.h index 721a44a83..1b72a1c00 100644 --- a/gnuradio-core/src/lib/filter/gr_fft_filter_ccc.h +++ b/gnuradio-core/src/lib/filter/gr_fft_filter_ccc.h @@ -62,6 +62,7 @@ class GR_CORE_API gr_fft_filter_ccc : public gr_sync_decimator ~gr_fft_filter_ccc (); void set_taps (const std::vector &taps); + std::vector taps () const; int work (int noutput_items, gr_vector_const_void_star &input_items, diff --git a/gnuradio-core/src/lib/filter/gr_fft_filter_ccc.i b/gnuradio-core/src/lib/filter/gr_fft_filter_ccc.i index aa7564f54..812920d8b 100644 --- a/gnuradio-core/src/lib/filter/gr_fft_filter_ccc.i +++ b/gnuradio-core/src/lib/filter/gr_fft_filter_ccc.i @@ -36,4 +36,5 @@ class gr_fft_filter_ccc : public gr_sync_decimator ~gr_fft_filter_ccc (); void set_taps (const std::vector &taps); + std::vector taps () const; }; diff --git a/gnuradio-core/src/lib/filter/gr_fft_filter_fff.cc b/gnuradio-core/src/lib/filter/gr_fft_filter_fff.cc index e5b218f20..c0a9b3483 100644 --- a/gnuradio-core/src/lib/filter/gr_fft_filter_fff.cc +++ b/gnuradio-core/src/lib/filter/gr_fft_filter_fff.cc @@ -55,7 +55,7 @@ gr_fft_filter_fff::gr_fft_filter_fff (int decimation, const std::vector & #else d_filter = new gri_fft_filter_fff_sse(decimation, taps); #endif - + d_new_taps = taps; d_nsamples = d_filter->set_taps(taps); set_output_multiple(d_nsamples); } @@ -72,6 +72,12 @@ gr_fft_filter_fff::set_taps (const std::vector &taps) d_updated = true; } +std::vector +gr_fft_filter_fff::taps () const +{ + return d_new_taps; +} + int gr_fft_filter_fff::work (int noutput_items, gr_vector_const_void_star &input_items, diff --git a/gnuradio-core/src/lib/filter/gr_fft_filter_fff.h b/gnuradio-core/src/lib/filter/gr_fft_filter_fff.h index b0dc74883..ddd8dcac2 100644 --- a/gnuradio-core/src/lib/filter/gr_fft_filter_fff.h +++ b/gnuradio-core/src/lib/filter/gr_fft_filter_fff.h @@ -62,6 +62,7 @@ class GR_CORE_API gr_fft_filter_fff : public gr_sync_decimator ~gr_fft_filter_fff (); void set_taps (const std::vector &taps); + std::vector taps () const; int work (int noutput_items, gr_vector_const_void_star &input_items, diff --git a/gnuradio-core/src/lib/filter/gr_fft_filter_fff.i b/gnuradio-core/src/lib/filter/gr_fft_filter_fff.i index bbe84f99f..7e2cde977 100644 --- a/gnuradio-core/src/lib/filter/gr_fft_filter_fff.i +++ b/gnuradio-core/src/lib/filter/gr_fft_filter_fff.i @@ -36,4 +36,5 @@ class gr_fft_filter_fff : public gr_sync_decimator ~gr_fft_filter_fff (); void set_taps (const std::vector &taps); + std::vector taps () const; }; diff --git a/gnuradio-core/src/lib/filter/gr_fir_filter_XXX.cc.t b/gnuradio-core/src/lib/filter/gr_fir_filter_XXX.cc.t index 29e351925..f7458e743 100644 --- a/gnuradio-core/src/lib/filter/gr_fir_filter_XXX.cc.t +++ b/gnuradio-core/src/lib/filter/gr_fir_filter_XXX.cc.t @@ -63,6 +63,12 @@ void d_updated = true; } +std::vector<@TAP_TYPE@> +@NAME@::taps () const +{ + return d_new_taps; +} + int @NAME@::work (int noutput_items, gr_vector_const_void_star &input_items, diff --git a/gnuradio-core/src/lib/filter/gr_fir_filter_XXX.h.t b/gnuradio-core/src/lib/filter/gr_fir_filter_XXX.h.t index db0625504..f638e7bb5 100644 --- a/gnuradio-core/src/lib/filter/gr_fir_filter_XXX.h.t +++ b/gnuradio-core/src/lib/filter/gr_fir_filter_XXX.h.t @@ -59,6 +59,7 @@ class GR_CORE_API @NAME@ : public gr_sync_decimator ~@NAME@ (); void set_taps (const std::vector<@TAP_TYPE@> &taps); + std::vector<@TAP_TYPE@> taps () const; int work (int noutput_items, gr_vector_const_void_star &input_items, diff --git a/gnuradio-core/src/lib/filter/gr_fir_filter_XXX.i.t b/gnuradio-core/src/lib/filter/gr_fir_filter_XXX.i.t index 0cbe8cbcc..fb4ff95af 100644 --- a/gnuradio-core/src/lib/filter/gr_fir_filter_XXX.i.t +++ b/gnuradio-core/src/lib/filter/gr_fir_filter_XXX.i.t @@ -38,4 +38,5 @@ class @NAME@ : public gr_sync_decimator ~@NAME@ (); void set_taps (const std::vector<@TAP_TYPE@> &taps); + std::vector<@TAP_TYPE@> taps () const; }; -- cgit