GNU Radio 3.7.3 C++ API
fir_filter.h
Go to the documentation of this file.
1 /* -*- c++ -*- */
2 /*
3  * Copyright 2004,2010,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_FIR_FILTER_H
24 #define INCLUDED_FILTER_FIR_FILTER_H
25 
26 #include <gnuradio/filter/api.h>
27 #include <vector>
28 #include <gnuradio/gr_complex.h>
29 
30 namespace gr {
31  namespace filter {
32  namespace kernel {
33 
35  {
36  public:
37  fir_filter_fff(int decimation,
38  const std::vector<float> &taps);
39  ~fir_filter_fff();
40 
41  void set_taps(const std::vector<float> &taps);
42  void update_tap(float t, unsigned int index);
43  std::vector<float> taps() const;
44  unsigned int ntaps() const;
45 
46  float filter(const float input[]);
47  void filterN(float output[],
48  const float input[],
49  unsigned long n);
50  void filterNdec(float output[],
51  const float input[],
52  unsigned long n,
53  unsigned int decimate);
54 
55  protected:
56  std::vector<float> d_taps;
57  unsigned int d_ntaps;
58  float **d_aligned_taps;
59  float *d_output;
60  int d_align;
62  };
63 
64  /**************************************************************/
65 
67  {
68  public:
69  fir_filter_ccf(int decimation,
70  const std::vector<float> &taps);
71  ~fir_filter_ccf();
72 
73  void set_taps(const std::vector<float> &taps);
74  void update_tap(float t, unsigned int index);
75  std::vector<float> taps() const;
76  unsigned int ntaps() const;
77 
78  gr_complex filter(const gr_complex input[]);
79  void filterN(gr_complex output[],
80  const gr_complex input[],
81  unsigned long n);
82  void filterNdec(gr_complex output[],
83  const gr_complex input[],
84  unsigned long n,
85  unsigned int decimate);
86 
87  protected:
88  std::vector<float> d_taps;
89  unsigned int d_ntaps;
90  float **d_aligned_taps;
92  int d_align;
94  };
95 
96  /**************************************************************/
97 
99  {
100  public:
101  fir_filter_fcc(int decimation,
102  const std::vector<gr_complex> &taps);
103  ~fir_filter_fcc();
104 
105  void set_taps(const std::vector<gr_complex> &taps);
106  void update_tap(gr_complex t, unsigned int index);
107  std::vector<gr_complex> taps() const;
108  unsigned int ntaps() const;
109 
110  gr_complex filter(const float input[]);
111  void filterN(gr_complex output[],
112  const float input[],
113  unsigned long n);
114  void filterNdec(gr_complex output[],
115  const float input[],
116  unsigned long n,
117  unsigned int decimate);
118 
119  protected:
120  std::vector<gr_complex> d_taps;
121  unsigned int d_ntaps;
124  int d_align;
126  };
127 
128  /**************************************************************/
129 
131  {
132  public:
133  fir_filter_ccc(int decimation,
134  const std::vector<gr_complex> &taps);
135  ~fir_filter_ccc();
136 
137  void set_taps(const std::vector<gr_complex> &taps);
138  void update_tap(gr_complex t, unsigned int index);
139  std::vector<gr_complex> taps() const;
140  unsigned int ntaps() const;
141 
142  gr_complex filter(const gr_complex input[]);
143  void filterN(gr_complex output[],
144  const gr_complex input[],
145  unsigned long n);
146  void filterNdec(gr_complex output[],
147  const gr_complex input[],
148  unsigned long n,
149  unsigned int decimate);
150 
151  protected:
152  std::vector<gr_complex> d_taps;
153  unsigned int d_ntaps;
156  int d_align;
158  };
159 
160  /**************************************************************/
161 
163  {
164  public:
165  fir_filter_scc(int decimation,
166  const std::vector<gr_complex> &taps);
167  ~fir_filter_scc();
168 
169  void set_taps(const std::vector<gr_complex> &taps);
170  void update_tap(gr_complex t, unsigned int index);
171  std::vector<gr_complex> taps() const;
172  unsigned int ntaps() const;
173 
174  gr_complex filter(const short input[]);
175  void filterN(gr_complex output[],
176  const short input[],
177  unsigned long n);
178  void filterNdec(gr_complex output[],
179  const short input[],
180  unsigned long n,
181  unsigned int decimate);
182 
183  protected:
184  std::vector<gr_complex> d_taps;
185  unsigned int d_ntaps;
188  int d_align;
190  };
191 
192  /**************************************************************/
193 
195  {
196  public:
197  fir_filter_fsf(int decimation,
198  const std::vector<float> &taps);
199  ~fir_filter_fsf();
200 
201  void set_taps(const std::vector<float> &taps);
202  void update_tap(float t, unsigned int index);
203  std::vector<float> taps() const;
204  unsigned int ntaps() const;
205 
206  short filter(const float input[]);
207  void filterN(short output[],
208  const float input[],
209  unsigned long n);
210  void filterNdec(short output[],
211  const float input[],
212  unsigned long n,
213  unsigned int decimate);
214 
215  protected:
216  std::vector<float> d_taps;
217  unsigned int d_ntaps;
218  float **d_aligned_taps;
219  short *d_output;
220  int d_align;
222  };
223 
224  } /* namespace kernel */
225  } /* namespace filter */
226 } /* namespace gr */
227 
228 #endif /* INCLUDED_FILTER_FIR_FILTER_H */
std::vector< float > d_taps
Definition: fir_filter.h:88
int d_naligned
Definition: fir_filter.h:61
gr_complex * d_output
Definition: fir_filter.h:187
std::vector< float > d_taps
Definition: fir_filter.h:56
std::vector< gr_complex > d_taps
Definition: fir_filter.h:184
int d_naligned
Definition: fir_filter.h:93
Definition: fir_filter.h:162
gr_complex ** d_aligned_taps
Definition: fir_filter.h:154
Definition: fir_filter.h:130
Definition: fir_filter.h:98
int d_naligned
Definition: fir_filter.h:189
int d_align
Definition: fir_filter.h:156
std::vector< gr_complex > d_taps
Definition: fir_filter.h:152
int d_align
Definition: fir_filter.h:124
int d_align
Definition: fir_filter.h:60
gr_complex ** d_aligned_taps
Definition: fir_filter.h:186
int d_align
Definition: fir_filter.h:220
unsigned int d_ntaps
Definition: fir_filter.h:89
std::complex< float > gr_complex
Definition: gr_complex.h:27
std::vector< gr_complex > d_taps
Definition: fir_filter.h:120
unsigned int d_ntaps
Definition: fir_filter.h:57
int d_naligned
Definition: fir_filter.h:157
Definition: fir_filter.h:34
gr_complex ** d_aligned_taps
Definition: fir_filter.h:122
unsigned int d_ntaps
Definition: fir_filter.h:217
unsigned int d_ntaps
Definition: fir_filter.h:153
int d_naligned
Definition: fir_filter.h:221
float * d_output
Definition: fir_filter.h:59
static const float taps[NSTEPS+1][NTAPS]
Definition: interpolator_taps.h:9
int d_align
Definition: fir_filter.h:188
gr_complex * d_output
Definition: fir_filter.h:123
float ** d_aligned_taps
Definition: fir_filter.h:218
float ** d_aligned_taps
Definition: fir_filter.h:58
unsigned int d_ntaps
Definition: fir_filter.h:121
gr_complex * d_output
Definition: fir_filter.h:155
Definition: fir_filter.h:66
gr_complex * d_output
Definition: fir_filter.h:91
Definition: fir_filter.h:194
int d_align
Definition: fir_filter.h:92
short * d_output
Definition: fir_filter.h:219
std::vector< float > d_taps
Definition: fir_filter.h:216
#define FILTER_API
Definition: gr-filter/include/gnuradio/filter/api.h:30
float ** d_aligned_taps
Definition: fir_filter.h:90
int d_naligned
Definition: fir_filter.h:125
unsigned int d_ntaps
Definition: fir_filter.h:185