GNU Radio Manual and C++ API Reference  3.8.1.0
The Free & Open Software Radio Ecosystem
fir_filter.h
Go to the documentation of this file.
1 /* -*- c++ -*- */
2 /*
3  * Copyright 2004,2010,2012,2018 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 <gnuradio/gr_complex.h>
28 #include <cstdint>
29 #include <vector>
30 
31 namespace gr {
32 namespace filter {
33 namespace kernel {
34 
35 template <class IN_T, class OUT_T, class TAP_T>
37 {
38 public:
39  fir_filter(int decimation, const std::vector<TAP_T>& taps);
40  ~fir_filter();
41 
42  void set_taps(const std::vector<TAP_T>& taps);
43  void update_tap(TAP_T t, unsigned int index);
44  std::vector<TAP_T> taps() const;
45  unsigned int ntaps() const;
46 
47  OUT_T filter(const IN_T input[]);
48  void filterN(OUT_T output[], const IN_T input[], unsigned long n);
49  void filterNdec(OUT_T output[],
50  const IN_T input[],
51  unsigned long n,
52  unsigned int decimate);
53 
54 protected:
55  std::vector<TAP_T> d_taps;
56  unsigned int d_ntaps;
57  TAP_T** d_aligned_taps;
58  OUT_T* d_output;
59  int d_align;
61 };
68 } /* namespace kernel */
69 } /* namespace filter */
70 } /* namespace gr */
71 
72 #endif /* INCLUDED_FILTER_FIR_FILTER_H */
fir_filter< std::int16_t, gr_complex, gr_complex > fir_filter_scc
Definition: fir_filter.h:66
TAP_T ** d_aligned_taps
Definition: fir_filter.h:57
OUT_T * d_output
Definition: fir_filter.h:58
Definition: fir_filter.h:36
fir_filter< gr_complex, gr_complex, float > fir_filter_ccf
Definition: fir_filter.h:63
GNU Radio logging wrapper for log4cpp library (C++ port of log4j)
Definition: basic_block.h:43
fir_filter< float, gr_complex, gr_complex > fir_filter_fcc
Definition: fir_filter.h:64
fir_filter< float, std::int16_t, float > fir_filter_fsf
Definition: fir_filter.h:67
fir_filter< gr_complex, gr_complex, gr_complex > fir_filter_ccc
Definition: fir_filter.h:65
static const float taps[NSTEPS+1][NTAPS]
Definition: interpolator_taps.h:9
int d_align
Definition: fir_filter.h:59
unsigned int d_ntaps
Definition: fir_filter.h:56
std::vector< TAP_T > d_taps
Definition: fir_filter.h:55
int d_naligned
Definition: fir_filter.h:60
#define FILTER_API
Definition: gr-filter/include/gnuradio/filter/api.h:30
fir_filter< float, float, float > fir_filter_fff
Definition: fir_filter.h:62