3 * Copyright 2010 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 * WARNING: This file is automatically generated by generate_gri_fir_XXX.py
25 * Any changes made to this file will be overwritten.
29 #ifndef INCLUDED_GRI_FIR_FILTER_WITH_BUFFER_CCF_H
30 #define INCLUDED_GRI_FIR_FILTER_WITH_BUFFER_CCF_H
34 #include <gr_reverse.h>
39 * \brief FIR with internal buffer for gr_complex input,
40 gr_complex output and float taps
45 class gri_fir_filter_with_buffer_ccf {
48 std::vector<float> d_taps; // reversed taps
57 * \brief construct new FIR with given taps.
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
63 gri_fir_filter_with_buffer_ccf (const std::vector<float> &taps);
65 ~gri_fir_filter_with_buffer_ccf ();
70 * \brief compute a single output value.
72 * \p input is a single input value of the filter type
74 * \returns the filtered input value.
76 gr_complex filter (gr_complex input);
80 * \brief compute a single output value; designed for decimating filters.
82 * \p input is a single input value of the filter type. The value of dec is the
83 * decimating value of the filter, so input[] must have dec valid values.
84 * The filter pushes dec number of items onto the circ. buffer before computing
87 * \returns the filtered input value.
89 gr_complex filter (const gr_complex input[], unsigned long dec);
92 * \brief compute an array of N output values.
94 * \p input must have (n - 1 + ntaps()) valid entries.
95 * input[0] .. input[n - 1 + ntaps() - 1] are referenced to compute the output values.
97 void filterN (gr_complex output[], const gr_complex input[],
101 * \brief compute an array of N output values, decimating the input
103 * \p input must have (decimate * (n - 1) + ntaps()) valid entries.
104 * input[0] .. input[decimate * (n - 1) + ntaps() - 1] are referenced to
105 * compute the output values.
107 void filterNdec (gr_complex output[], const gr_complex input[],
108 unsigned long n, unsigned long decimate);
111 * \brief install \p new_taps as the current taps.
113 void set_taps (const std::vector<float> &taps);
118 * \return number of taps in filter.
120 unsigned ntaps () const { return d_taps.size (); }
123 * \return current taps
125 const std::vector<float> get_taps () const
127 return gr_reverse(d_taps);
131 #endif /* INCLUDED_GRI_FIR_FILTER_WITH_BUFFER_CCF_H */