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