681d82bbb6ee01f8dc4796b05ccc4b74c0758468
[debian/gnuradio] / gnuradio-core / src / lib / filter / gr_freq_xlating_fir_filter_ccf.h
1 /* -*- c++ -*- */
2 /*
3  * Copyright 2002,2004 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_freq_xlating_fir_filter_XXX.py  Any changes made to this file
26  * will be overwritten.
27  */
28
29 #ifndef INCLUDED_GR_FREQ_XLATING_FIR_FILTER_CCF_H
30 #define INCLUDED_GR_FREQ_XLATING_FIR_FILTER_CCF_H
31
32 #include <gr_sync_decimator.h>
33 #include <gr_rotator.h>
34
35 class gr_freq_xlating_fir_filter_ccf;
36 typedef boost::shared_ptr<gr_freq_xlating_fir_filter_ccf> gr_freq_xlating_fir_filter_ccf_sptr;
37
38 /*!
39  * Construct a FIR filter with the given taps and a composite frequency
40  * translation that shifts center_freq down to zero Hz.  The frequency 
41  * translation logically comes before the filtering operation.
42  */
43 gr_freq_xlating_fir_filter_ccf_sptr 
44 gr_make_freq_xlating_fir_filter_ccf (int decimation, const std::vector<float> &taps,
45                      double center_freq, double sampling_freq);
46
47
48 class gr_fir_ccc;
49
50 /*!
51  * \brief FIR filter combined with frequency translation with gr_complex input, gr_complex output and float taps
52  * \ingroup filter_blk
53  *
54  * This class efficiently combines a frequency translation
55  * (typically "down conversion") with a FIR filter (typically low-pass)
56  * and decimation.  It is ideally suited for a "channel selection filter"
57  * and can be efficiently used to select and decimate a narrow band signal
58  * out of wide bandwidth input.
59  *
60  * Uses a single input array to produce a single output array.
61  * Additional inputs and/or outputs are ignored.
62  */
63 class gr_freq_xlating_fir_filter_ccf : public gr_sync_decimator
64 {
65  public:
66   virtual ~gr_freq_xlating_fir_filter_ccf ();
67
68   void set_center_freq (double center_freq);
69   void set_taps (const std::vector<float> &taps);
70
71   int work (int noutput_items,
72             gr_vector_const_void_star &input_items,
73             gr_vector_void_star &output_items);
74
75  private:
76   friend gr_freq_xlating_fir_filter_ccf_sptr 
77   gr_make_freq_xlating_fir_filter_ccf (int decimation, const std::vector<float> &taps,
78                        double center_freq, double sampling_freq);
79
80  protected:
81   std::vector<float>    d_proto_taps;
82   gr_fir_ccc                   *d_composite_fir;
83   gr_rotator                    d_r;
84   double                        d_center_freq;
85   double                        d_sampling_freq;
86   bool                          d_updated;
87
88   virtual void build_composite_fir ();
89
90   /*!
91    * Construct a FIR filter with the given taps and a composite frequency
92    * translation that shifts center_freq down to zero Hz.  The frequency 
93    * translation logically comes before the filtering operation.
94    */
95   gr_freq_xlating_fir_filter_ccf (int decimation,
96                           const std::vector<float> &taps,
97                           double center_freq, double sampling_freq);
98 };
99
100 #endif /* _gr_freq_xlating_fir_filter_ccf_H_ */