GNU Radio Manual and C++ API Reference 3.7.14.0
The Free & Open Software Radio Ecosystem
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
30namespace gr {
31namespace 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 integer 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 * filters and each filter contains
65 * ceil(taps.size()/interp) 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{
81public:
82 // gr::filter::pfb_interpolator_ccf::sptr
83 typedef boost::shared_ptr<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
89 * filterbank. The taps should be generated at the interpolated sampling rate.
90 */
91 static sptr make(unsigned int interp, const std::vector<float>& taps);
92
93 /*!
94 * Resets the filterbank's filter taps with the new prototype filter
95 * \param taps (vector/list of floats) The prototype filter to populate the
96 * filterbank. The taps should be generated at the interpolated sampling rate.
97 */
98 virtual void set_taps(const std::vector<float>& taps) = 0;
99
100 /*!
101 * Return a vector<vector<>> of the filterbank taps
102 */
103 virtual std::vector<std::vector<float> > taps() const = 0;
104
105 /*!
106 * Print all of the filterbank taps to screen.
107 */
108 virtual void print_taps() = 0;
109};
110
111} /* namespace filter */
112} /* namespace gr */
113
114#endif /* INCLUDED_FILTER_PFB_INTERPOLATOR_CCF_H */
Polyphase filterbank interpolator with gr_complex input, gr_complex output and float taps.
Definition: pfb_interpolator_ccf.h:80
boost::shared_ptr< pfb_interpolator_ccf > sptr
Definition: pfb_interpolator_ccf.h:83
static sptr make(unsigned int interp, const std::vector< float > &taps)
virtual std::vector< std::vector< float > > taps() const =0
virtual void set_taps(const std::vector< float > &taps)=0
synchronous 1:N input to output with history
Definition: sync_interpolator.h:38
#define FILTER_API
Definition: gr-filter/include/gnuradio/filter/api.h:30
static const float taps[NSTEPS+1][NTAPS]
Definition: interpolator_taps.h:9
Include this header to use the message passing features.
Definition: basic_block.h:45