GNU Radio C++ API Reference: fir_filter.h Source File

| GNU Radio C++ API Reference 3.10.12.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 * SPDX-License-Identifier: GPL-3.0-or-later
8 *
9 */
10
11#ifndef INCLUDED_FILTER_FIR_FILTER_H
12#define INCLUDED_FILTER_FIR_FILTER_H
13
14#include <gnuradio/filter/api.h>
15#include <gnuradio/gr_complex.h>
16#include <volk/volk_alloc.hh>
17#include <cstdint>
18#include <vector>
19
20namespace gr {
21namespace filter {
22namespace kernel {
23
24template <class IN_T, class OUT_T, class TAP_T>
25 class FILTER_API fir_filter
26{
27public:
28 fir_filter(const std::vector<TAP_T>& taps);
29
30 // Disallow copy.
31 //
32 // This prevents accidentally doing needless copies, not just of fir_filter,
33 // but every block that contains one.
34 fir_filter(const fir_filter&) = delete;
35 fir_filter& operator=(const fir_filter&) = delete;
36 fir_filter(fir_filter&&) = default;
37 fir_filter& operator=(fir_filter&&) = default;
38
39 void set_taps(const std::vector<TAP_T>& taps);
40 void update_tap(TAP_T t, unsigned int index);
41 std::vector<TAP_T> taps() const;
42 unsigned int ntaps() const;
43
44 OUT_T filter(const IN_T input[]) const;
45 void filterN(OUT_T output[], const IN_T input[], unsigned long n);
46 void filterNdec(OUT_T output[],
47 const IN_T input[],
48 unsigned long n,
49 unsigned int decimate);
50
51protected:
52 std::vector<TAP_T> d_taps;
53 unsigned int d_ntaps;
54 std::vector<volk::vector<TAP_T>> d_aligned_taps;
55 volk::vector<OUT_T> d_output;
56 int d_align;
57 int d_naligned;
58};
59 typedef fir_filter<float, float, float> fir_filter_fff;
60 typedef fir_filter<gr_complex, gr_complex, float> fir_filter_ccf;
61 typedef fir_filter<float, gr_complex, gr_complex> fir_filter_fcc;
62 typedef fir_filter<gr_complex, gr_complex, gr_complex> fir_filter_ccc;
63 typedef fir_filter<std::int16_t, gr_complex, gr_complex> fir_filter_scc;
64 typedef fir_filter<float, std::int16_t, float> fir_filter_fsf;
65} /* namespace kernel */
66} /* namespace filter */
67} /* namespace gr */
68
69#endif /* INCLUDED_FILTER_FIR_FILTER_H */
gr::filter::kernel::fir_filter
Definition fir_filter.h:26
gr::filter::kernel::fir_filter::filterN
void filterN(OUT_T output[], const IN_T input[], unsigned long n)
gr::filter::kernel::fir_filter< float, float, float >::d_naligned
int d_naligned
Definition fir_filter.h:57
gr::filter::kernel::fir_filter< float, float, float >::d_aligned_taps
std::vector< volk::vector< float > > d_aligned_taps
Definition fir_filter.h:54
gr::filter::kernel::fir_filter::filterNdec
void filterNdec(OUT_T output[], const IN_T input[], unsigned long n, unsigned int decimate)
gr::filter::kernel::fir_filter< float, float, float >::taps
std::vector< float > taps() const
gr::filter::kernel::fir_filter::fir_filter
fir_filter(const std::vector< TAP_T > &taps)
gr::filter::kernel::fir_filter::update_tap
void update_tap(TAP_T t, unsigned int index)
gr::filter::kernel::fir_filter::operator=
fir_filter & operator=(fir_filter &&)=default
gr::filter::kernel::fir_filter::operator=
fir_filter & operator=(const fir_filter &)=delete
gr::filter::kernel::fir_filter< float, float, float >::d_align
int d_align
Definition fir_filter.h:56
gr::filter::kernel::fir_filter< float, float, float >::d_taps
std::vector< float > d_taps
Definition fir_filter.h:52
gr::filter::kernel::fir_filter::ntaps
unsigned int ntaps() const
gr::filter::kernel::fir_filter< float, float, float >::d_output
volk::vector< float > d_output
Definition fir_filter.h:55
gr::filter::kernel::fir_filter::fir_filter
fir_filter(const fir_filter &)=delete
gr::filter::kernel::fir_filter< float, float, float >::d_ntaps
unsigned int d_ntaps
Definition fir_filter.h:53
gr::filter::kernel::fir_filter::filter
OUT_T filter(const IN_T input[]) const
gr::filter::kernel::fir_filter::set_taps
void set_taps(const std::vector< TAP_T > &taps)
gr::filter::kernel::fir_filter::fir_filter
fir_filter(fir_filter &&)=default
api.h
FILTER_API
#define FILTER_API
Definition gr-filter/include/gnuradio/filter/api.h:18
gr_complex.h
gr::filter::kernel
Definition fft_filter.h:23
gr::filter::kernel::fir_filter_ccf
fir_filter< gr_complex, gr_complex, float > fir_filter_ccf
Definition fir_filter.h:60
gr::filter::kernel::fir_filter_fsf
fir_filter< float, std::int16_t, float > fir_filter_fsf
Definition fir_filter.h:64
gr::filter::kernel::fir_filter_ccc
fir_filter< gr_complex, gr_complex, gr_complex > fir_filter_ccc
Definition fir_filter.h:62
gr::filter::kernel::fir_filter_scc
fir_filter< std::int16_t, gr_complex, gr_complex > fir_filter_scc
Definition fir_filter.h:63
gr::filter::kernel::fir_filter_fcc
fir_filter< float, gr_complex, gr_complex > fir_filter_fcc
Definition fir_filter.h:61
gr::filter::kernel::fir_filter_fff
fir_filter< float, float, float > fir_filter_fff
Definition fir_filter.h:59
gr::filter
Definition dc_blocker_cc.h:18
gr
GNU Radio logging wrapper.
Definition basic_block.h:29