GNU Radio 3.4.2 C++ API
gr_pfb_synthesis_filterbank_ccf.h
Go to the documentation of this file.
00001 /* -*- c++ -*- */
00002 /*
00003  * Copyright 2010 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_GR_PFB_SYNTHESIS_FILTERBANK_CCF_H
00025 #define INCLUDED_GR_PFB_SYNTHESIS_FILTERBANK_CCF_H
00026 
00027 #include <gr_sync_interpolator.h>
00028 #include <gri_fir_filter_with_buffer_ccf.h>
00029 
00030 class gr_pfb_synthesis_filterbank_ccf;
00031 typedef boost::shared_ptr<gr_pfb_synthesis_filterbank_ccf> gr_pfb_synthesis_filterbank_ccf_sptr;
00032 gr_pfb_synthesis_filterbank_ccf_sptr gr_make_pfb_synthesis_filterbank_ccf 
00033     (unsigned int numchans, const std::vector<float> &taps);
00034 
00035 class gri_fft_complex;
00036 
00037 
00038 /*!
00039  * \class gr_pfb_synthesis_filterbank_ccf
00040  *
00041  * \brief Polyphase synthesis filterbank with 
00042  *        gr_complex input, gr_complex output and float taps
00043  *
00044  * \ingroup filter_blk
00045  */
00046 
00047 class gr_pfb_synthesis_filterbank_ccf : public gr_sync_interpolator
00048 {
00049  private:
00050   /*!
00051    * Build the polyphase synthesis filterbank.
00052    * \param numchans (unsigned integer) Specifies the number of 
00053                      channels <EM>M</EM>
00054    * \param taps    (vector/list of floats) The prototype filter to
00055                     populate the filterbank.
00056    */
00057   friend gr_pfb_synthesis_filterbank_ccf_sptr gr_make_pfb_synthesis_filterbank_ccf 
00058       (unsigned int numchans, const std::vector<float> &taps);
00059 
00060   bool                     d_updated;
00061   unsigned int             d_numchans;
00062   unsigned int             d_taps_per_filter;
00063   gri_fft_complex         *d_fft;
00064   std::vector< gri_fir_filter_with_buffer_ccf*> d_filters;
00065   std::vector< std::vector<float> > d_taps;
00066 
00067 
00068   /*!
00069    * Build the polyphase synthesis filterbank.
00070    * \param numchans (unsigned integer) Specifies the number of
00071                      channels <EM>M</EM>
00072    * \param taps    (vector/list of floats) The prototype filter
00073                     to populate the filterbank.
00074    */
00075   gr_pfb_synthesis_filterbank_ccf (unsigned int numchans, 
00076                                    const std::vector<float> &taps);
00077   
00078 public:
00079   ~gr_pfb_synthesis_filterbank_ccf ();
00080   
00081   /*!
00082    * Resets the filterbank's filter taps with the new prototype filter
00083    * \param taps    (vector/list of floats) The prototype filter to
00084                     populate the filterbank.
00085    */
00086   void set_taps (const std::vector<float> &taps);
00087 
00088   /*!
00089    * Print all of the filterbank taps to screen.
00090    */
00091   void print_taps();
00092   
00093   int work (int noutput_items,
00094             gr_vector_const_void_star &input_items,
00095             gr_vector_void_star &output_items);
00096 };
00097 
00098 #endif