HOPS
HOPS class reference
MHO_FastFourierTransformCalls.hh
Go to the documentation of this file.
1 #ifndef MHO_FastFourierTransformCalls_HH__
2 #define MHO_FastFourierTransformCalls_HH__
3 
4 #include <algorithm>
5 #include <cmath>
6 #include <complex>
7 #include <cstddef>
8 
12 #include "MHO_Message.hh"
13 
14 namespace hops
15 {
16 
34 template< typename XFloatType >
35 void FFTRadix2(std::complex< XFloatType >* data, MHO_FastFourierTransformWorkspace< XFloatType >& work, bool isForward,
36  unsigned int stride = 1)
37 {
38  //for DFT we conjugate first (NOTE: this matches FFTW3 convention)
39  if(isForward)
40  {
42  }
43 
44  //use radix-2 + bit reversal permutation
45  MHO_BitReversalPermutation::PermuteArray< std::complex< XFloatType > >(work.fN, work.fPermutation, data, stride);
47 
48  //for DFT we conjugate again (NOTE: this matches FFTW3 convention)
49  if(isForward)
50  {
52  }
53 }
54 
64 template< typename XFloatType >
65 void FFTBluestein(std::complex< XFloatType >* data, MHO_FastFourierTransformWorkspace< XFloatType >& work, bool isForward,
66  unsigned int stride = 1)
67 {
68  //for DFT we conjugate first (NOTE: this matches FFTW3 convention)
69  if(isForward)
70  {
72  }
73 
74  //use bluestein algorithm for arbitrary (non-power of 2) N
76  work.fScale, work.fCirculant, work.fWorkspace, stride);
77 
78  //for DFT we conjugate again (NOTE: this matches FFTW3 convention)
79  if(isForward)
80  {
82  }
83 }
84 
85 } // namespace hops
86 
87 #endif
static void FFTRadixTwo_DIT(unsigned int N, XFloatType *data, XFloatType *twiddle, unsigned int stride=1)
Computes a Radix-2 decimation in time (DIT) FFT. input: data array in bit-address permutated order ou...
Definition: MHO_FastFourierTransformUtilities.hh:119
static void FFTBluestein(unsigned int N, unsigned int M, std::complex< XFloatType > *data, std::complex< XFloatType > *twiddle, std::complex< XFloatType > *conj_twiddle, std::complex< XFloatType > *scale, std::complex< XFloatType > *circulant, std::complex< XFloatType > *workspace, unsigned int stride=1)
Function Bluestein algorithm for arbitrary length, N is length of the data, (supports strided data ac...
Definition: MHO_FastFourierTransformUtilities.hh:406
static void Conjugate(unsigned int N, std::complex< XFloatType > *array)
Conjugates each element in a complex array.
Definition: MHO_FastFourierTransformUtilities.hh:35
navtive FFT workspace definitions
Definition: MHO_FastFourierTransformWorkspace.hh:25
std::complex< XFloatType > * fCirculant
Definition: MHO_FastFourierTransformWorkspace.hh:153
std::complex< XFloatType > * fWorkspace
Definition: MHO_FastFourierTransformWorkspace.hh:154
unsigned int fM
Definition: MHO_FastFourierTransformWorkspace.hh:148
std::complex< XFloatType > * fScale
Definition: MHO_FastFourierTransformWorkspace.hh:152
unsigned int fN
Definition: MHO_FastFourierTransformWorkspace.hh:147
unsigned int * fPermutation
Definition: MHO_FastFourierTransformWorkspace.hh:149
std::complex< XFloatType > * fTwiddle
Definition: MHO_FastFourierTransformWorkspace.hh:150
std::complex< XFloatType > * fConjugateTwiddle
Definition: MHO_FastFourierTransformWorkspace.hh:151
Definition: fit_gsl.h:54
Definition: MHO_AdhocFlagging.hh:18
void FFTBluestein(std::complex< XFloatType > *data, MHO_FastFourierTransformWorkspace< XFloatType > &work, bool isForward, unsigned int stride=1)
Performs Bluestein's FFT algorithm on complex data using a workspace for arbitrary N....
Definition: MHO_FastFourierTransformCalls.hh:65
void FFTRadix2(std::complex< XFloatType > *data, MHO_FastFourierTransformWorkspace< XFloatType > &work, bool isForward, unsigned int stride=1)
Performs a Radix-2 Decimation-in-time (DIT) FFT algorithm on complex data using a workspace for arbit...
Definition: MHO_FastFourierTransformCalls.hh:35