queso-0.53.0
|
Class for a Fast Fourier Transform (FFT) algorithm. More...
#include <Fft.h>
Public Member Functions | |
template<> | |
void | forward (const std::vector< std::complex< double > > &data, unsigned int fftSize, std::vector< std::complex< double > > &forwardResult) |
template<> | |
void | inverse (const std::vector< std::complex< double > > &data, unsigned int fftSize, std::vector< std::complex< double > > &inverseResult) |
template<> | |
void | forward (const std::vector< double > &data, unsigned int fftSize, std::vector< std::complex< double > > &forwardResult) |
template<> | |
void | inverse (const std::vector< double > &data, unsigned int fftSize, std::vector< std::complex< double > > &inverseResult) |
Constructor/Destructor methods | |
Fft (const BaseEnvironment &env) | |
Default Constructor. More... | |
~Fft () | |
Destructor. More... | |
Mathematical methods | |
void | forward (const std::vector< T > &data, unsigned int fftSize, std::vector< std::complex< double > > &result) |
Calculates the forward Fourier transform (for real data. TODO: complex data). More... | |
void | inverse (const std::vector< T > &data, unsigned int fftSize, std::vector< std::complex< double > > &result) |
Calculates the inverse Fourier transform for real and complex data. More... | |
Private Attributes | |
const BaseEnvironment & | m_env |
Class for a Fast Fourier Transform (FFT) algorithm.
This class implements a Fast Fourier Transform (FFT) algorithm. Fast Fourier Transforms are efficient algorithms for calculating the discrete Fourier transform (DFT),
and its inverse. The DFT usually arises as an approximation to the continuous Fourier transform when functions are sampled at discrete intervals in space or time. The naive evaluation of the discrete Fourier transform is a matrix-vector multiplication . A general matrix-vector multiplication takes operations for data-points. Fast Fourier transform algorithms use a divide-and-conquer strategy to factorize the matrix into smaller sub-matrices, corresponding to the integer factors of the length . If can be factorized into a product of integers then the DFT can be computed in operations. For a radix-2 FFT this gives an operation count of .
QUESO::Fft< T >::Fft | ( | const BaseEnvironment & | env | ) |
Default Constructor.
QUESO::Fft< T >::~Fft | ( | ) |
void QUESO::Fft< std::complex< double > >::forward | ( | const std::vector< std::complex< double > > & | data, |
unsigned int | fftSize, | ||
std::vector< std::complex< double > > & | forwardResult | ||
) |
void QUESO::Fft< double >::forward | ( | const std::vector< double > & | data, |
unsigned int | fftSize, | ||
std::vector< std::complex< double > > & | forwardResult | ||
) |
void QUESO::Fft< T >::forward | ( | const std::vector< T > & | data, |
unsigned int | fftSize, | ||
std::vector< std::complex< double > > & | result | ||
) |
Calculates the forward Fourier transform (for real data. TODO: complex data).
This function uses GSL function 'gsl_fft_real_transform' to compute the FFT of data
, a real array (of time-ordered real data) of length fftSize
, using a mixed radix decimation-in-frequency algorithm. There is no restriction on the length fftSize
. Efficient modules are provided for subtransforms of length 2, 3, 4 and 5. Any remaining factors are computed with a slow, , general- fftSize
module. The caller must supply a wavetable containing trigonometric lookup tables and a workspace work.
The definition of the forward Fourier transform, of size is:
Referenced by QUESO::ScalarSequence< T >::autoCorrViaFft().
void QUESO::Fft< std::complex< double > >::inverse | ( | const std::vector< std::complex< double > > & | data, |
unsigned int | fftSize, | ||
std::vector< std::complex< double > > & | inverseResult | ||
) |
Definition at line 94 of file ComplexFft.C.
void QUESO::Fft< double >::inverse | ( | const std::vector< double > & | data, |
unsigned int | fftSize, | ||
std::vector< std::complex< double > > & | inverseResult | ||
) |
void QUESO::Fft< T >::inverse | ( | const std::vector< T > & | data, |
unsigned int | fftSize, | ||
std::vector< std::complex< double > > & | result | ||
) |
Calculates the inverse Fourier transform for real and complex data.
This function uses GSL function 'gsl_fft_complex_inverse' to compute the FFT of data
, a real array (of time-ordered real data) of length fftSize
, using a mixed radix decimation-in-frequency algorithm. There is no restriction on the length fftSize
. Efficient modules are provided for subtransforms of length 2, 3, 4 and 5. Any remaining factors are computed with a slow, , general- fftSize
module. The caller must supply a wavetable containing trigonometric lookup tables and a workspace work.
The definition of the inverse Fourier transform, of size is:
The factor of makes this a true inverse.
Referenced by QUESO::ScalarSequence< T >::autoCorrViaFft().
|
private |