GNU Radio 3.6.5 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_GR_RATIONAL_RESAMPLER_BASE_CCC_H
00030 #define INCLUDED_GR_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  */
00047 class GR_CORE_API gr_rational_resampler_base_ccc : public gr_block
00048 {
00049  private:
00050   unsigned                      d_history;
00051   unsigned                      d_interpolation, d_decimation;
00052   unsigned                      d_ctr;
00053   std::vector<gr_complex>       d_new_taps;
00054   bool                          d_updated;
00055   std::vector<gr_fir_ccc *> d_firs;
00056 
00057   friend GR_CORE_API gr_rational_resampler_base_ccc_sptr
00058   gr_make_rational_resampler_base_ccc (unsigned interpolation, unsigned decimation, const std::vector<gr_complex> &taps);
00059 
00060 
00061   /*!
00062    * Construct a FIR filter with the given taps
00063    */
00064   gr_rational_resampler_base_ccc (unsigned interpolation, unsigned decimation,
00065           const std::vector<gr_complex> &taps);
00066 
00067   void install_taps (const std::vector<gr_complex> &taps);
00068 
00069  public:
00070   ~gr_rational_resampler_base_ccc ();
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<gr_complex> &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