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

| GNU Radio C++ API Reference 3.10.12.0 The Free & Open Software Radio Ecosystem |

Loading...
Searching...
No Matches
filterbank.h
Go to the documentation of this file.
1/* -*- c++ -*- */
2/*
3 * Copyright 2012, 2014 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
12#ifndef INCLUDED_FILTER_FILTERBANK_H
13#define INCLUDED_FILTER_FILTERBANK_H
14
15#include <gnuradio/filter/api.h>
16#include <gnuradio/filter/fir_filter.h>
17
18namespace gr {
19namespace filter {
20namespace kernel {
21
22/*!
23 * \brief A filter bank with generic taps.
24 *
25 * This block takes in a vector of N complex inputs, passes
26 * them through N FIR filters, and outputs a vector of N complex
27 * outputs.
28 *
29 * The only advantage of using this block over N individual
30 * FIR filter blocks is that it places less of a load on the
31 * scheduler.
32 *
33 * The number of filters cannot be changed dynamically, however
34 * filters can be deactivated (i.e. no processing is done for
35 * them) by passing a vector of filter taps containing all zeros
36 * to them. In this case their entry in the output vector is a
37 * zero.
38 *
39 */
40
41 class FILTER_API filterbank
42{
43protected:
44 std::vector<std::vector<float>> d_taps;
45 unsigned int d_nfilts;
46 unsigned int d_ntaps;
47 std::vector<kernel::fir_filter_ccf> d_fir_filters;
48 std::vector<bool> d_active;
49 unsigned int d_taps_per_filter;
50
51public:
52 /*!
53 * Build the filterbank.
54 *
55 * \param taps (vector of vector of floats / list of list of floats)
56 * Populates the filters.
57 */
58 filterbank(const std::vector<std::vector<float>>& taps);
59 filterbank(filterbank&&) = default;
60 virtual ~filterbank() = default;
61
62 /*!
63 * Update the filterbank's filter taps.
64 *
65 * \param taps (vector of vector of floats / list of list of floats)
66 * The prototype filter to populate the filterbank.
67 */
68 virtual void set_taps(const std::vector<std::vector<float>>& taps);
69
70 /*!
71 * Print all of the filterbank taps to screen.
72 */
73 void print_taps();
74
75 /*!
76 * Return a vector<vector<>> of the filterbank taps
77 */
78 std::vector<std::vector<float>> taps() const;
79};
80
81} /* namespace kernel */
82} /* namespace filter */
83} /* namespace gr */
84
85#endif /* INCLUDED_FILTER_FILTERBANK_H */
gr::filter::kernel::filterbank::filterbank
filterbank(const std::vector< std::vector< float > > &taps)
gr::filter::kernel::filterbank::d_taps
std::vector< std::vector< float > > d_taps
Definition filterbank.h:44
gr::filter::kernel::filterbank::~filterbank
virtual ~filterbank()=default
gr::filter::kernel::filterbank::print_taps
void print_taps()
gr::filter::kernel::filterbank::d_taps_per_filter
unsigned int d_taps_per_filter
Definition filterbank.h:49
gr::filter::kernel::filterbank::d_active
std::vector< bool > d_active
Definition filterbank.h:48
gr::filter::kernel::filterbank::set_taps
virtual void set_taps(const std::vector< std::vector< float > > &taps)
gr::filter::kernel::filterbank::d_ntaps
unsigned int d_ntaps
Definition filterbank.h:46
gr::filter::kernel::filterbank::taps
std::vector< std::vector< float > > taps() const
gr::filter::kernel::filterbank::filterbank
filterbank(filterbank &&)=default
gr::filter::kernel::filterbank::d_nfilts
unsigned int d_nfilts
Definition filterbank.h:45
gr::filter::kernel::filterbank::d_fir_filters
std::vector< kernel::fir_filter_ccf > d_fir_filters
Definition filterbank.h:47
fir_filter.h
api.h
FILTER_API
#define FILTER_API
Definition gr-filter/include/gnuradio/filter/api.h:18
gr::filter::kernel
Definition fft_filter.h:23
gr::filter
Definition dc_blocker_cc.h:18
gr
GNU Radio logging wrapper.
Definition basic_block.h:29