GNU Radio Manual and C++ API Reference 3.8.5.0
The Free & Open Software Radio Ecosystem
 
Loading...
Searching...
No Matches
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 * 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 FIR_FILTER_BLK_H
24#define FIR_FILTER_BLK_H
25
26#include <gnuradio/filter/api.h>
28#include <cstdint>
29
30namespace gr {
31namespace filter {
32
33/*!
34 * \brief FIR filter with IN_T input, OUT_T output, and TAP_T taps
35 * \ingroup filter_blk
36 *
37 * \details
38 * The fir_filter_blk_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 down-samplers
54 * (or decimators) by specifying an integer value for \p
55 * decimation.
56 */
57template <class IN_T, class OUT_T, class TAP_T>
59{
60public:
61 typedef boost::shared_ptr<fir_filter_blk<IN_T, OUT_T, TAP_T>> sptr;
62
63 /*!
64 * \brief FIR filter with IN_T input, OUT_T output, and TAP_T taps
65 *
66 * \param decimation set the integer decimation rate
67 * \param taps a vector/list of taps of type TAP_T
68 */
69 static sptr make(int decimation, const std::vector<TAP_T>& taps);
70
71 virtual void set_taps(const std::vector<TAP_T>& taps) = 0;
72 virtual std::vector<TAP_T> taps() const = 0;
73};
74
81
82} /* namespace filter */
83} /* namespace gr */
84
85#endif /* FIR_FILTER_BLK_H */
FIR filter with IN_T input, OUT_T output, and TAP_T taps.
Definition fir_filter_blk.h:59
static sptr make(int decimation, const std::vector< TAP_T > &taps)
FIR filter with IN_T input, OUT_T output, and TAP_T taps.
virtual std::vector< TAP_T > taps() const =0
virtual void set_taps(const std::vector< TAP_T > &taps)=0
boost::shared_ptr< fir_filter_blk< IN_T, OUT_T, TAP_T > > sptr
Definition fir_filter_blk.h:61
synchronous N:1 input to output with history
Definition sync_decimator.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
fir_filter_blk< std::int16_t, gr_complex, gr_complex > fir_filter_scc
Definition fir_filter_blk.h:80
fir_filter_blk< float, std::int16_t, float > fir_filter_fsf
Definition fir_filter_blk.h:79
fir_filter_blk< gr_complex, gr_complex, float > fir_filter_ccf
Definition fir_filter_blk.h:76
fir_filter_blk< float, float, float > fir_filter_fff
Definition fir_filter_blk.h:78
fir_filter_blk< gr_complex, gr_complex, gr_complex > fir_filter_ccc
Definition fir_filter_blk.h:75
fir_filter_blk< float, gr_complex, gr_complex > fir_filter_fcc
Definition fir_filter_blk.h:77
GNU Radio logging wrapper for log4cpp library (C++ port of log4j)
Definition basic_block.h:46