GNU Radio Manual and C++ API Reference  3.10.9.1
The Free & Open Software Radio Ecosystem
interp_fir_filter.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 INTERP_FIR_FILTER_H
12 #define INTERP_FIR_FILTER_H
13 
14 #include <gnuradio/filter/api.h>
16 #include <cstdint>
17 
18 namespace gr {
19 namespace filter {
20 
21 /*!
22  * \brief Interpolating FIR filter with IN_T input, OUT_T output and TAP_T taps
23  * \ingroup filter_blk
24  *
25  * \details
26  * The fir_filter_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 up-samplers
42  * (or interpolators) by specifying an integer value for \p
43  * interpolation.
44  *
45  */
46 template <class IN_T, class OUT_T, class TAP_T>
48 {
49 public:
50  // gr::filter::interp_fir_filter::sptr
51  typedef std::shared_ptr<interp_fir_filter> sptr;
52 
53  /*!
54  * \brief Interpolating FIR filter with IN_T input, OUT_T output, and TAP_T taps
55  *
56  * \param interpolation set the integer interpolation rate
57  * \param taps a vector/list of taps of type TAP_T
58  */
59  static sptr make(unsigned interpolation, const std::vector<TAP_T>& taps);
60 
61  virtual void set_taps(const std::vector<TAP_T>& taps) = 0;
62  virtual std::vector<TAP_T> taps() const = 0;
63 };
70 
71 } /* namespace filter */
72 } /* namespace gr */
73 
74 #endif /* INTERP_FIR_FILTER_H */
Interpolating FIR filter with IN_T input, OUT_T output and TAP_T taps.
Definition: interp_fir_filter.h:48
static sptr make(unsigned interpolation, const std::vector< TAP_T > &taps)
Interpolating FIR filter with IN_T input, OUT_T output, and TAP_T taps.
virtual std::vector< TAP_T > taps() const =0
std::shared_ptr< interp_fir_filter > sptr
Definition: interp_fir_filter.h:51
virtual void set_taps(const std::vector< TAP_T > &taps)=0
synchronous 1:N input to output with history
Definition: sync_interpolator.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
interp_fir_filter< gr_complex, gr_complex, gr_complex > interp_fir_filter_ccc
Definition: interp_fir_filter.h:64
interp_fir_filter< float, std::int16_t, float > interp_fir_filter_fsf
Definition: interp_fir_filter.h:68
interp_fir_filter< std::int16_t, gr_complex, gr_complex > interp_fir_filter_scc
Definition: interp_fir_filter.h:69
interp_fir_filter< float, float, float > interp_fir_filter_fff
Definition: interp_fir_filter.h:67
interp_fir_filter< float, gr_complex, gr_complex > interp_fir_filter_fcc
Definition: interp_fir_filter.h:66
interp_fir_filter< gr_complex, gr_complex, float > interp_fir_filter_ccf
Definition: interp_fir_filter.h:65
GNU Radio logging wrapper.
Definition: basic_block.h:29