GNU Radio Manual and C++ API Reference  3.7.13.4
The Free & Open Software Radio Ecosystem
fft_filter_fff.h
Go to the documentation of this file.
1 /* -*- c++ -*- */
2 /*
3  * Copyright 2005,2012 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_FFT_FILTER_FFF_H
24 #define INCLUDED_FILTER_FFT_FILTER_FFF_H
25 
26 #include <gnuradio/filter/api.h>
28 
29 namespace gr {
30  namespace filter {
31 
32  /*!
33  * \brief Fast FFT filter with float input, float output and float taps
34  * \ingroup filter_blk
35  *
36  * \details
37  * This block implements a real-value decimating filter using the
38  * fast convolution method via an FFT. The decimation factor is an
39  * integer that is greater than or equal to 1.
40  *
41  * The filter takes a set of real-valued taps to use in the
42  * filtering operation. These taps can be defined as anything that
43  * satisfies the user's filtering needs. For standard filters such
44  * as lowpass, highpass, bandpass, etc., the filter.firdes and
45  * filter.optfir classes provide convenient generating methods.
46  *
47  * This filter is implemented by using the FFTW package to perform
48  * the required FFTs. An optional argument, nthreads, may be
49  * passed to the constructor (or set using the set_nthreads member
50  * function) to split the FFT among N number of threads. This can
51  * improve performance on very large FFTs (that is, if the number
52  * of taps used is very large) if you have enough threads/cores to
53  * support it.
54  */
55  class FILTER_API fft_filter_fff : virtual public sync_decimator
56  {
57  public:
58  // gr::filter::fft_filter_fff::sptr
59  typedef boost::shared_ptr<fft_filter_fff> sptr;
60 
61  /*!
62  * Build an FFT filter block.
63  *
64  * \param decimation >= 1
65  * \param taps float filter taps
66  * \param nthreads number of threads for the FFT to use
67  */
68  static sptr make(int decimation,
69  const std::vector<float> &taps,
70  int nthreads=1);
71 
72  virtual void set_taps(const std::vector<float> &taps) = 0;
73  virtual std::vector<float> taps() const = 0;
74 
75  /*!
76  * \brief Set number of threads to use.
77  */
78  virtual void set_nthreads(int n) = 0;
79 
80  /*!
81  * \brief Get number of threads being used.
82  */
83  virtual int nthreads() const = 0;
84  };
85 
86  } /* namespace filter */
87 } /* namespace gr */
88 
89 #endif /* INCLUDED_FILTER_FFT_FILTER_FFF_H */
boost::shared_ptr< fft_filter_fff > sptr
Definition: fft_filter_fff.h:59
Fast FFT filter with float input, float output and float taps.
Definition: fft_filter_fff.h:55
Include this header to use the message passing features.
Definition: logger.h:695
synchronous N:1 input to output with historyOverride work to provide the signal processing implementa...
Definition: sync_decimator.h:37
static const float taps[NSTEPS+1][NTAPS]
Definition: interpolator_taps.h:9
#define FILTER_API
Definition: gr-filter/include/gnuradio/filter/api.h:30