aboutsummaryrefslogtreecommitdiffstats
path: root/gr-filter/include/gnuradio/filter/iir_filter_ccz.h
blob: 2441b37e2216d82b1fbb7adae304943dc00ecf0d (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
/* -*- c++ -*- */
/*
 * Copyright 2004,2012,2014 Free Software Foundation, Inc.
 *
 * This file is part of GNU Radio
 *
 * SPDX-License-Identifier: GPL-3.0-or-later
 *
 */

#ifndef INCLUDED_IIR_FILTER_CCZ_H
#define INCLUDED_IIR_FILTER_CCZ_H

#include <gnuradio/filter/api.h>
#include <gnuradio/sync_block.h>

namespace gr {
namespace filter {

/*!
 * \brief IIR filter with complex input, complex output, and
 * complex (double) taps.
 * \ingroup filter_blk
 *
 * \details
 * This filter uses the Direct Form I implementation, where \p
 * fftaps contains the feed-forward taps, and \p fbtaps the
 * feedback ones.
 *
 * \p oldstyle: The old style of the IIR filter uses feedback
 * taps that are negative of what most definitions use (scipy
 * and Matlab among them). This parameter keeps using the old
 * GNU Radio style and is set to TRUE by default. When taps
 * generated from scipy, Matlab, or gr_filter_design, use the
 * new style by setting this to FALSE.
 *
 * The input and output satisfy a difference equation of the form
 \f[
   y[n] - \sum_{k=1}^{M} a_k y[n-k] = \sum_{k=0}^{N} b_k x[n-k]
 \f]

 \xmlonly
 y[n] - \sum_{k=1}^{M} a_k y[n-k] = \sum_{k=0}^{N} b_k x[n-k]
 \endxmlonly

 * with the corresponding rational system function
 \f[
 H(z) = \frac{\sum_{k=0}^{M} b_k z^{-k}}{1 - \sum_{k=1}^{N} a_k z^{-k}}
 \f]

 \xmlonly
 H(z) = \ frac{\sum_{k=0}^{M} b_k z^{-k}}{1 - \sum_{k=1}^{N} a_k z^{-k}}
 \endxmlonly

 */
class FILTER_API iir_filter_ccz : virtual public sync_block
{
public:
    // gr::filter::iir_filter_ccz::sptr
    typedef boost::shared_ptr<iir_filter_ccz> sptr;

    static sptr make(const std::vector<gr_complexd>& fftaps,
                     const std::vector<gr_complexd>& fbtaps,
                     bool oldstyle = true);

    virtual void set_taps(const std::vector<gr_complexd>& fftaps,
                          const std::vector<gr_complexd>& fbtaps) = 0;
};

} /* namespace filter */
} /* namespace gr */

#endif /* INCLUDED_IIR_FILTER_CCZ_H */