diff options
author | Tom Rondeau | 2012-06-15 11:53:58 -0400 |
---|---|---|
committer | Tom Rondeau | 2012-06-15 15:59:07 -0400 |
commit | 05c117f359b831513bbf6c4f43dca9cb181e5920 (patch) | |
tree | 3364167872ae34e2c79e10bf72e925267c11ad48 /gr-filter/include/filter | |
parent | 1e7aae3678b0ce08e71b444225aca794f490ffaf (diff) | |
download | gnuradio-05c117f359b831513bbf6c4f43dca9cb181e5920.tar.gz gnuradio-05c117f359b831513bbf6c4f43dca9cb181e5920.tar.bz2 gnuradio-05c117f359b831513bbf6c4f43dca9cb181e5920.zip |
filter: updating adaptive FIR filters.
No need for our own adaptive_fir class; can do everything with fir_filter.
With QA code.
Diffstat (limited to 'gr-filter/include/filter')
-rw-r--r-- | gr-filter/include/filter/CMakeLists.txt | 1 | ||||
-rw-r--r-- | gr-filter/include/filter/adaptive_fir.h | 98 | ||||
-rw-r--r-- | gr-filter/include/filter/adaptive_fir_ccc.h | 6 | ||||
-rw-r--r-- | gr-filter/include/filter/adaptive_fir_ccf.h | 5 |
4 files changed, 5 insertions, 105 deletions
diff --git a/gr-filter/include/filter/CMakeLists.txt b/gr-filter/include/filter/CMakeLists.txt index 2620d3f54..24e63dc0c 100644 --- a/gr-filter/include/filter/CMakeLists.txt +++ b/gr-filter/include/filter/CMakeLists.txt @@ -75,7 +75,6 @@ add_custom_target(filter_generated_includes DEPENDS ######################################################################## install(FILES api.h - adaptive_fir.h firdes.h fir_filter.h fir_filter_with_buffer.h diff --git a/gr-filter/include/filter/adaptive_fir.h b/gr-filter/include/filter/adaptive_fir.h deleted file mode 100644 index 75a5f57db..000000000 --- a/gr-filter/include/filter/adaptive_fir.h +++ /dev/null @@ -1,98 +0,0 @@ -/* -*- c++ -*- */ -/* - * Copyright 2011,2012 Free Software Foundation, Inc. - * - * This file is part of GNU Radio - * - * GNU Radio is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 3, or (at your option) - * any later version. - * - * GNU Radio is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with GNU Radio; see the file COPYING. If not, write to - * the Free Software Foundation, Inc., 51 Franklin Street, - * Boston, MA 02110-1301, USA. - */ - -#ifndef INCLUDED_FILTER_ADAPTIVE_FIR_H -#define INCLUDED_FILTER_ADAPTIVE_FIR_H - -#include <filter/api.h> -#include <vector> -#include <gr_types.h> - -namespace gr { - namespace filter { - namespace kernel { - - class FILTER_API adaptive_fir_ccc - { - protected: - int d_decim; - unsigned int d_ntaps; - gr_complex d_error; - gr_complex *d_taps; - - // Override to calculate error signal per output - virtual gr_complex error(const gr_complex &out) = 0; - - // Override to calculate new weight from old, corresponding input - virtual void update_tap(gr_complex &tap, const gr_complex &in) = 0; - - public: - adaptive_fir_ccc(int decimation, - const std::vector<gr_complex> &taps); - - void set_taps(const std::vector<gr_complex> &taps); - std::vector<gr_complex> taps() const; - - int decimation() const; - unsigned int ntaps() const; - - gr_complex filter(gr_complex *input); - void filterN(gr_complex *out, gr_complex *in, int nitems); - }; - - - /**************************************************************/ - - - class FILTER_API adaptive_fir_ccf - { - protected: - int d_decim; - unsigned int d_ntaps; - float d_error; - gr_complex *d_taps; - - // Override to calculate error signal per output - virtual float error(const gr_complex &out) = 0; - - // Override to calculate new weight from old, corresponding input - virtual void update_tap(gr_complex &tap, const gr_complex &in) = 0; - - public: - adaptive_fir_ccf(int decimation, - const std::vector<float> &taps); - - void set_taps(const std::vector<float> &taps); - std::vector<float> taps() const; - - int decimation() const; - unsigned int ntaps() const; - - gr_complex filter(gr_complex *input); - void filterN(gr_complex *out, gr_complex *in, int nitems); - }; - - } /* namespace kernel */ - } /* namespace filter */ -} /* namespace gr */ - -#endif /* INCLUDED_FILTER_ADAPTIVE_FIR_H */ diff --git a/gr-filter/include/filter/adaptive_fir_ccc.h b/gr-filter/include/filter/adaptive_fir_ccc.h index 14e9f6f53..b30cd353c 100644 --- a/gr-filter/include/filter/adaptive_fir_ccc.h +++ b/gr-filter/include/filter/adaptive_fir_ccc.h @@ -24,8 +24,8 @@ #define INCLUDED_FILTER_ADAPTIVE_FIR_CCC_H #include <filter/api.h> -#include <filter/adaptive_fir.h> #include <gr_sync_decimator.h> +#include <filter/fir_filter.h> namespace gr { namespace filter { @@ -43,8 +43,8 @@ namespace gr { static FILTER_API sptr make(const char *name, int decimation, const std::vector<gr_complex> &taps); - void set_taps(const std::vector<gr_complex> &taps); - std::vector<gr_complex> taps(); + virtual void set_taps(const std::vector<gr_complex> &taps) = 0; + virtual std::vector<gr_complex> taps() const = 0; }; } /* namespace filter */ diff --git a/gr-filter/include/filter/adaptive_fir_ccf.h b/gr-filter/include/filter/adaptive_fir_ccf.h index 8eb01c877..0503acd4e 100644 --- a/gr-filter/include/filter/adaptive_fir_ccf.h +++ b/gr-filter/include/filter/adaptive_fir_ccf.h @@ -24,7 +24,6 @@ #define INCLUDED_FILTER_ADAPTIVE_FIR_CCF_H #include <filter/api.h> -#include <filter/adaptive_fir.h> #include <gr_sync_decimator.h> namespace gr { @@ -43,8 +42,8 @@ namespace gr { static FILTER_API sptr make(const char *name, int decimation, const std::vector<float> &taps); - void set_taps(const std::vector<float> &taps); - std::vector<float> taps(); + virtual void set_taps(const std::vector<float> &taps) = 0; + virtual std::vector<float> taps() = 0; }; } /* namespace filter */ |