Wrap and optimize FFTW. More...
#include <FFT.h>
Public Member Functions | |
bool | Backward (double *aRe_f) |
FFT-backwards a frequency-domain real data vector. | |
bool | Backward (double *aRe_f, double *aIm_f) |
FFT-backwards a frequency-domain complex data vector. | |
void | Backward (void) |
FFT-backwards. | |
bool | Forward (double *aRe_t) |
FFT-forwards a time-domain real data vector. | |
bool | Forward (double *aRe_t, double *aIm_t) |
FFT-forwards a time-domain complex data vector. | |
void | Forward (void) |
FFT-forwards. | |
double * | GetIm_f (const double aNorm=1.0) |
Returns the imaginary part of the frequency-domain data vector. | |
double | GetIm_f (const int aIndex) |
Returns the imaginary part of a frequency-domain data vector element. | |
double * | GetIm_t (const double aNorm=1.0) |
Returns the imaginary part of the time-domain data vector. | |
double | GetIm_t (const int aIndex) |
Returns the imaginary part of a time-domain data vector element. | |
double * | GetNorm2_f (const double aNorm=1.0) |
Returns the squared norm of the frequency-domain data vector. | |
double | GetNorm2_f (const int aIndex) |
Returns the squared norm of a frequency-domain data vector element. | |
double * | GetNorm2_t (const double aNorm=1.0) |
Returns the squared norm of the time-domain data vector. | |
double | GetNorm2_t (const int aIndex) |
Returns the squared norm of a time-domain data vector element. | |
double * | GetNorm_f (const double aNorm=1.0) |
Returns the norm of the frequency-domain data vector. | |
double | GetNorm_f (const int aIndex) |
Returns the norm of a frequency-domain data vector element. | |
double * | GetNorm_t (const double aNorm=1.0) |
Returns the norm of the time-domain data vector. | |
double | GetNorm_t (const int aIndex) |
Returns the norm of a time-domain data vector element. | |
double * | GetPhase_f (void) |
Returns the phase of the frequency-domain data vector. | |
double | GetPhase_f (const int aIndex) |
Returns the phase of a frequency-domain data vector element. | |
double * | GetPhase_t (void) |
Returns the phase of the time-domain data vector. | |
double | GetPhase_t (const int aIndex) |
Returns the phase of a time-domain data vector element. | |
double * | GetRe_f (const double aNorm=1.0) |
Returns the real part of the frequency-domain data vector. | |
double | GetRe_f (const int aIndex) |
Returns the real part of a frequency-domain data vector element. | |
double * | GetRe_t (const double aNorm=1.0) |
Returns the real part of the time-domain data vector. | |
double | GetRe_t (const int aIndex) |
Returns the real part of a time-domain data vector element. | |
int | GetSize_f (void) |
Returns the size of the frequency-domain vector. | |
int | GetSize_t (void) |
Returns the size of the time-domain vector. | |
void | SetIm_f (const int aIndex, const double aValue) |
Sets a frequency-domain vector element (imaginary part) to a given value. | |
void | SetIm_t (const int aIndex, const double aValue) |
Sets a time-domain vector element (imaginary part) to a given value. | |
void | SetRe_f (const int aIndex, const double aValue) |
Sets a frequency-domain vector element (real part) to a given value. | |
void | SetRe_t (const int aIndex, const double aValue) |
Sets a time-domain vector element (real part) to a given value. | |
Constructors and destructors | |
fft (const int aSize_t, const string aPlan="FFTW_ESTIMATE", const string aType="c2c") | |
Constructor of the fft class. | |
virtual | ~fft (void) |
Destructor of the fft class. |
Wrap and optimize FFTW.
See FFTW.
fft::fft | ( | const int | aSize_t, | |
const string | aPlan = "FFTW_ESTIMATE" , |
|||
const string | aType = "c2c" | |||
) |
Constructor of the fft class.
A FFT plan is contructed for a given time-domain input size. The input size must be an even number or else it will be forced as such.
A FFT type must be provided. The default "c2c" type provides a complex to complex FFT. In this case, the time-domain and the frequency domain vectors are both complex and have the same size. If a "r2c" type is selected, the time-domain vector is purely real. The frequency-domain vector is complex and its size is "aSize_t/2+1".
IMPORTANT: when using the "r2c" type, the backward transform will alter the frequency-domain vector. Do not use it after the transform.
Several plans are supported: "FFTW_ESTIMATE", "FFTW_MEASURE" and "FFTW_PATIENT".
aSize_t | time-domain vector size: must be even | |
aPlan | FFT plan | |
aType | FFT type "r2c" or "c2c" |
fft::~fft | ( | void | ) | [virtual] |
Destructor of the fft class.
bool fft::Backward | ( | double * | aRe_f | ) |
FFT-backwards a frequency-domain real data vector.
The input data vector is copied before being transformed. It must verify the size defined in the constructor.
aRe_f | frequency-domain real data vector |
bool fft::Backward | ( | double * | aRe_f, | |
double * | aIm_f | |||
) |
FFT-backwards a frequency-domain complex data vector.
The input data vector is defined by 2 arrays for the real and imaginary parts. The input data vector is copied before being transformed. It must verify the size defined in the constructor.
aRe_f | frequency-domain data vector (real part) | |
aIm_f | frequency-domain data vector (imaginary part) |
void fft::Backward | ( | void | ) | [inline] |
FFT-backwards.
bool fft::Forward | ( | double * | aRe_t | ) |
FFT-forwards a time-domain real data vector.
The input data vector is copied before being transformed. It must verify the size defined in the constructor.
aRe_t | time-domain real data vector |
bool fft::Forward | ( | double * | aRe_t, | |
double * | aIm_t | |||
) |
FFT-forwards a time-domain complex data vector.
The input data vector is defined by 2 arrays for the real and imaginary parts. The input data vector is copied before being transformed. It must verify the size defined in the constructor. This function can only be called in a "c2c" mode.
aRe_t | time-domain data vector (real part) | |
aIm_t | time-domain data vector (imaginary part) |
void fft::Forward | ( | void | ) | [inline] |
FFT-forwards.
double * fft::GetIm_f | ( | const double | aNorm = 1.0 |
) |
Returns the imaginary part of the frequency-domain data vector.
The user is in charge of deleting the returned array.
aNorm | the returned vector is normalized by this parameter |
double fft::GetIm_f | ( | const int | aIndex | ) | [inline] |
Returns the imaginary part of a frequency-domain data vector element.
aIndex | vector index |
double * fft::GetIm_t | ( | const double | aNorm = 1.0 |
) |
Returns the imaginary part of the time-domain data vector.
The user is in charge of deleting the returned array.
aNorm | the returned vector is normalized by this parameter |
double fft::GetIm_t | ( | const int | aIndex | ) | [inline] |
Returns the imaginary part of a time-domain data vector element.
aIndex | vector index |
double * fft::GetNorm2_f | ( | const double | aNorm = 1.0 |
) |
Returns the squared norm of the frequency-domain data vector.
The user is in charge of deleting the returned array.
aNorm | the returned vector is normalized by this parameter |
double fft::GetNorm2_f | ( | const int | aIndex | ) | [inline] |
Returns the squared norm of a frequency-domain data vector element.
aIndex | vector index |
double * fft::GetNorm2_t | ( | const double | aNorm = 1.0 |
) |
Returns the squared norm of the time-domain data vector.
The user is in charge of deleting the returned array.
aNorm | the returned vector is normalized by this parameter |
double fft::GetNorm2_t | ( | const int | aIndex | ) | [inline] |
Returns the squared norm of a time-domain data vector element.
aIndex | vector index |
double * fft::GetNorm_f | ( | const double | aNorm = 1.0 |
) |
Returns the norm of the frequency-domain data vector.
The user is in charge of deleting the returned array.
aNorm | the returned vector is normalized by this parameter |
double fft::GetNorm_f | ( | const int | aIndex | ) | [inline] |
Returns the norm of a frequency-domain data vector element.
aIndex | vector index |
double * fft::GetNorm_t | ( | const double | aNorm = 1.0 |
) |
Returns the norm of the time-domain data vector.
The user is in charge of deleting the returned array.
aNorm | the returned vector is normalized by this parameter |
double fft::GetNorm_t | ( | const int | aIndex | ) | [inline] |
Returns the norm of a time-domain data vector element.
For r2c, prefer the use of GetRe_t() (faster).
aIndex | vector index |
double * fft::GetPhase_f | ( | void | ) |
Returns the phase of the frequency-domain data vector.
The user is in charge of deleting the returned array.
double fft::GetPhase_f | ( | const int | aIndex | ) | [inline] |
Returns the phase of a frequency-domain data vector element.
aIndex | vector index |
double * fft::GetPhase_t | ( | void | ) |
Returns the phase of the time-domain data vector.
The user is in charge of deleting the returned array.
double fft::GetPhase_t | ( | const int | aIndex | ) | [inline] |
Returns the phase of a time-domain data vector element.
aIndex | vector index |
double * fft::GetRe_f | ( | const double | aNorm = 1.0 |
) |
Returns the real part of the frequency-domain data vector.
The user is in charge of deleting the returned array.
aNorm | the returned vector is normalized by this parameter |
double fft::GetRe_f | ( | const int | aIndex | ) | [inline] |
Returns the real part of a frequency-domain data vector element.
aIndex | vector index |
double * fft::GetRe_t | ( | const double | aNorm = 1.0 |
) |
Returns the real part of the time-domain data vector.
The user is in charge of deleting the returned array.
aNorm | the returned vector is normalized by this parameter |
double fft::GetRe_t | ( | const int | aIndex | ) | [inline] |
Returns the real part of a time-domain data vector element.
aIndex | vector index |
int fft::GetSize_f | ( | void | ) | [inline] |
Returns the size of the frequency-domain vector.
int fft::GetSize_t | ( | void | ) | [inline] |
Returns the size of the time-domain vector.
void fft::SetIm_f | ( | const int | aIndex, | |
const double | aValue | |||
) | [inline] |
Sets a frequency-domain vector element (imaginary part) to a given value.
aIndex | vector index | |
aValue | new value |
void fft::SetIm_t | ( | const int | aIndex, | |
const double | aValue | |||
) | [inline] |
Sets a time-domain vector element (imaginary part) to a given value.
aIndex | vector index | |
aValue | new value |
void fft::SetRe_f | ( | const int | aIndex, | |
const double | aValue | |||
) | [inline] |
Sets a frequency-domain vector element (real part) to a given value.
aIndex | vector index | |
aValue | new value |
void fft::SetRe_t | ( | const int | aIndex, | |
const double | aValue | |||
) | [inline] |
Sets a time-domain vector element (real part) to a given value.
aIndex | vector index | |
aValue | new value |