GNU Radio Manual and C++ API Reference  3.10.9.1
The Free & Open Software Radio Ecosystem
iir_filter_ffd.h
Go to the documentation of this file.
1 /* -*- c++ -*- */
2 /*
3  * Copyright 2004,2012 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 INCLUDED_IIR_FILTER_FFD_H
12 #define INCLUDED_IIR_FILTER_FFD_H
13 
14 #include <gnuradio/filter/api.h>
15 #include <gnuradio/sync_block.h>
16 
17 namespace gr {
18 namespace filter {
19 
20 /*!
21  * \brief IIR filter with float input, float output and double taps
22  * \ingroup filter_blk
23  *
24  * \details
25  * This filter uses the Direct Form I implementation, where
26  * \p fftaps contains the feed-forward taps, and \p fbtaps the feedback ones.
27  *
28  * \p oldstyle: The old style of the IIR filter uses feedback
29  * taps that are negative of what most definitions use (scipy
30  * and Matlab among them). This parameter keeps using the old
31  * GNU Radio style and is set to TRUE by default. When taps
32  * generated from scipy, Matlab, or gr_filter_design, use the
33  * new style by setting this to FALSE.
34  *
35  * The input and output satisfy a difference equation of the form
36  \f[
37  y[n] - \sum_{k=1}^{M} a_k y[n-k] = \sum_{k=0}^{N} b_k x[n-k]
38  \f]
39 
40  \xmlonly
41  y[n] - \sum_{k=1}^{M} a_k y[n-k] = \sum_{k=0}^{N} b_k x[n-k]
42  \endxmlonly
43 
44  * with the corresponding rational system function
45  \f[
46  H(z) = \frac{\sum_{k=0}^{M} b_k z^{-k}}{1 - \sum_{k=1}^{N} a_k z^{-k}}
47  \f]
48 
49  \xmlonly
50  H(z) = \ frac{\sum_{k=0}^{M} b_k z^{-k}}{1 - \sum_{k=1}^{N} a_k z^{-k}}
51  \endxmlonly
52 
53  */
54 class FILTER_API iir_filter_ffd : virtual public sync_block
55 {
56 public:
57  // gr::filter::iir_filter_ffd::sptr
58  typedef std::shared_ptr<iir_filter_ffd> sptr;
59 
60  static sptr make(const std::vector<double>& fftaps,
61  const std::vector<double>& fbtaps,
62  bool oldstyle = true);
63 
64  virtual void set_taps(const std::vector<double>& fftaps,
65  const std::vector<double>& fbtaps) = 0;
66 };
67 
68 } /* namespace filter */
69 } /* namespace gr */
70 
71 #endif /* INCLUDED_IIR_FILTER_FFD_H */
IIR filter with float input, float output and double taps.
Definition: iir_filter_ffd.h:55
static sptr make(const std::vector< double > &fftaps, const std::vector< double > &fbtaps, bool oldstyle=true)
std::shared_ptr< iir_filter_ffd > sptr
Definition: iir_filter_ffd.h:58
virtual void set_taps(const std::vector< double > &fftaps, const std::vector< double > &fbtaps)=0
synchronous 1:1 input to output with history
Definition: sync_block.h:26
#define FILTER_API
Definition: gr-filter/include/gnuradio/filter/api.h:18
GNU Radio logging wrapper.
Definition: basic_block.h:29