GNU Radio 3.6.5 C++ API
|
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 00024 #ifndef INCLUDED_FILTER_DC_BLOCKER_CC_IMPL_H 00025 #define INCLUDED_FILTER_DC_BLOCKER_CC_IMPL_H 00026 00027 #include <filter/dc_blocker_cc.h> 00028 #include <deque> 00029 00030 namespace gr { 00031 namespace filter { 00032 00033 class moving_averager_c 00034 { 00035 public: 00036 moving_averager_c(int D); 00037 ~moving_averager_c(); 00038 00039 gr_complex filter(gr_complex x); 00040 gr_complex delayed_sig() { return d_out; } 00041 00042 private: 00043 int d_length; 00044 gr_complex d_out, d_out_d1, d_out_d2; 00045 std::deque<gr_complex> d_delay_line; 00046 }; 00047 00048 class FILTER_API dc_blocker_cc_impl : public dc_blocker_cc 00049 { 00050 private: 00051 int d_length; 00052 bool d_long_form; 00053 moving_averager_c *d_ma_0; 00054 moving_averager_c *d_ma_1; 00055 moving_averager_c *d_ma_2; 00056 moving_averager_c *d_ma_3; 00057 std::deque<gr_complex> d_delay_line; 00058 00059 public: 00060 dc_blocker_cc_impl(int D, bool long_form); 00061 00062 ~dc_blocker_cc_impl(); 00063 00064 int group_delay(); 00065 00066 //int set_length(int D); 00067 00068 int work(int noutput_items, 00069 gr_vector_const_void_star &input_items, 00070 gr_vector_void_star &output_items); 00071 }; 00072 00073 } /* namespace filter */ 00074 } /* namespace gr */ 00075 00076 #endif /* INCLUDED_FILTER_DC_BLOCKER_CC_IMPL_H */