GNU Radio 3.6.3 C++ API
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 <filter/api.h>
27 #include <gr_sync_decimator.h>
28 
29 namespace gr {
30  namespace filter {
31 
33  {
34  public:
35  // gr::filter::fft_filter_fff::sptr
37 
38  /*!
39  * \brief Fast FFT filter with float input, float output and float taps
40  * \ingroup filter_blk
41  *
42  * This block implements a real-value decimating filter using
43  * the fast convolution method via an FFT. The decimation factor
44  * is an interger that is greater than or equal to 1.
45  *
46  * The filter takes a set of real-valued taps to use in
47  * the filtering operation. These taps can be defined as
48  * anything that satisfies the user's filtering needs. For
49  * standard filters such as lowpass, highpass, bandpass, etc.,
50  * the filter.firdes and filter.optfir classes provide
51  * convenient generating methods.
52  *
53  * This filter is implemented by using the FFTW package to
54  * perform the required FFTs. An optional argument, nthreads,
55  * may be passed to the constructor (or set using the
56  * set_nthreads member function) to split the FFT among N number
57  * of threads. This can improve performance on very large FFTs
58  * (that is, if the number of taps used is very large) if you
59  * have enough threads/cores to support it.
60  *
61  * \param decimation >= 1
62  * \param taps float filter taps
63  * \param nthreads number of threads for the FFT to use
64  */
65  static sptr make(int decimation,
66  const std::vector<float> &taps,
67  int nthreads=1);
68 
69  virtual void set_taps(const std::vector<float> &taps) = 0;
70  virtual std::vector<float> taps() const = 0;
71 
72  /*!
73  * \brief Set number of threads to use.
74  */
75  virtual void set_nthreads(int n) = 0;
76 
77  /*!
78  * \brief Get number of threads being used.
79  */
80  virtual int nthreads() const = 0;
81  };
82 
83  } /* namespace filter */
84 } /* namespace gr */
85 
86 #endif /* INCLUDED_FILTER_FFT_FILTER_FFF_H */