GNU Radio Manual and C++ API Reference 3.10.5.1
The Free & Open Software Radio Ecosystem
pfb_arb_resampler_ccf.h
Go to the documentation of this file.
1/* -*- c++ -*- */
2/*
3 * Copyright 2009,2010,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_ARB_RESAMPLER_CCF_H
13#define INCLUDED_PFB_ARB_RESAMPLER_CCF_H
14
15#include <gnuradio/block.h>
16#include <gnuradio/filter/api.h>
17
18namespace gr {
19namespace filter {
20
21/*!
22 * \brief Polyphase filterbank arbitrary resampler with
23 * gr_complex input, gr_complex output and float taps
24 * \ingroup resamplers_blk
25 *
26 * \details
27
28 * This block takes in a signal stream and calls
29 * gr::filter::kernel::pfb_arb_resampler_ccf to perform
30 * arbitrary resampling on the stream.
31 *
32 * Output sampling rate is \p rate * input rate.
33 */
35{
36public:
37 // gr::filter::pfb_arb_resampler_ccf::sptr
38 typedef std::shared_ptr<pfb_arb_resampler_ccf> sptr;
39
40 /*!
41 * Build the polyphase filterbank arbitrary resampler.
42 * \param rate (float) Specifies the resampling rate to use
43 * \param taps (vector/list of floats) The prototype filter to populate the
44 * filterbank. The taps should be generated at the filter_size sampling rate. \param
45 * filter_size (unsigned int) The number of filters in the filter bank. This is
46 * directly related to quantization noise introduced during the resampling. Defaults
47 * to 32 filters.
48 */
49 static sptr
50 make(float rate, const std::vector<float>& taps, unsigned int filter_size = 32);
51
52 /*!
53 * Resets the filterbank's filter taps with the new prototype filter
54 * \param taps (vector/list of floats) The prototype filter to populate the
55 * filterbank.
56 */
57 virtual void set_taps(const std::vector<float>& taps) = 0;
58
59 /*!
60 * Return a vector<vector<>> of the filterbank taps
61 */
62 virtual std::vector<std::vector<float>> taps() const = 0;
63
64 /*!
65 * Print all of the filterbank taps to screen.
66 */
67 virtual void print_taps() = 0;
68
69 /*!
70 * Sets the resampling rate of the block.
71 */
72 virtual void set_rate(float rate) = 0;
73
74 /*!
75 * Sets the current phase offset in radians (0 to 2pi).
76 */
77 virtual void set_phase(float ph) = 0;
78
79 /*!
80 * Gets the current phase of the resampler in radians (2 to 2pi).
81 */
82 virtual float phase() const = 0;
83
84 /*!
85 * Gets the number of taps per filter.
86 */
87 virtual unsigned int taps_per_filter() const = 0;
88
89 /*!
90 * Gets the interpolation rate of the filter.
91 */
92 virtual unsigned int interpolation_rate() const = 0;
93
94 /*!
95 * Gets the decimation rate of the filter.
96 */
97 virtual unsigned int decimation_rate() const = 0;
98
99 /*!
100 * Gets the fractional rate of the filter.
101 */
102 virtual float fractional_rate() const = 0;
103
104 /*!
105 * Get the group delay of the filter.
106 */
107 virtual int group_delay() const = 0;
108
109 /*!
110 * Calculates the phase offset expected by a sine wave of
111 * frequency \p freq and sampling rate \p fs (assuming input
112 * sine wave has 0 degree phase).
113 */
114 virtual float phase_offset(float freq, float fs) = 0;
115};
116
117} /* namespace filter */
118} /* namespace gr */
119
120#endif /* INCLUDED_PFB_ARB_RESAMPLER_CCF_H */
The abstract base class for all 'terminal' processing blocks.
Definition: gnuradio-runtime/include/gnuradio/block.h:63
Polyphase filterbank arbitrary resampler with gr_complex input, gr_complex output and float taps.
Definition: pfb_arb_resampler_ccf.h:35
virtual float phase() const =0
virtual float phase_offset(float freq, float fs)=0
virtual unsigned int taps_per_filter() const =0
virtual void set_taps(const std::vector< float > &taps)=0
static sptr make(float rate, const std::vector< float > &taps, unsigned int filter_size=32)
virtual std::vector< std::vector< float > > taps() const =0
virtual void set_phase(float ph)=0
virtual void set_rate(float rate)=0
virtual int group_delay() const =0
virtual unsigned int interpolation_rate() const =0
virtual float fractional_rate() const =0
std::shared_ptr< pfb_arb_resampler_ccf > sptr
Definition: pfb_arb_resampler_ccf.h:38
virtual unsigned int decimation_rate() const =0
#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