GNU Radio 3.6.5.1 C++ API
pfb_synthesizer_ccf_impl.h
Go to the documentation of this file.
1 /* -*- c++ -*- */
2 /*
3  * Copyright 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_SYNTHESIZER_CCF_IMPL_H
25 #define INCLUDED_PFB_SYNTHESIZER_CCF_IMPL_H
26 
29 #include <fft/fft.h>
30 #include <gruel/thread.h>
31 
32 namespace gr {
33  namespace filter {
34 
35  // While this is a polyphase_filterbank, we don't use the normal
36  // parent class because we have to use the fir_filter_with_buffer
37  // objects instead of normal filters.
38 
40  {
41  private:
42  bool d_updated;
43  unsigned int d_numchans;
44  unsigned int d_taps_per_filter;
45  fft::fft_complex *d_fft;
46  std::vector< kernel::fir_filter_with_buffer_ccf*> d_filters;
47  std::vector< std::vector<float> > d_taps;
48  int d_state;
49  std::vector<int> d_channel_map;
50  unsigned int d_twox;
51  gruel::mutex d_mutex; // mutex to protect set/work access
52 
53  /*!
54  * \brief Tap setting algorithm for critically sampled channels
55  */
56  void set_taps1(const std::vector<float> &taps);
57 
58  /*!
59  * \brief Tap setting algorithm for 2x over-sampled channels
60  */
61  void set_taps2(const std::vector<float> &taps);
62 
63 
64  public:
65  pfb_synthesizer_ccf_impl(unsigned int numchans,
66  const std::vector<float> &taps,
67  bool twox);
69 
70  void set_taps(const std::vector<float> &taps);
71  std::vector<std::vector<float> > taps() const;
72  void print_taps();
73 
74  void set_channel_map(const std::vector<int> &map);
75  std::vector<int> channel_map() const;
76 
77  int work(int noutput_items,
78  gr_vector_const_void_star &input_items,
79  gr_vector_void_star &output_items);
80  };
81 
82  } /* namespace filter */
83 } /* namespace gr */
84 
85 #endif /* INCLUDED_PFB_SYNTHESIZER_CCF_IMPL_H */