3 * Copyright 2009 Free Software Foundation, Inc.
5 * This file is part of GNU Radio
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)
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.
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.
24 #ifndef INCLUDED_GR_PFB_CLOCK_SYNC_CCF_H
25 #define INCLUDED_GR_PFB_CLOCK_SYNC_CCF_H
29 class gr_pfb_clock_sync_ccf;
30 typedef boost::shared_ptr<gr_pfb_clock_sync_ccf> gr_pfb_clock_sync_ccf_sptr;
31 gr_pfb_clock_sync_ccf_sptr gr_make_pfb_clock_sync_ccf (float sps, float gain,
32 const std::vector<float> &taps,
33 unsigned int filter_size=32,
39 * \class gr_pfb_clock_sync_ccf
41 * \brief Timing synchronizer using polyphase filterbanks
47 class gr_pfb_clock_sync_ccf : public gr_block
51 * Build the polyphase filterbank timing synchronizer.
53 friend gr_pfb_clock_sync_ccf_sptr gr_make_pfb_clock_sync_ccf (float sps, float gain,
54 const std::vector<float> &taps,
55 unsigned int filter_size,
61 unsigned int d_nfilters;
62 std::vector<gr_fir_ccf*> d_filters;
63 std::vector<gr_fir_ccf*> d_diff_filters;
64 std::vector< std::vector<float> > d_taps;
65 std::vector< std::vector<float> > d_dtaps;
67 unsigned int d_last_filter;
68 unsigned int d_start_count;
69 unsigned int d_taps_per_filter;
72 * Build the polyphase filterbank timing synchronizer.
74 gr_pfb_clock_sync_ccf (float sps, float gain,
75 const std::vector<float> &taps,
76 unsigned int filter_size,
79 void create_diff_taps(const std::vector<float> &newtaps,
80 std::vector<float> &difftaps);
83 ~gr_pfb_clock_sync_ccf ();
86 * Resets the filterbank's filter taps with the new prototype filter
88 void set_taps (const std::vector<float> &taps,
89 std::vector< std::vector<float> > &ourtaps,
90 std::vector<gr_fir_ccf*> &ourfilter);
91 std::vector<float> channel_taps(int channel);
92 std::vector<float> diff_channel_taps(int channel);
95 * Print all of the filterbank taps to screen.
98 void print_diff_taps();
100 int general_work (int noutput_items,
101 gr_vector_int &ninput_items,
102 gr_vector_const_void_star &input_items,
103 gr_vector_void_star &output_items);