gr-baz Package
gr_fir_fsf_generic.h
Go to the documentation of this file.
1 /* -*- c++ -*- */
2 /*
3  * Copyright 2002 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 #ifndef INCLUDED_GR_GR_FIR_FSF_GENERIC_H
23 #define INCLUDED_GR_GR_FIR_FSF_GENERIC_H
24 
25 #include <gr_core_api.h>
26 #include <gr_fir_fsf.h>
27 
28 /*!
29  * \brief Concrete class for generic implementation of FIR with float input, short output and float taps
30  *
31  * The trailing suffix has the form _IOT where I codes the input type,
32  * O codes the output type, and T codes the tap type.
33  * I,O,T are elements of the set 's' (short), 'f' (float), 'c' (gr_complex), 'i' (int)
34  */
35 
37 
38 public:
39 
40  // CREATORS
41 
43  gr_fir_fsf_generic (const std::vector<float> &taps) : gr_fir_fsf (taps) {}
44 
45  // MANIPULATORS
46 
47  /*!
48  * \brief compute a single output value.
49  *
50  * \p input must have ntaps() valid entries.
51  * input[0] .. input[ntaps() - 1] are referenced to compute the output value.
52  *
53  * \returns the filtered input value.
54  */
55  virtual short filter (const float input[]);
56 
57  /*!
58  * \brief compute an array of N output values.
59  *
60  * \p input must have (n - 1 + ntaps()) valid entries.
61  * input[0] .. input[n - 1 + ntaps() - 1] are referenced to compute the output values.
62  */
63  virtual void filterN (short output[], const float input[],
64  unsigned long n);
65 
66  /*!
67  * \brief compute an array of N output values, decimating the input
68  *
69  * \p input must have (decimate * (n - 1) + ntaps()) valid entries.
70  * input[0] .. input[decimate * (n - 1) + ntaps() - 1] are referenced to
71  * compute the output values.
72  */
73  virtual void filterNdec (short output[], const float input[],
74  unsigned long n, unsigned decimate);
75 
76 };
77 
78 #endif /* INCLUDED_GR_GR_FIR_FSF_GENERIC_H */