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