GNU Radio Manual and C++ API Reference 3.8.5.0
The Free & Open Software Radio Ecosystem
 
Loading...
Searching...
No Matches
fir_filter.h
Go to the documentation of this file.
1/* -*- c++ -*- */
2/*
3 * Copyright 2004,2010,2012,2018 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#ifndef INCLUDED_FILTER_FIR_FILTER_H
24#define INCLUDED_FILTER_FIR_FILTER_H
25
26#include <gnuradio/filter/api.h>
27#include <gnuradio/gr_complex.h>
28#include <cstdint>
29#include <vector>
30
31namespace gr {
32namespace filter {
33namespace kernel {
34
35template <class IN_T, class OUT_T, class TAP_T>
37{
38public:
39 fir_filter(int decimation, const std::vector<TAP_T>& taps);
41
42 void set_taps(const std::vector<TAP_T>& taps);
43 void update_tap(TAP_T t, unsigned int index);
44 std::vector<TAP_T> taps() const;
45 unsigned int ntaps() const;
46
47 OUT_T filter(const IN_T input[]);
48 void filterN(OUT_T output[], const IN_T input[], unsigned long n);
49 void filterNdec(OUT_T output[],
50 const IN_T input[],
51 unsigned long n,
52 unsigned int decimate);
53
54protected:
55 std::vector<TAP_T> d_taps;
56 unsigned int d_ntaps;
58 OUT_T* d_output;
61};
68} /* namespace kernel */
69} /* namespace filter */
70} /* namespace gr */
71
72#endif /* INCLUDED_FILTER_FIR_FILTER_H */
Definition fir_filter.h:37
void filterN(OUT_T output[], const IN_T input[], unsigned long n)
int d_naligned
Definition fir_filter.h:60
TAP_T ** d_aligned_taps
Definition fir_filter.h:57
void filterNdec(OUT_T output[], const IN_T input[], unsigned long n, unsigned int decimate)
std::vector< TAP_T > taps() const
void update_tap(TAP_T t, unsigned int index)
OUT_T * d_output
Definition fir_filter.h:58
fir_filter(int decimation, const std::vector< TAP_T > &taps)
int d_align
Definition fir_filter.h:59
std::vector< TAP_T > d_taps
Definition fir_filter.h:55
unsigned int ntaps() const
unsigned int d_ntaps
Definition fir_filter.h:56
void set_taps(const std::vector< TAP_T > &taps)
OUT_T filter(const IN_T input[])
#define FILTER_API
Definition gr-filter/include/gnuradio/filter/api.h:30
static const float taps[NSTEPS+1][NTAPS]
Definition interpolator_taps.h:9
fir_filter< gr_complex, gr_complex, float > fir_filter_ccf
Definition fir_filter.h:63
fir_filter< float, std::int16_t, float > fir_filter_fsf
Definition fir_filter.h:67
fir_filter< gr_complex, gr_complex, gr_complex > fir_filter_ccc
Definition fir_filter.h:65
fir_filter< std::int16_t, gr_complex, gr_complex > fir_filter_scc
Definition fir_filter.h:66
fir_filter< float, gr_complex, gr_complex > fir_filter_fcc
Definition fir_filter.h:64
fir_filter< float, float, float > fir_filter_fff
Definition fir_filter.h:62
GNU Radio logging wrapper for log4cpp library (C++ port of log4j)
Definition basic_block.h:46