GNU Radio Manual and C++ API Reference  3.10.9.1
The Free & Open Software Radio Ecosystem
fft_filter_ccf.h
Go to the documentation of this file.
1 /* -*- c++ -*- */
2 /*
3  * Copyright 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 #ifndef INCLUDED_FILTER_FFT_FILTER_CCF_H
12 #define INCLUDED_FILTER_FFT_FILTER_CCF_H
13 
14 #include <gnuradio/filter/api.h>
16 
17 namespace gr {
18 namespace filter {
19 
20 /*!
21  * \brief Fast FFT filter with gr_complex input, gr_complex output and float taps
22  * \ingroup filter_blk
23  *
24  * \details
25  * This block implements a complex decimating filter using the
26  * fast convolution method via an FFT. The decimation factor is an
27  * integer that is greater than or equal to 1.
28  *
29  * The filter takes a set of complex (or real) taps to use in the
30  * filtering operation. These taps can be defined as anything that
31  * satisfies the user's filtering needs. For standard filters such
32  * as lowpass, highpass, bandpass, etc., the filter.firdes and
33  * filter.optfir classes provide convenient generating methods.
34  *
35  * This filter is implemented by using the FFTW package to perform
36  * the required FFTs. An optional argument, nthreads, may be
37  * passed to the constructor (or set using the set_nthreads member
38  * function) to split the FFT among N number of threads. This can
39  * improve performance on very large FFTs (that is, if the number
40  * of taps used is very large) if you have enough threads/cores to
41  * support it.
42  */
44 {
45 public:
46  // gr::filter::fft_filter_ccf::sptr
47  typedef std::shared_ptr<fft_filter_ccf> sptr;
48 
49  /*!
50  * Build an FFT filter blocks.
51  *
52  * \param decimation >= 1
53  * \param taps complex filter taps
54  * \param nthreads number of threads for the FFT to use
55  */
56  static sptr make(int decimation, const std::vector<float>& taps, int nthreads = 1);
57 
58  virtual void set_taps(const std::vector<float>& taps) = 0;
59  virtual std::vector<float> taps() const = 0;
60 
61  /*!
62  * \brief Set number of threads to use.
63  */
64  virtual void set_nthreads(int n) = 0;
65 
66  /*!
67  * \brief Get number of threads being used.
68  */
69  virtual int nthreads() const = 0;
70 };
71 
72 } /* namespace filter */
73 } /* namespace gr */
74 
75 #endif /* INCLUDED_FILTER_FFT_FILTER_CCF_H */
Fast FFT filter with gr_complex input, gr_complex output and float taps.
Definition: fft_filter_ccf.h:44
virtual int nthreads() const =0
Get number of threads being used.
static sptr make(int decimation, const std::vector< float > &taps, int nthreads=1)
virtual void set_taps(const std::vector< float > &taps)=0
virtual std::vector< float > taps() const =0
virtual void set_nthreads(int n)=0
Set number of threads to use.
std::shared_ptr< fft_filter_ccf > sptr
Definition: fft_filter_ccf.h:47
synchronous N:1 input to output with history
Definition: sync_decimator.h:26
#define FILTER_API
Definition: gr-filter/include/gnuradio/filter/api.h:18
static constexpr float taps[NSTEPS+1][NTAPS]
Definition: interpolator_taps.h:9
GNU Radio logging wrapper.
Definition: basic_block.h:29