GNU Radio 3.4.2 C++ API
gr_rational_resampler_base_ccf.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_CCF_H
00030 #define INCLUDED_GR_RATIONAL_RESAMPLER_BASE_CCF_H
00031 
00032 #include <gr_block.h>
00033 
00034 class gr_rational_resampler_base_ccf;
00035 typedef boost::shared_ptr<gr_rational_resampler_base_ccf> gr_rational_resampler_base_ccf_sptr;
00036 gr_rational_resampler_base_ccf_sptr
00037 gr_make_rational_resampler_base_ccf (unsigned interpolation,
00038                      unsigned decimation,
00039                      const std::vector<float> &taps);
00040 
00041 class gr_fir_ccf;
00042 
00043 /*!
00044  * \brief Rational Resampling Polyphase FIR filter with gr_complex input, gr_complex output and float taps
00045  * \ingroup filter_blk
00046  */
00047 class gr_rational_resampler_base_ccf : public gr_block
00048 {
00049  private:
00050   unsigned                      d_history;
00051   unsigned                      d_interpolation, d_decimation;
00052   unsigned                      d_ctr;
00053   std::vector<float>    d_new_taps;
00054   bool                          d_updated;
00055   std::vector<gr_fir_ccf *> d_firs;
00056 
00057   friend gr_rational_resampler_base_ccf_sptr 
00058   gr_make_rational_resampler_base_ccf (unsigned interpolation, unsigned decimation, const std::vector<float> &taps);
00059 
00060 
00061   /*!
00062    * Construct a FIR filter with the given taps
00063    */
00064   gr_rational_resampler_base_ccf (unsigned interpolation, unsigned decimation,
00065           const std::vector<float> &taps);
00066 
00067   void install_taps (const std::vector<float> &taps);
00068 
00069  public:
00070   ~gr_rational_resampler_base_ccf ();
00071   unsigned history () const { return d_history; }
00072   void  set_history (unsigned history) { d_history = history; }
00073 
00074   unsigned interpolation() const { return d_interpolation; }
00075   unsigned decimation() const { return d_decimation; }
00076 
00077   void set_taps (const std::vector<float> &taps);
00078 
00079   void forecast (int noutput_items, gr_vector_int &ninput_items_required);
00080   int  general_work (int noutput_items,
00081                      gr_vector_int &ninput_items,
00082                      gr_vector_const_void_star &input_items,
00083                      gr_vector_void_star &output_items);
00084 };
00085  
00086 
00087 #endif