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