GNU Radio 3.7.0 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 <gnuradio/filter/api.h>
00027 #include <gnuradio/sync_block.h>
00028 
00029 namespace gr {
00030   namespace filter {
00031     
00032     /*!
00033      * \brief a computationally efficient controllable DC blocker
00034      * \ingroup filter_blk
00035      *
00036      * \details
00037      * This block implements a computationally efficient DC blocker that produces
00038      * a tighter notch filter around DC for a smaller group delay than an
00039      * equivalent FIR filter or using a single pole IIR filter (though the IIR
00040      * filter is computationally cheaper).
00041      *
00042      * The block defaults to using a delay line of length 32 and the long form
00043      * of the filter. Optionally, the delay line length can be changed to alter
00044      * the width of the DC notch (longer lines will decrease the width).
00045      *
00046      * The long form of the filter produces a nearly flat response outside of
00047      * the notch but at the cost of a group delay of 2D-2.
00048      *
00049      * The short form of the filter does not have as flat a response in the
00050      * passband but has a group delay of only D-1 and is cheaper to compute.
00051      *
00052      * The theory behind this block can be found in the paper:
00053      *
00054      *    <B><EM>R. Yates, "DC Blocker Algorithms," IEEE Signal Processing Magazine,
00055      *        Mar. 2008, pp 132-134.</EM></B>
00056      */
00057     class FILTER_API dc_blocker_cc : virtual public sync_block
00058     {
00059     public:
00060 
00061       // gr::filter::dc_blocker_cc::sptr
00062       typedef boost::shared_ptr<dc_blocker_cc> sptr;
00063 
00064       /*!
00065        * Make a DC blocker block.
00066        *
00067        * \param D          (int) the length of the delay line
00068        * \param long_form  (bool) whether to use long (true, default) or short form
00069        */
00070       static sptr make(int D, bool long_form);
00071 
00072       virtual int group_delay() = 0;
00073     };
00074 
00075   } /* namespace filter */
00076 } /* namespace gr */
00077 
00078 #endif /* INCLUDED_FILTER_DC_BLOCKER_CC_H */