GNU Radio Manual and C++ API Reference  3.7.4.1
The Free & Open Software Radio Ecosystem
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Groups Pages
pfb_interpolator_ccf.h
Go to the documentation of this file.
1 /* -*- c++ -*- */
2 /*
3  * Copyright 2009,2012 Free Software Foundation, Inc.
4  *
5  * This file is part of GNU Radio
6  *
7  * GNU Radio is free software; you can redistribute it and/or modify
8  * it under the terms of the GNU General Public License as published by
9  * the Free Software Foundation; either version 3, or (at your option)
10  * any later version.
11  *
12  * GNU Radio is distributed in the hope that it will be useful,
13  * but WITHOUT ANY WARRANTY; without even the implied warranty of
14  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15  * GNU General Public License for more details.
16  *
17  * You should have received a copy of the GNU General Public License
18  * along with GNU Radio; see the file COPYING. If not, write to
19  * the Free Software Foundation, Inc., 51 Franklin Street,
20  * Boston, MA 02110-1301, USA.
21  */
22 
23 
24 #ifndef INCLUDED_PFB_INTERPOLATOR_CCF_H
25 #define INCLUDED_PFB_INTERPOLATOR_CCF_H
26 
27 #include <gnuradio/filter/api.h>
29 
30 namespace gr {
31  namespace filter {
32 
33  /*!
34  * \brief Polyphase filterbank interpolator with gr_complex input,
35  * gr_complex output and float taps
36  * \ingroup channelizers_blk
37  *
38  * \details
39  * This block takes in a signal stream and performs interger up-
40  * sampling (interpolation) with a polyphase filterbank. The first
41  * input is the integer specifying how much to interpolate by. The
42  * second input is a vector (Python list) of floating-point taps
43  * of the prototype filter.
44  *
45  * The filter's taps should be based on the interpolation rate
46  * specified. That is, the bandwidth specified is relative to the
47  * bandwidth after interpolation.
48  *
49  * For example, using the GNU Radio's firdes utility to building
50  * filters, we build a low-pass filter with a sampling rate of
51  * <EM>fs</EM>, a 3-dB bandwidth of <EM>BW</EM> and a transition
52  * bandwidth of <EM>TB</EM>. We can also specify the out-of-band
53  * attenuation to use, ATT, and the filter window function (a
54  * Blackman-harris window in this case). The first input is the
55  * gain, which is also specified as the interpolation rate so that
56  * the output levels are the same as the input (this creates an
57  * overall increase in power).
58  *
59  * <B><EM>self._taps = filter.firdes.low_pass_2(interp, interp*fs, BW, TB,
60  * attenuation_dB=ATT, window=filter.firdes.WIN_BLACKMAN_hARRIS)</EM></B>
61  *
62  * The PFB interpolator code takes the taps generated above and
63  * builds a set of filters. The set contains <EM>interp</EM>
64  * number of filters and each filter contains
65  * ceil(taps.size()/interp) number of taps. Each tap from the
66  * filter prototype is sequentially inserted into the next
67  * filter. When all of the input taps are used, the remaining
68  * filters in the filterbank are filled out with 0's to make sure
69  * each filter has the same number of taps.
70  *
71  * The theory behind this block can be found in Chapter 7.1 of the
72  * following book.
73  *
74  * <B><EM>f. harris, "Multirate Signal Processing for Communication
75  * Systems</EM>," Upper Saddle River, NJ: Prentice Hall,
76  * Inc. 2004.</EM></B>
77  */
78 
80  {
81  public:
82  // gr::filter::pfb_interpolator_ccf::sptr
84 
85  /*!
86  * Build the polyphase filterbank interpolator.
87  * \param interp (unsigned integer) Specifies the interpolation rate to use
88  * \param taps (vector/list of floats) The prototype filter to populate the filterbank. The taps
89  * should be generated at the interpolated sampling rate.
90  */
91  static sptr make(unsigned int interp,
92  const std::vector<float> &taps);
93 
94  /*!
95  * Resets the filterbank's filter taps with the new prototype filter
96  * \param taps (vector/list of floats) The prototype filter to populate the filterbank.
97  * The taps should be generated at the interpolated sampling rate.
98  */
99  virtual void set_taps(const std::vector<float> &taps) = 0;
100 
101  /*!
102  * Return a vector<vector<>> of the filterbank taps
103  */
104  virtual std::vector<std::vector<float> > taps() const = 0;
105 
106  /*!
107  * Print all of the filterbank taps to screen.
108  */
109  virtual void print_taps() = 0;
110  };
111 
112  } /* namespace filter */
113 } /* namespace gr */
114 
115 #endif /* INCLUDED_FILTER_PFB_INTERPOLATOR_CCF_H */
shared_ptr documentation stub
Definition: shared_ptr_docstub.h:15
synchronous 1:N input to output with historyOverride work to provide the signal processing implementa...
Definition: sync_interpolator.h:37
static const float taps[NSTEPS+1][NTAPS]
Definition: interpolator_taps.h:9
boost::shared_ptr< pfb_interpolator_ccf > sptr
Definition: pfb_interpolator_ccf.h:83
Polyphase filterbank interpolator with gr_complex input, gr_complex output and float taps...
Definition: pfb_interpolator_ccf.h:79
#define FILTER_API
Definition: gr-filter/include/gnuradio/filter/api.h:30