GNU Radio Manual and C++ API Reference 3.8.5.0
The Free & Open Software Radio Ecosystem
 
Loading...
Searching...
No Matches
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 * 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 INTERP_FIR_FILTER_H
24#define INTERP_FIR_FILTER_H
25
26#include <gnuradio/filter/api.h>
28#include <cstdint>
29
30namespace gr {
31namespace filter {
32
33/*!
34 * \brief Interpolating FIR filter with IN_T input, OUT_T output and TAP_T taps
35 * \ingroup filter_blk
36 *
37 * \details
38 * The fir_filter_XXX blocks create finite impulse response
39 * (FIR) filters that perform the convolution in the time
40 * domain:
41 *
42 * \code
43 * out = 0
44 * for i in ntaps:
45 * out += input[n-i] * taps[i]
46 * \endcode
47 *
48 * The taps are a C++ vector (or Python list) of values of the
49 * type specified by the third letter in the block's suffix. For
50 * this block, the value is of type TAP_T. Taps can be
51 * created using the firdes or optfir tools.
52 *
53 * These versions of the filter can also act as up-samplers
54 * (or interpolators) by specifying an integer value for \p
55 * interpolation.
56 *
57 */
58template <class IN_T, class OUT_T, class TAP_T>
60{
61public:
62 // gr::filter::interp_fir_filter::sptr
63 typedef boost::shared_ptr<interp_fir_filter> sptr;
64
65 /*!
66 * \brief Interpolating FIR filter with IN_T input, OUT_T output, and TAP_T taps
67 *
68 * \param interpolation set the integer interpolation rate
69 * \param taps a vector/list of taps of type TAP_T
70 */
71 static sptr make(unsigned interpolation, const std::vector<TAP_T>& taps);
72
73 virtual void set_taps(const std::vector<TAP_T>& taps) = 0;
74 virtual std::vector<TAP_T> taps() const = 0;
75};
82
83} /* namespace filter */
84} /* namespace gr */
85
86#endif /* INTERP_FIR_FILTER_H */
Interpolating FIR filter with IN_T input, OUT_T output and TAP_T taps.
Definition interp_fir_filter.h:60
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
boost::shared_ptr< interp_fir_filter > sptr
Definition interp_fir_filter.h:63
virtual void set_taps(const std::vector< TAP_T > &taps)=0
synchronous 1:N input to output with history
Definition sync_interpolator.h:38
#define FILTER_API
Definition gr-filter/include/gnuradio/filter/api.h:30
static const 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:76
interp_fir_filter< float, std::int16_t, float > interp_fir_filter_fsf
Definition interp_fir_filter.h:80
interp_fir_filter< std::int16_t, gr_complex, gr_complex > interp_fir_filter_scc
Definition interp_fir_filter.h:81
interp_fir_filter< float, float, float > interp_fir_filter_fff
Definition interp_fir_filter.h:79
interp_fir_filter< float, gr_complex, gr_complex > interp_fir_filter_fcc
Definition interp_fir_filter.h:78
interp_fir_filter< gr_complex, gr_complex, float > interp_fir_filter_ccf
Definition interp_fir_filter.h:77
GNU Radio logging wrapper for log4cpp library (C++ port of log4j)
Definition basic_block.h:46