summaryrefslogtreecommitdiff
path: root/gnuradio-core/src/lib
diff options
context:
space:
mode:
authorMatt Ettus2010-12-11 14:42:57 -0800
committerMatt Ettus2010-12-11 14:42:57 -0800
commit9db640f51b3af0cc73a94471a623b4d394ec2aab (patch)
tree7593455cb995652214daa707bbe241a8138b293a /gnuradio-core/src/lib
parent504a2cce5df490bf9a6b2023cc1df568e51da20a (diff)
downloadgnuradio-9db640f51b3af0cc73a94471a623b4d394ec2aab.tar.gz
gnuradio-9db640f51b3af0cc73a94471a623b4d394ec2aab.tar.bz2
gnuradio-9db640f51b3af0cc73a94471a623b4d394ec2aab.zip
Create method to set rate on pfb_arb_resamp after it has been created.
Allow it to be called from GRC.
Diffstat (limited to 'gnuradio-core/src/lib')
-rw-r--r--gnuradio-core/src/lib/filter/gr_pfb_arb_resampler_ccf.cc3
-rw-r--r--gnuradio-core/src/lib/filter/gr_pfb_arb_resampler_ccf.h6
-rw-r--r--gnuradio-core/src/lib/filter/gr_pfb_arb_resampler_ccf.i1
3 files changed, 7 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 59b76a6f0..2136dd843 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
@@ -58,8 +58,7 @@ gr_pfb_arb_resampler_ccf::gr_pfb_arb_resampler_ccf (float rate,
process.
*/
d_int_rate = filter_size;
- d_dec_rate = (unsigned int)floor(d_int_rate/rate);
- d_flt_rate = (d_int_rate/rate) - d_dec_rate;
+ set_rate(rate);
// Store the last filter between calls to work
d_last_filter = 0;
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 cf5a79d4e..44dd202b9 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
@@ -161,7 +161,11 @@ public:
* Print all of the filterbank taps to screen.
*/
void print_taps();
-
+ void set_rate (float rate) {
+ d_dec_rate = (unsigned int)floor(d_int_rate/rate);
+ d_flt_rate = (d_int_rate/rate) - d_dec_rate;
+ }
+
int general_work (int noutput_items,
gr_vector_int &ninput_items,
gr_vector_const_void_star &input_items,
diff --git a/gnuradio-core/src/lib/filter/gr_pfb_arb_resampler_ccf.i b/gnuradio-core/src/lib/filter/gr_pfb_arb_resampler_ccf.i
index 4f07af861..77f28acdf 100644
--- a/gnuradio-core/src/lib/filter/gr_pfb_arb_resampler_ccf.i
+++ b/gnuradio-core/src/lib/filter/gr_pfb_arb_resampler_ccf.i
@@ -38,4 +38,5 @@ class gr_pfb_arb_resampler_ccf : public gr_block
//void set_taps (const std::vector<float> &taps);
void print_taps();
+ void set_rate (float rate);
};