diff options
Diffstat (limited to 'gr-fft/lib/goertzel_fc_impl.cc')
-rw-r--r-- | gr-fft/lib/goertzel_fc_impl.cc | 85 |
1 files changed, 40 insertions, 45 deletions
diff --git a/gr-fft/lib/goertzel_fc_impl.cc b/gr-fft/lib/goertzel_fc_impl.cc index ba26df0ca3..a8f9d58b5a 100644 --- a/gr-fft/lib/goertzel_fc_impl.cc +++ b/gr-fft/lib/goertzel_fc_impl.cc @@ -28,58 +28,53 @@ #include <gnuradio/io_signature.h> namespace gr { - namespace fft { +namespace fft { - goertzel_fc::sptr goertzel_fc::make(int rate, int len, float freq) - { - return gnuradio::get_initial_sptr(new goertzel_fc_impl(rate, len, freq)); - } +goertzel_fc::sptr goertzel_fc::make(int rate, int len, float freq) +{ + return gnuradio::get_initial_sptr(new goertzel_fc_impl(rate, len, freq)); +} - goertzel_fc_impl::goertzel_fc_impl(int rate, int len, float freq) - : sync_decimator("goertzel_fc", - io_signature::make (1, 1, sizeof(float)), - io_signature::make (1, 1, sizeof(gr_complex)), - len), - d_goertzel(rate, len, freq) - { - d_len = len; - d_rate = rate; - d_freq = freq; - } +goertzel_fc_impl::goertzel_fc_impl(int rate, int len, float freq) + : sync_decimator("goertzel_fc", + io_signature::make(1, 1, sizeof(float)), + io_signature::make(1, 1, sizeof(gr_complex)), + len), + d_goertzel(rate, len, freq) +{ + d_len = len; + d_rate = rate; + d_freq = freq; +} - goertzel_fc_impl::~goertzel_fc_impl() - { - } +goertzel_fc_impl::~goertzel_fc_impl() {} - void - goertzel_fc_impl::set_freq(float freq) - { - d_freq = freq; - d_goertzel.set_params(d_rate, d_len, d_freq); - } +void goertzel_fc_impl::set_freq(float freq) +{ + d_freq = freq; + d_goertzel.set_params(d_rate, d_len, d_freq); +} - void - goertzel_fc_impl::set_rate(int rate) - { - d_rate = rate; - d_goertzel.set_params(d_rate, d_len, d_freq); - } - - int - goertzel_fc_impl::work(int noutput_items, - gr_vector_const_void_star &input_items, - gr_vector_void_star &output_items) - { - float *in = (float *)input_items[0]; - gr_complex *out = (gr_complex *)output_items[0]; +void goertzel_fc_impl::set_rate(int rate) +{ + d_rate = rate; + d_goertzel.set_params(d_rate, d_len, d_freq); +} - for(int i = 0; i < noutput_items; i++) { - *out++ = d_goertzel.batch(in); - in += d_len; - } +int goertzel_fc_impl::work(int noutput_items, + gr_vector_const_void_star& input_items, + gr_vector_void_star& output_items) +{ + float* in = (float*)input_items[0]; + gr_complex* out = (gr_complex*)output_items[0]; - return noutput_items; + for (int i = 0; i < noutput_items; i++) { + *out++ = d_goertzel.batch(in); + in += d_len; } - } /* namespace fft */ + return noutput_items; +} + +} /* namespace fft */ } /* namespace gr */ |