GNU Radio Manual and C++ API Reference 3.10.5.1
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 * SPDX-License-Identifier: GPL-3.0-or-later
8 *
9 */
10
11
12#ifndef INCLUDED_PFB_INTERPOLATOR_CCF_H
13#define INCLUDED_PFB_INTERPOLATOR_CCF_H
14
15#include <gnuradio/filter/api.h>
17
18namespace gr {
19namespace filter {
20
21/*!
22 * \brief Polyphase filterbank interpolator with gr_complex input,
23 * gr_complex output and float taps
24 * \ingroup channelizers_blk
25 *
26 * \details
27 * This block takes in a signal stream and performs integer up-
28 * sampling (interpolation) with a polyphase filterbank. The first
29 * input is the integer specifying how much to interpolate by. The
30 * second input is a vector (Python list) of floating-point taps
31 * of the prototype filter.
32 *
33 * The filter's taps should be based on the interpolation rate
34 * specified. That is, the bandwidth specified is relative to the
35 * bandwidth after interpolation.
36 *
37 * For example, using the GNU Radio's firdes utility to building
38 * filters, we build a low-pass filter with a sampling rate of
39 * <EM>fs</EM>, a 3-dB bandwidth of <EM>BW</EM> and a transition
40 * bandwidth of <EM>TB</EM>. We can also specify the out-of-band
41 * attenuation to use, ATT, and the filter window function (a
42 * Blackman-harris window in this case). The first input is the
43 * gain, which is also specified as the interpolation rate so that
44 * the output levels are the same as the input (this creates an
45 * overall increase in power).
46 *
47 * <B><EM>self._taps = filter.firdes.low_pass_2(interp, interp*fs, BW, TB,
48 * attenuation_dB=ATT, window=fft.window.WIN_BLACKMAN_hARRIS)</EM></B>
49 *
50 * The PFB interpolator code takes the taps generated above and
51 * builds a set of filters. The set contains <EM>interp</EM>
52 * filters and each filter contains
53 * ceil(taps.size()/interp) taps. Each tap from the
54 * filter prototype is sequentially inserted into the next
55 * filter. When all of the input taps are used, the remaining
56 * filters in the filterbank are filled out with 0's to make sure
57 * each filter has the same number of taps.
58 *
59 * The theory behind this block can be found in Chapter 7.1 of the
60 * following book:
61 *
62 * <B><EM>f. harris, "Multirate Signal Processing for Communication
63 * Systems</EM>," Upper Saddle River, NJ: Prentice Hall,
64 * Inc. 2004.</EM></B>
65 */
66
68{
69public:
70 // gr::filter::pfb_interpolator_ccf::sptr
71 typedef std::shared_ptr<pfb_interpolator_ccf> sptr;
72
73 /*!
74 * Build the polyphase filterbank interpolator.
75 * \param interp (unsigned integer) Specifies the interpolation rate to use
76 * \param taps (vector/list of floats) The prototype filter to populate the
77 * filterbank. The taps should be generated at the interpolated sampling rate.
78 */
79 static sptr make(unsigned int interp, const std::vector<float>& taps);
80
81 /*!
82 * Resets the filterbank's filter taps with the new prototype filter
83 * \param taps (vector/list of floats) The prototype filter to populate the
84 * filterbank. The taps should be generated at the interpolated sampling rate.
85 */
86 virtual void set_taps(const std::vector<float>& taps) = 0;
87
88 /*!
89 * Return a vector<vector<>> of the filterbank taps
90 */
91 virtual std::vector<std::vector<float>> taps() const = 0;
92
93 /*!
94 * Print all of the filterbank taps to screen.
95 */
96 virtual void print_taps() = 0;
97};
98
99} /* namespace filter */
100} /* namespace gr */
101
102#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:68
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
std::shared_ptr< pfb_interpolator_ccf > sptr
Definition: pfb_interpolator_ccf.h:71
synchronous 1:N input to output with history
Definition: sync_interpolator.h:26
#define FILTER_API
Definition: gr-filter/include/gnuradio/filter/api.h:18
static constexpr float taps[NSTEPS+1][NTAPS]
Definition: interpolator_taps.h:9
GNU Radio logging wrapper.
Definition: basic_block.h:29