GNU Radio C++ API
gr_rational_resampler_base_fsf.h
Go to the documentation of this file.
1 /* -*- c++ -*- */
2 /*
3  * Copyright 2005 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  * WARNING: This file is automatically generated by
25  * generate_gr_rational_resampler_base_XXX.py Any changes made to this
26  * file will be overwritten.
27  */
28 
29 #ifndef INCLUDED_GR_RATIONAL_RESAMPLER_BASE_FSF_H
30 #define INCLUDED_GR_RATIONAL_RESAMPLER_BASE_FSF_H
31 
32 #include <gr_core_api.h>
33 #include <gr_block.h>
34 
39  unsigned decimation,
40  const std::vector<float> &taps);
41 
42 class gr_fir_fsf;
43 
44 /*!
45  * \brief Rational Resampling Polyphase FIR filter with float input, short output and float taps
46  * \ingroup filter_blk
47  */
49 {
50  private:
51  unsigned d_history;
52  unsigned d_interpolation, d_decimation;
53  unsigned d_ctr;
54  std::vector<float> d_new_taps;
55  bool d_updated;
56  std::vector<gr_fir_fsf *> d_firs;
57 
59  gr_make_rational_resampler_base_fsf (unsigned interpolation, unsigned decimation, const std::vector<float> &taps);
60 
61 
62  /*!
63  * Construct a FIR filter with the given taps
64  */
65  gr_rational_resampler_base_fsf (unsigned interpolation, unsigned decimation,
66  const std::vector<float> &taps);
67 
68  void install_taps (const std::vector<float> &taps);
69 
70  public:
72  unsigned history () const { return d_history; }
73  void set_history (unsigned history) { d_history = history; }
74 
75  unsigned interpolation() const { return d_interpolation; }
76  unsigned decimation() const { return d_decimation; }
77 
78  void set_taps (const std::vector<float> &taps);
79 
80  void forecast (int noutput_items, gr_vector_int &ninput_items_required);
81  int general_work (int noutput_items,
82  gr_vector_int &ninput_items,
83  gr_vector_const_void_star &input_items,
84  gr_vector_void_star &output_items);
85 };
86 
87 
88 #endif