45 fft(
const unsigned int aSize_t,
const string aPlan =
"FFTW_ESTIMATE",
const string aType=
"c2c");
75 bool Forward(
double *aRe_t,
double *aIm_t);
94 bool Backward(
double *aRe_f,
double *aIm_f);
108 return x_f[aIndex][0]*
x_f[aIndex][0] +
x_f[aIndex][1]*
x_f[aIndex][1];
141 inline double GetRe_f(
const unsigned int aIndex){
142 return x_f[aIndex][0];
149 inline double GetRe_t(
const unsigned int aIndex){
158 inline double GetIm_f(
const unsigned int aIndex){
159 return x_f[aIndex][1];
166 inline double GetIm_t(
const unsigned int aIndex){
177 return atan2(
x_f[aIndex][1],
x_f[aIndex][0]);
209 double*
GetNorm_f(
const double aNorm=1.0);
216 double*
GetNorm_t(
const double aNorm=1.0);
223 double*
GetRe_f(
const double aNorm=1.0);
230 double*
GetRe_t(
const double aNorm=1.0);
237 double*
GetIm_f(
const double aNorm=1.0);
244 double*
GetIm_t(
const double aNorm=1.0);
273 inline void SetRe_t(
const unsigned int aIndex,
const double aValue){
275 else xr_t[aIndex]=aValue;
283 inline void SetIm_t(
const unsigned int aIndex,
const double aValue){
284 xc_t[aIndex][1]=aValue;
292 inline void SetRe_f(
const unsigned int aIndex,
const double aValue){
293 x_f[aIndex][0]=aValue;
301 inline void SetIm_f(
const unsigned int aIndex,
const double aValue){
302 x_f[aIndex][1]=aValue;
Generic C utility functions.
Wrap and optimize FFTW.
Definition FFT.h:19
double GetIm_f(const unsigned int aIndex)
Returns the imaginary part of a frequency-domain data vector element.
Definition FFT.h:158
fftw_complex * x_f
Frequency-domain data.
Definition FFT.h:314
fftw_plan FFT_Forward
Forward plan.
Definition FFT.h:315
void SetIm_t(const unsigned int aIndex, const double aValue)
Sets a time-domain vector element (imaginary part) to a given value.
Definition FFT.h:283
double * GetPhase_t(void)
Returns the phase of the time-domain data vector.
Definition FFT.cc:250
void Forward(void)
Performs the forward FFT.
Definition FFT.h:58
fftw_plan FFT_Backward
Backward plan.
Definition FFT.h:316
bool fType
FFT type true=c2c, false=r2c.
Definition FFT.h:310
unsigned int fSize_t
Time-domain vector size.
Definition FFT.h:307
double GetNorm2_f(const unsigned int aIndex)
Returns the squared norm of a frequency-domain data vector element.
Definition FFT.h:107
void SetRe_f(const unsigned int aIndex, const double aValue)
Sets a frequency-domain vector element (real part) to a given value.
Definition FFT.h:292
string fPlan
FFTW plan.
Definition FFT.h:309
double * xr_t
Time-domain data - real.
Definition FFT.h:313
unsigned int GetSize_f(void)
Returns the size of the frequency-domain vector.
Definition FFT.h:266
double GetRe_f(const unsigned int aIndex)
Returns the real part of a frequency-domain data vector element.
Definition FFT.h:141
double GetPhase_t(const unsigned int aIndex)
Returns the phase of a time-domain data vector element.
Definition FFT.h:185
double * GetPhase_f(void)
Returns the phase of the frequency-domain data vector.
Definition FFT.cc:242
void SetIm_f(const unsigned int aIndex, const double aValue)
Sets a frequency-domain vector element (imaginary part) to a given value.
Definition FFT.h:301
virtual ~fft(void)
Destructor of the fft class.
Definition FFT.cc:81
double GetRe_t(const unsigned int aIndex)
Returns the real part of a time-domain data vector element.
Definition FFT.h:149
double GetPhase_f(const unsigned int aIndex)
Returns the phase of a frequency-domain data vector element.
Definition FFT.h:176
double GetIm_t(const unsigned int aIndex)
Returns the imaginary part of a time-domain data vector element.
Definition FFT.h:166
void SetRe_t(const unsigned int aIndex, const double aValue)
Sets a time-domain vector element (real part) to a given value.
Definition FFT.h:273
double GetNorm2_t(const unsigned int aIndex)
Returns the squared norm of a time-domain data vector element.
Definition FFT.h:115
fftw_complex * xc_t
Time-domain data - complex.
Definition FFT.h:312
unsigned int GetSize_t(void)
Returns the size of the time-domain vector.
Definition FFT.h:261
unsigned int fSize_f
Frequency-domain vector size.
Definition FFT.h:308
double GetNorm_t(const unsigned int aIndex)
Returns the norm of a time-domain data vector element.
Definition FFT.h:133
double GetNorm_f(const unsigned int aIndex)
Returns the norm of a frequency-domain data vector element.
Definition FFT.h:124
void Backward(void)
Performs the backward FFT.
Definition FFT.h:63