GNU Radio 3.7.2 C++ API
adaptive_fir.h
Go to the documentation of this file.
1 /* -*- c++ -*- */
2 /*
3  * Copyright 2011,2012 Free Software Foundation, Inc.
4  *
5  * This file is part of GNU Radio
6  *
7  * GNU Radio is free software; you can redistribute it and/or modify
8  * it under the terms of the GNU General Public License as published by
9  * the Free Software Foundation; either version 3, or (at your option)
10  * any later version.
11  *
12  * GNU Radio is distributed in the hope that it will be useful,
13  * but WITHOUT ANY WARRANTY; without even the implied warranty of
14  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15  * GNU General Public License for more details.
16  *
17  * You should have received a copy of the GNU General Public License
18  * along with GNU Radio; see the file COPYING. If not, write to
19  * the Free Software Foundation, Inc., 51 Franklin Street,
20  * Boston, MA 02110-1301, USA.
21  */
22 
23 #ifndef INCLUDED_FILTER_ADAPTIVE_FIR_H
24 #define INCLUDED_FILTER_ADAPTIVE_FIR_H
25 
26 #include <gnuradio/filter/api.h>
28 
29 namespace gr {
30  namespace filter {
31  namespace kernel {
32 
33  /*!
34  * \brief Adaptive FIR filter kernel with gr_complex input,
35  * gr_complex output and gr_complex taps
36  *
37  * This class implements an adaptive FIR filter. Any class
38  * actually wanting to use adaptive FIRs will contain an object of
39  * this class.
40  */
42  {
43  public:
44  adaptive_fir_ccc(int decimation,
45  const std::vector<gr_complex> &taps);
47 
48  protected:
49  // Override to calculate error signal per output
50  virtual gr_complex error(const gr_complex &out) = 0;
51 
52  // Override to calculate new weight from old, corresponding input
53  virtual void update_tap(gr_complex &tap, const gr_complex &in) = 0;
54 
56  };
57 
58 
59  /*!
60  * \brief Adaptive FIR filter kernel with gr_complex input,
61  * gr_complex output and float taps
62  *
63  * This class implements an adaptive FIR filter. Any class
64  * actually wanting to use adaptive FIRs will contain an object of
65  * this class.
66  */
68  {
69  public:
70  adaptive_fir_ccf(int decimation,
71  const std::vector<float> &taps);
73 
74  protected:
75  // Override to calculate error signal per output
76  virtual float error(const gr_complex &out) = 0;
77 
78  // Override to calculate new weight from old, corresponding input
79  virtual void update_tap(float &tap, const gr_complex &in) = 0;
80 
81  float d_error;
82  };
83 
84  } /* namespace kernel */
85  } /* namespace filter */
86 } /* namespace gr */
87 
88 #endif /* INCLUDED_FILTER_ADAPTIVE_FIR_H */
gr_complex d_error
Definition: adaptive_fir.h:55
Definition: fir_filter.h:130
Adaptive FIR filter kernel with gr_complex input, gr_complex output and gr_complex taps...
Definition: adaptive_fir.h:41
std::complex< float > gr_complex
Definition: gr_complex.h:27
Adaptive FIR filter kernel with gr_complex input, gr_complex output and float taps.
Definition: adaptive_fir.h:67
float d_error
Definition: adaptive_fir.h:81
static const float taps[NSTEPS+1][NTAPS]
Definition: interpolator_taps.h:9
Definition: fir_filter.h:66
#define FILTER_API
Definition: gr-filter/include/gnuradio/filter/api.h:30