libsdr  0.1.0
A simple SDR library
fftplan.hh
1 #ifndef __SDR_FFTPLAN_HH__
2 #define __SDR_FFTPLAN_HH__
3 
4 #include "buffer.hh"
5 #include "node.hh"
6 #include "config.hh"
7 
8 namespace sdr {
9 
10 // Forward declaration of FFTPlan
11 template <class Scalar> class FFTPlan { };
12 
14 class FFT {
15 public:
17  typedef enum {
18  FORWARD, BACKWARD
19  } Direction;
20 
22  template <class Scalar>
23  static void exec(const Buffer< std::complex<Scalar> > &in,
24  const Buffer< std::complex<Scalar> > &out, FFT::Direction dir)
25  {
26  FFTPlan<Scalar> plan(in, out, dir); plan();
27  }
28 
30  template <class Scalar>
31  static void exec(const Buffer< std::complex<Scalar> > &inplace, FFT::Direction dir)
32  {
33  FFTPlan<Scalar> plan(inplace, dir); plan();
34  }
35 
36 };
37 
38 }
39 
40 
41 #ifdef SDR_WITH_FFTW
42 #include "fftplan_fftw3.hh"
43 #endif
44 
45 
46 #endif // __SDR_FFTPLAN_HH__
Direction
Direction type.
Definition: fftplan.hh:17
Definition: autocast.hh:8
Trivial FFT implementation for buffer sizes of N=2**K.
Definition: fftplan.hh:11
static void exec(const Buffer< std::complex< Scalar > > &in, const Buffer< std::complex< Scalar > > &out, FFT::Direction dir)
Performs a FFT transform.
Definition: fftplan.hh:23
static void exec(const Buffer< std::complex< Scalar > > &inplace, FFT::Direction dir)
Performs an in-place FFT transform.
Definition: fftplan.hh:31
FFT module class, provides static methods to perfrom a FFT directly.
Definition: fftplan.hh:14
A typed buffer.
Definition: buffer.hh:111