GNU Radio 3.7.0 C++ API
pfb_synthesizer_ccf.h
Go to the documentation of this file.
00001 /* -*- c++ -*- */
00002 /*
00003  * Copyright 2010,2012 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_PFB_SYNTHESIZER_CCF_H
00025 #define INCLUDED_PFB_SYNTHESIZER_CCF_H
00026 
00027 #include <gnuradio/filter/api.h>
00028 #include <gnuradio/sync_interpolator.h>
00029 
00030 namespace gr {
00031   namespace filter {
00032 
00033     /*!
00034      * \brief Polyphase synthesis filterbank with
00035      *        gr_complex input, gr_complex output and float taps
00036      * \ingroup channelizers_blk
00037      */
00038     class FILTER_API pfb_synthesizer_ccf : virtual public sync_interpolator
00039     {
00040     public:
00041       // gr::filter::pfb_synthesizer_ccf::sptr
00042       typedef boost::shared_ptr<pfb_synthesizer_ccf> sptr;
00043 
00044       /*!
00045        * Build the polyphase synthesis filterbank.
00046        * \param numchans (unsigned integer) Specifies the number of
00047        *                 channels <EM>M</EM>
00048        * \param taps    (vector/list of floats) The prototype filter to
00049        *                populate the filterbank.
00050        * \param twox    (bool) use 2x oversampling or not (default is no)
00051        */
00052       static sptr make(unsigned int numchans,
00053                                   const std::vector<float> &taps,
00054                                   bool twox=false);
00055 
00056       /*!
00057        * Resets the filterbank's filter taps with the new prototype filter
00058        * \param taps    (vector/list of floats) The prototype filter to
00059        *                populate the filterbank.
00060        */
00061       virtual void set_taps(const std::vector<float> &taps) = 0;
00062 
00063       /*!
00064        * Print all of the filterbank taps to screen.
00065        */
00066       virtual void print_taps() = 0;
00067 
00068       /*!
00069        * Return a vector<vector<>> of the filterbank taps
00070        */
00071       virtual std::vector<std::vector<float> > taps() const = 0;
00072 
00073       /*!
00074        * Set the channel map. Channels are numbers as:
00075        *     N/2+1 | ... | N-1 | 0 | 1 |  2 | ... | N/2
00076        *    <------------------- 0 -------------------->
00077        *                        freq
00078        *
00079        * So input stream 0 goes to channel 0, etc. Setting a new channel
00080        * map allows the user to specify where in frequency he/she wants
00081        * the input stream to go. This is especially useful to avoid
00082        * putting signals into the channels on the edge of the spectrum
00083        * which can either wrap around (in the case of odd number of
00084        * channels) and be affected by filter rolloff in the transmitter.
00085        *
00086        * The map must be at least the number of streams being sent to the
00087        * block. Less and the algorithm will not have enough data to
00088        * properly setup the buffers. Any more channels specified will be
00089        * ignored.
00090        */
00091       virtual void set_channel_map(const std::vector<int> &map) = 0;
00092 
00093       /*!
00094        * Gets the current channel map.
00095        */
00096       virtual std::vector<int> channel_map() const = 0;
00097     };
00098 
00099   } /* namespace filter */
00100 } /* namespace gr */
00101 
00102 #endif /* INCLUDED_PFB_SYNTHESIZER_CCF_H */