diff options
-rw-r--r-- | gr-analog/lib/ctcss_squelch_ff_impl.cc | 23 | ||||
-rw-r--r-- | gr-analog/lib/ctcss_squelch_ff_impl.h | 6 | ||||
-rw-r--r-- | gr-fft/include/gnuradio/fft/goertzel.h | 1 |
3 files changed, 16 insertions, 14 deletions
diff --git a/gr-analog/lib/ctcss_squelch_ff_impl.cc b/gr-analog/lib/ctcss_squelch_ff_impl.cc index 9a6f301ba0..5532c70d6f 100644 --- a/gr-analog/lib/ctcss_squelch_ff_impl.cc +++ b/gr-analog/lib/ctcss_squelch_ff_impl.cc @@ -86,15 +86,18 @@ namespace gr { else f_r = ctcss_tones[i+1]; - d_goertzel_l = fft::goertzel(rate, d_len, f_l); - d_goertzel_c = fft::goertzel(rate, d_len, freq); - d_goertzel_r = fft::goertzel(rate, d_len, f_r); + d_goertzel_l = new fft::goertzel(rate, d_len, f_l); + d_goertzel_c = new fft::goertzel(rate, d_len, freq); + d_goertzel_r = new fft::goertzel(rate, d_len, f_r); d_mute = true; } ctcss_squelch_ff_impl::~ctcss_squelch_ff_impl() { + delete d_goertzel_l; + delete d_goertzel_c; + delete d_goertzel_r; } std::vector<float> @@ -111,16 +114,16 @@ namespace gr { void ctcss_squelch_ff_impl::update_state(const float &in) { - d_goertzel_l.input(in); - d_goertzel_c.input(in); - d_goertzel_r.input(in); + d_goertzel_l->input(in); + d_goertzel_c->input(in); + d_goertzel_r->input(in); float rounder = 100000; float d_out_l, d_out_c, d_out_r; - if(d_goertzel_c.ready()) { - d_out_l = floor(rounder*abs(d_goertzel_l.output()))/rounder; - d_out_c = floor(rounder*abs(d_goertzel_c.output()))/rounder; - d_out_r = floor(rounder*abs(d_goertzel_r.output()))/rounder; + if(d_goertzel_c->ready()) { + d_out_l = floor(rounder*abs(d_goertzel_l->output()))/rounder; + d_out_c = floor(rounder*abs(d_goertzel_c->output()))/rounder; + d_out_r = floor(rounder*abs(d_goertzel_r->output()))/rounder; //printf("d_out_l=%f d_out_c=%f d_out_r=%f\n", d_out_l, d_out_c, d_out_r); d_mute = (d_out_c < d_level || d_out_c < d_out_l || d_out_c < d_out_r); diff --git a/gr-analog/lib/ctcss_squelch_ff_impl.h b/gr-analog/lib/ctcss_squelch_ff_impl.h index 8954b213e2..94ba31569f 100644 --- a/gr-analog/lib/ctcss_squelch_ff_impl.h +++ b/gr-analog/lib/ctcss_squelch_ff_impl.h @@ -38,9 +38,9 @@ namespace gr { int d_len; bool d_mute; - fft::goertzel d_goertzel_l; - fft::goertzel d_goertzel_c; - fft::goertzel d_goertzel_r; + fft::goertzel *d_goertzel_l; + fft::goertzel *d_goertzel_c; + fft::goertzel *d_goertzel_r; int find_tone(float freq); diff --git a/gr-fft/include/gnuradio/fft/goertzel.h b/gr-fft/include/gnuradio/fft/goertzel.h index 47ff1dd18c..6d9437f0fa 100644 --- a/gr-fft/include/gnuradio/fft/goertzel.h +++ b/gr-fft/include/gnuradio/fft/goertzel.h @@ -36,7 +36,6 @@ namespace gr { class FFT_API goertzel { public: - goertzel(){} goertzel(int rate, int len, float freq); void set_params(int rate, int len, float freq); |