diff options
author | Tom Rondeau <trondeau@vt.edu> | 2012-05-06 16:24:43 -0400 |
---|---|---|
committer | Tom Rondeau <trondeau@vt.edu> | 2012-05-06 16:24:43 -0400 |
commit | 137cd17199b62409591acff84476605f64e15ff8 (patch) | |
tree | ada3869ccfd4e31518372040ca57575686ff50be /gr-filter/include | |
parent | 897a60220a29fc509802e5e30e645e7ee154e184 (diff) |
filter: moved dc_blocker to gr-filter with QA and GRC blocks.
Diffstat (limited to 'gr-filter/include')
-rw-r--r-- | gr-filter/include/filter/CMakeLists.txt | 3 | ||||
-rw-r--r-- | gr-filter/include/filter/dc_blocker_cc.h | 75 | ||||
-rw-r--r-- | gr-filter/include/filter/dc_blocker_ff.h | 75 |
3 files changed, 153 insertions, 0 deletions
diff --git a/gr-filter/include/filter/CMakeLists.txt b/gr-filter/include/filter/CMakeLists.txt index b0b2a7e918..402dd599aa 100644 --- a/gr-filter/include/filter/CMakeLists.txt +++ b/gr-filter/include/filter/CMakeLists.txt @@ -80,7 +80,10 @@ install(FILES fir_filter.h fft_filter.h ${generated_includes} + dc_blocker_cc.h + dc_blocker_ff.h fft_filter_ccc.h + fft_filter_fff.h hilbert_fc.h DESTINATION ${GR_INCLUDE_DIR}/gnuradio/filter COMPONENT "fft_devel" diff --git a/gr-filter/include/filter/dc_blocker_cc.h b/gr-filter/include/filter/dc_blocker_cc.h new file mode 100644 index 0000000000..64d7ebffc1 --- /dev/null +++ b/gr-filter/include/filter/dc_blocker_cc.h @@ -0,0 +1,75 @@ +/* -*- c++ -*- */ +/* + * Copyright 2011,2012 Free Software Foundation, Inc. + * + * This file is part of GNU Radio + * + * GNU Radio is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 3, or (at your option) + * any later version. + * + * GNU Radio is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with GNU Radio; see the file COPYING. If not, write to + * the Free Software Foundation, Inc., 51 Franklin Street, + * Boston, MA 02110-1301, USA. + */ + +#ifndef INCLUDED_FILTER_DC_BLOCKER_CC_H +#define INCLUDED_FILTER_DC_BLOCKER_CC_H + +#include <filter/api.h> +#include <gr_sync_block.h> +#include <deque> + +namespace gr { + namespace filter { + + class FILTER_API dc_blocker_cc : virtual public gr_sync_block + { + public: + + // gr::filter::dc_blocker_cc::sptr + typedef boost::shared_ptr<dc_blocker_cc> sptr; + + /*! + * \class gr_dc_blocker_cc + * \brief a computationally efficient controllable DC blocker + * + * \ingroup filter_blk + * + * This block implements a computationally efficient DC blocker that produces + * a tighter notch filter around DC for a smaller group delay than an + * equivalent FIR filter or using a single pole IIR filter (though the IIR + * filter is computationally cheaper). + * + * The block defaults to using a delay line of length 32 and the long form + * of the filter. Optionally, the delay line length can be changed to alter + * the width of the DC notch (longer lines will decrease the width). + * + * The long form of the filter produces a nearly flat response outside of + * the notch but at the cost of a group delay of 2D-2. + * + * The short form of the filter does not have as flat a response in the + * passband but has a group delay of only D-1 and is cheaper to compute. + * + * The theory behind this block can be found in the paper: + * + * <B><EM>R. Yates, "DC Blocker Algorithms," IEEE Signal Processing Magazine, + * Mar. 2008, pp 132-134.</EM></B> + * + * \param D (int) the length of the delay line + * \param long_form (bool) whether to use long (true, default) or short form + */ + static FILTER_API sptr make(int D, bool long_form); + }; + + } /* namespace filter */ +} /* namespace gr */ + +#endif /* INCLUDED_FILTER_DC_BLOCKER_CC_H */ diff --git a/gr-filter/include/filter/dc_blocker_ff.h b/gr-filter/include/filter/dc_blocker_ff.h new file mode 100644 index 0000000000..d1c7e7819c --- /dev/null +++ b/gr-filter/include/filter/dc_blocker_ff.h @@ -0,0 +1,75 @@ +/* -*- c++ -*- */ +/* + * Copyright 2011,2012 Free Software Foundation, Inc. + * + * This file is part of GNU Radio + * + * GNU Radio is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 3, or (at your option) + * any later version. + * + * GNU Radio is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with GNU Radio; see the file COPYING. If not, write to + * the Free Software Foundation, Inc., 51 Franklin Street, + * Boston, MA 02110-1301, USA. + */ + +#ifndef INCLUDED_FILTER_DC_BLOCKER_FF_H +#define INCLUDED_FILTER_DC_BLOCKER_FF_H + +#include <filter/api.h> +#include <gr_sync_block.h> +#include <deque> + +namespace gr { + namespace filter { + + class FILTER_API dc_blocker_ff : virtual public gr_sync_block + { + public: + + // gr::filter::dc_blocker_ff::sptr + typedef boost::shared_ptr<dc_blocker_ff> sptr; + + /*! + * \class gr_dc_blocker_ff + * \brief a computationally efficient controllable DC blocker + * + * \ingroup filter_blk + * + * This block implements a computationally efficient DC blocker that produces + * a tighter notch filter around DC for a smaller group delay than an + * equivalent FIR filter or using a single pole IIR filter (though the IIR + * filter is computationally cheaper). + * + * The block defaults to using a delay line of length 32 and the long form + * of the filter. Optionally, the delay line length can be changed to alter + * the width of the DC notch (longer lines will decrease the width). + * + * The long form of the filter produces a nearly flat response outside of + * the notch but at the cost of a group delay of 2D-2. + * + * The short form of the filter does not have as flat a response in the + * passband but has a group delay of only D-1 and is cheaper to compute. + * + * The theory behind this block can be found in the paper: + * + * <B><EM>R. Yates, "DC Blocker Algorithms," IEEE Signal Processing Magazine, + * Mar. 2008, pp 132-134.</EM></B> + * + * \param D (int) the length of the delay line + * \param long_form (bool) whether to use long (true, default) or short form + */ + static FILTER_API sptr make(int D, bool long_form=true); + }; + + } /* namespace filter */ +} /* namespace gr */ + +#endif /* INCLUDED_FILTER_DC_BLOCKER_FF_H */ |