add Vcs entries to control file
[debian/gnuradio] / gnuradio-core / src / lib / filter / gr_fir_ccc.h
1 /* -*- c++ -*- */
2 /*
3  * Copyright 2002,2003 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 generate_gr_fir_XXX.py
25  * Any changes made to this file will be overwritten.
26  */
27
28
29 #ifndef INCLUDED_GR_FIR_CCC_H
30 #define INCLUDED_GR_FIR_CCC_H
31
32 #include <vector>
33 #include <gr_types.h>
34 #include <gr_reverse.h>
35
36 /*!
37  * \brief Abstract class for FIR with gr_complex input, gr_complex output and gr_complex taps
38  * \ingroup filter_primitive
39  * 
40  * This is the abstract class for a Finite Impulse Response filter.
41  *
42  * The trailing suffix has the form _IOT where I codes the input type,
43  * O codes the output type, and T codes the tap type.
44  * I,O,T are elements of the set 's' (short), 'f' (float), 'c' (gr_complex), 'i' (int)
45  */
46
47 class gr_fir_ccc {
48
49 protected:
50   std::vector<gr_complex>       d_taps;         // reversed taps
51
52 public:
53
54   // CONSTRUCTORS
55
56   /*!
57    * \brief construct new FIR with given taps.
58    *
59    * Note that taps must be in forward order, e.g., coefficient 0 is
60    * stored in new_taps[0], coefficient 1 is stored in
61    * new_taps[1], etc.
62    */
63   gr_fir_ccc () {}
64   gr_fir_ccc (const std::vector<gr_complex> &taps) : d_taps (gr_reverse(taps)) {}
65
66   virtual ~gr_fir_ccc ();
67
68   // MANIPULATORS
69
70   /*!
71    * \brief compute a single output value.
72    *
73    * \p input must have ntaps() valid entries.
74    * input[0] .. input[ntaps() - 1] are referenced to compute the output value.
75    *
76    * \returns the filtered input value.
77    */
78   virtual gr_complex filter (const gr_complex input[]) = 0;
79
80   /*!
81    * \brief compute an array of N output values.
82    *
83    * \p input must have (n - 1 + ntaps()) valid entries.
84    * input[0] .. input[n - 1 + ntaps() - 1] are referenced to compute the output values.
85    */
86   virtual void filterN (gr_complex output[], const gr_complex input[],
87                         unsigned long n) = 0;
88
89   /*!
90    * \brief compute an array of N output values, decimating the input
91    *
92    * \p input must have (decimate * (n - 1) + ntaps()) valid entries.
93    * input[0] .. input[decimate * (n - 1) + ntaps() - 1] are referenced to 
94    * compute the output values.
95    */
96   virtual void filterNdec (gr_complex output[], const gr_complex input[],
97                            unsigned long n, unsigned decimate) = 0;
98
99   /*!
100    * \brief install \p new_taps as the current taps.
101    */
102   virtual void set_taps (const std::vector<gr_complex> &taps)
103   {
104     d_taps = gr_reverse(taps);
105   }
106
107   // ACCESSORS
108
109   /*!
110    * \return number of taps in filter.
111    */
112   unsigned ntaps () const { return d_taps.size (); }
113
114   /*!
115    * \return current taps
116    */
117   virtual const std::vector<gr_complex> get_taps () const
118   {
119     return gr_reverse(d_taps);
120   }
121 };
122
123 #endif /* INCLUDED_GR_FIR_CCC_H */