summaryrefslogtreecommitdiff
path: root/gr-filter/include
diff options
context:
space:
mode:
authorTom Rondeau <trondeau@vt.edu>2012-05-09 20:17:39 -0400
committerTom Rondeau <trondeau@vt.edu>2012-05-09 20:17:39 -0400
commit511f351466e77fb49cc26d21fca3396f2213a44c (patch)
tree0cd3dd1b5be3b0913dac2d6f22ba03ad5a35fcb2 /gr-filter/include
parent274bc141208ac8209c6b3342ff5ddc3755b321de (diff)
filter: wip: working on adaptive FIR filter. Moved ccc and created parent class that is not a gr_block.
Diffstat (limited to 'gr-filter/include')
-rw-r--r--gr-filter/include/filter/CMakeLists.txt2
-rw-r--r--gr-filter/include/filter/adaptive_fir.h69
-rw-r--r--gr-filter/include/filter/adaptive_fir_ccc.h53
3 files changed, 124 insertions, 0 deletions
diff --git a/gr-filter/include/filter/CMakeLists.txt b/gr-filter/include/filter/CMakeLists.txt
index 0c067fcba0..98cd2161ea 100644
--- a/gr-filter/include/filter/CMakeLists.txt
+++ b/gr-filter/include/filter/CMakeLists.txt
@@ -75,6 +75,7 @@ add_custom_target(filter_generated_includes DEPENDS
########################################################################
install(FILES
api.h
+ adaptive_fir.h
firdes.h
fir_filter.h
fir_filter_with_buffer.h
@@ -82,6 +83,7 @@ install(FILES
pm_remez.h
polyphase_filterbank.h
${generated_includes}
+ adaptive_fir_ccc.h
dc_blocker_cc.h
dc_blocker_ff.h
filter_delay_fc.h
diff --git a/gr-filter/include/filter/adaptive_fir.h b/gr-filter/include/filter/adaptive_fir.h
new file mode 100644
index 0000000000..7468e6a058
--- /dev/null
+++ b/gr-filter/include/filter/adaptive_fir.h
@@ -0,0 +1,69 @@
+/* -*- 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
+ {
+ private:
+ bool d_updated;
+ int d_decim;
+
+ protected:
+ 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);
+ };
+
+ } /* 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
new file mode 100644
index 0000000000..14e9f6f53e
--- /dev/null
+++ b/gr-filter/include/filter/adaptive_fir_ccc.h
@@ -0,0 +1,53 @@
+/* -*- 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_CCC_H
+#define INCLUDED_FILTER_ADAPTIVE_FIR_CCC_H
+
+#include <filter/api.h>
+#include <filter/adaptive_fir.h>
+#include <gr_sync_decimator.h>
+
+namespace gr {
+ namespace filter {
+
+ class FILTER_API adaptive_fir_ccc : virtual public gr_sync_decimator
+ {
+ public:
+ // gr::filter::adaptive_fir_ccc::sptr
+ typedef boost::shared_ptr<adaptive_fir_ccc> sptr;
+
+ /*!
+ * \brief Adaptive FIR filter with gr_complex input, gr_complex output and float taps
+ * \ingroup filter_blk
+ */
+ 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();
+ };
+
+ } /* namespace filter */
+} /* namespace gr */
+
+#endif /* INCLUDED_FILTER_ADAPTIVE_FIR_CCC_H */