GNU Radio Manual and C++ API Reference  3.10.9.1
The Free & Open Software Radio Ecosystem
fir_filter_blk.h
Go to the documentation of this file.
1 /* -*- c++ -*- */
2 /*
3  * Copyright 2004,2012,2018 Free Software Foundation, Inc.
4  *
5  * This file is part of GNU Radio
6  *
7  * SPDX-License-Identifier: GPL-3.0-or-later
8  *
9  */
10 
11 #ifndef FIR_FILTER_BLK_H
12 #define FIR_FILTER_BLK_H
13 
14 #include <gnuradio/filter/api.h>
16 #include <cstdint>
17 
18 namespace gr {
19 namespace filter {
20 
21 /*!
22  * \brief FIR filter with IN_T input, OUT_T output, and TAP_T taps
23  * \ingroup filter_blk
24  *
25  * \details
26  * The fir_filter_blk_XXX blocks create finite impulse response
27  * (FIR) filters that perform the convolution in the time
28  * domain:
29  *
30  * \code
31  * out = 0
32  * for i in ntaps:
33  * out += input[n-i] * taps[i]
34  * \endcode
35  *
36  * The taps are a C++ vector (or Python list) of values of the
37  * type specified by the third letter in the block's suffix. For
38  * this block, the value is of type TAP_T. Taps can be
39  * created using the firdes or optfir tools.
40  *
41  * These versions of the filter can also act as down-samplers
42  * (or decimators) by specifying an integer value for \p
43  * decimation.
44  */
45 template <class IN_T, class OUT_T, class TAP_T>
47 {
48 public:
49  typedef std::shared_ptr<fir_filter_blk<IN_T, OUT_T, TAP_T>> sptr;
50 
51  /*!
52  * \brief FIR filter with IN_T input, OUT_T output, and TAP_T taps
53  *
54  * \param decimation set the integer decimation rate
55  * \param taps a vector/list of taps of type TAP_T
56  */
57  static sptr make(int decimation, const std::vector<TAP_T>& taps);
58 
59  virtual void set_taps(const std::vector<TAP_T>& taps) = 0;
60  virtual std::vector<TAP_T> taps() const = 0;
61 };
62 
69 
70 } /* namespace filter */
71 } /* namespace gr */
72 
73 #endif /* FIR_FILTER_BLK_H */
FIR filter with IN_T input, OUT_T output, and TAP_T taps.
Definition: fir_filter_blk.h:47
static sptr make(int decimation, const std::vector< TAP_T > &taps)
FIR filter with IN_T input, OUT_T output, and TAP_T taps.
std::shared_ptr< fir_filter_blk< IN_T, OUT_T, TAP_T > > sptr
Definition: fir_filter_blk.h:49
virtual void set_taps(const std::vector< TAP_T > &taps)=0
virtual std::vector< TAP_T > taps() const =0
synchronous N:1 input to output with history
Definition: sync_decimator.h:26
#define FILTER_API
Definition: gr-filter/include/gnuradio/filter/api.h:18
static constexpr float taps[NSTEPS+1][NTAPS]
Definition: interpolator_taps.h:9
fir_filter_blk< std::int16_t, gr_complex, gr_complex > fir_filter_scc
Definition: fir_filter_blk.h:68
fir_filter_blk< float, std::int16_t, float > fir_filter_fsf
Definition: fir_filter_blk.h:67
fir_filter_blk< gr_complex, gr_complex, float > fir_filter_ccf
Definition: fir_filter_blk.h:64
fir_filter_blk< float, float, float > fir_filter_fff
Definition: fir_filter_blk.h:66
fir_filter_blk< gr_complex, gr_complex, gr_complex > fir_filter_ccc
Definition: fir_filter_blk.h:63
fir_filter_blk< float, gr_complex, gr_complex > fir_filter_fcc
Definition: fir_filter_blk.h:65
GNU Radio logging wrapper.
Definition: basic_block.h:29