GNU Radio Manual and C++ API Reference  3.10.9.1
The Free & Open Software Radio Ecosystem
dc_blocker_cc.h
Go to the documentation of this file.
1 /* -*- c++ -*- */
2 /*
3  * Copyright 2011,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_FILTER_DC_BLOCKER_CC_H
12 #define INCLUDED_FILTER_DC_BLOCKER_CC_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 a computationally efficient controllable DC blocker
22  * \ingroup filter_blk
23  *
24  * \details
25  * This block implements a computationally efficient DC blocker that produces
26  * a tighter notch filter around DC for a smaller group delay than an
27  * equivalent FIR filter or using a single pole IIR filter (though the IIR
28  * filter is computationally cheaper).
29  *
30  * The block defaults to using a delay line of length 32 and the long form
31  * of the filter. Optionally, the delay line length can be changed to alter
32  * the width of the DC notch (longer lines will decrease the width).
33  *
34  * The long form of the filter produces a nearly flat response outside of
35  * the notch but at the cost of a group delay of 2D-2.
36  *
37  * The short form of the filter does not have as flat a response in the
38  * passband but has a group delay of only D-1 and is cheaper to compute.
39  *
40  * The theory behind this block can be found in the paper:
41  *
42  * <B><EM>R. Yates, "DC Blocker Algorithms," IEEE Signal Processing Magazine,
43  * Mar. 2008, pp 132-134.</EM></B>
44  */
45 class FILTER_API dc_blocker_cc : virtual public sync_block
46 {
47 public:
48  // gr::filter::dc_blocker_cc::sptr
49  typedef std::shared_ptr<dc_blocker_cc> sptr;
50 
51  /*!
52  * Make a DC blocker block.
53  *
54  * \param D (int) the length of the delay line
55  * \param long_form (bool) whether to use long (true, default) or short form
56  */
57  static sptr make(int D, bool long_form);
58 
59  virtual int group_delay() = 0;
60 };
61 
62 } /* namespace filter */
63 } /* namespace gr */
64 
65 #endif /* INCLUDED_FILTER_DC_BLOCKER_CC_H */
#define D(...)
Definition: basic_block_pydoc_template.h:10
a computationally efficient controllable DC blocker
Definition: dc_blocker_cc.h:46
virtual int group_delay()=0
std::shared_ptr< dc_blocker_cc > sptr
Definition: dc_blocker_cc.h:49
static sptr make(int D, bool long_form)
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