GNU Radio 3.5.3.2 C++ API
gr_rational_resampler_base_ccc.h
Go to the documentation of this file.
00001 /* -*- c++ -*- */
00002 /*
00003  * Copyright 2005 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  * WARNING: This file is automatically generated by
00025  * generate_gr_rational_resampler_base_XXX.py Any changes made to this
00026  * file will be overwritten.
00027  */
00028 
00029 #ifndef INCLUDED_GR_RATIONAL_RESAMPLER_BASE_CCC_H
00030 #define INCLUDED_GR_RATIONAL_RESAMPLER_BASE_CCC_H
00031 
00032 #include <gr_core_api.h>
00033 #include <gr_block.h>
00034 
00035 class gr_rational_resampler_base_ccc;
00036 typedef boost::shared_ptr<gr_rational_resampler_base_ccc> gr_rational_resampler_base_ccc_sptr;
00037 GR_CORE_API gr_rational_resampler_base_ccc_sptr
00038 gr_make_rational_resampler_base_ccc (unsigned interpolation,
00039                      unsigned decimation,
00040                      const std::vector<gr_complex> &taps);
00041 
00042 class gr_fir_ccc;
00043 
00044 /*!
00045  * \brief Rational Resampling Polyphase FIR filter with gr_complex input, gr_complex output and gr_complex taps
00046  * \ingroup filter_blk
00047  */
00048 class GR_CORE_API gr_rational_resampler_base_ccc : public gr_block
00049 {
00050  private:
00051   unsigned                      d_history;
00052   unsigned                      d_interpolation, d_decimation;
00053   unsigned                      d_ctr;
00054   std::vector<gr_complex>       d_new_taps;
00055   bool                          d_updated;
00056   std::vector<gr_fir_ccc *> d_firs;
00057 
00058   friend GR_CORE_API gr_rational_resampler_base_ccc_sptr 
00059   gr_make_rational_resampler_base_ccc (unsigned interpolation, unsigned decimation, const std::vector<gr_complex> &taps);
00060 
00061 
00062   /*!
00063    * Construct a FIR filter with the given taps
00064    */
00065   gr_rational_resampler_base_ccc (unsigned interpolation, unsigned decimation,
00066           const std::vector<gr_complex> &taps);
00067 
00068   void install_taps (const std::vector<gr_complex> &taps);
00069 
00070  public:
00071   ~gr_rational_resampler_base_ccc ();
00072   unsigned history () const { return d_history; }
00073   void  set_history (unsigned history) { d_history = history; }
00074 
00075   unsigned interpolation() const { return d_interpolation; }
00076   unsigned decimation() const { return d_decimation; }
00077 
00078   void set_taps (const std::vector<gr_complex> &taps);
00079 
00080   void forecast (int noutput_items, gr_vector_int &ninput_items_required);
00081   int  general_work (int noutput_items,
00082                      gr_vector_int &ninput_items,
00083                      gr_vector_const_void_star &input_items,
00084                      gr_vector_void_star &output_items);
00085 };
00086  
00087 
00088 #endif