GNU Radio v3.6.2-149-ga6d285d9 C++ API
dc_blocker_cc.h
Go to the documentation of this file.
00001 /* -*- c++ -*- */
00002 /*
00003  * Copyright 2011,2012 Free Software Foundation, Inc.
00004  *
00005  * This file is part of GNU Radio
00006  *
00007  * GNU Radio is free software; you can redistribute it and/or modify
00008  * it under the terms of the GNU General Public License as published by
00009  * the Free Software Foundation; either version 3, or (at your option)
00010  * any later version.
00011  *
00012  * GNU Radio is distributed in the hope that it will be useful,
00013  * but WITHOUT ANY WARRANTY; without even the implied warranty of
00014  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
00015  * GNU General Public License for more details.
00016  *
00017  * You should have received a copy of the GNU General Public License
00018  * along with GNU Radio; see the file COPYING.  If not, write to
00019  * the Free Software Foundation, Inc., 51 Franklin Street,
00020  * Boston, MA 02110-1301, USA.
00021  */
00022 
00023 #ifndef INCLUDED_FILTER_DC_BLOCKER_CC_H
00024 #define INCLUDED_FILTER_DC_BLOCKER_CC_H
00025 
00026 #include <filter/api.h>
00027 #include <gr_sync_block.h>
00028 
00029 namespace gr {
00030   namespace filter {
00031     
00032     class FILTER_API dc_blocker_cc : virtual public gr_sync_block
00033     {
00034     public:
00035 
00036       // gr::filter::dc_blocker_cc::sptr
00037       typedef boost::shared_ptr<dc_blocker_cc> sptr;
00038 
00039       /*!
00040        * \class dc_blocker_cc
00041        * \brief a computationally efficient controllable DC blocker
00042        *
00043        * \ingroup filter_blk
00044        *
00045        * This block implements a computationally efficient DC blocker that produces
00046        * a tighter notch filter around DC for a smaller group delay than an
00047        * equivalent FIR filter or using a single pole IIR filter (though the IIR
00048        * filter is computationally cheaper).
00049        *
00050        * The block defaults to using a delay line of length 32 and the long form
00051        * of the filter. Optionally, the delay line length can be changed to alter
00052        * the width of the DC notch (longer lines will decrease the width).
00053        *
00054        * The long form of the filter produces a nearly flat response outside of
00055        * the notch but at the cost of a group delay of 2D-2.
00056        *
00057        * The short form of the filter does not have as flat a response in the
00058        * passband but has a group delay of only D-1 and is cheaper to compute.
00059        *
00060        * The theory behind this block can be found in the paper:
00061        *
00062        *    <B><EM>R. Yates, "DC Blocker Algorithms," IEEE Signal Processing Magazine,
00063        *        Mar. 2008, pp 132-134.</EM></B>
00064        *
00065        * \param D          (int) the length of the delay line
00066        * \param long_form  (bool) whether to use long (true, default) or short form
00067        */
00068       static sptr make(int D, bool long_form);
00069 
00070       virtual int group_delay() = 0;
00071     };
00072 
00073   } /* namespace filter */
00074 } /* namespace gr */
00075 
00076 #endif /* INCLUDED_FILTER_DC_BLOCKER_CC_H */