00001
00005 #ifndef _das2_dft_h_
00006 #define _das2_dft_h_
00007
00013 typedef struct das2_dft_t{
00014
00015
00016 void* vpPlan;
00017 void* vpIn;
00018 void* vpOut;
00019
00020
00021 size_t uLen;
00022
00023
00024 bool bRealOnly;
00025
00026
00027 char* sWindow;
00028 double* pWnd;
00029
00030
00031 bool bNewMag;
00032 double* pMag;
00033 size_t uMagLen;
00034
00035
00036 bool bNewCmp[2];
00037 double* pCmpOut[2];
00038 size_t uCmpLen[2];
00039
00040 } Das2Dft;
00041
00052 Das2Dft* new_Dft(size_t uLen, const char* sWindow);
00053
00060 void del_Dft(Das2Dft* pThis);
00061
00083 ErrorCode Dft_calculate(
00084 Das2Dft* pThis, const double* pReal, const double* pImg, size_t uLen
00085 );
00086
00093 const double* Dft_getReal(Das2Dft* pThis, size_t* pLen);
00094
00102 const double* Dft_getImg(Das2Dft* pThis, size_t* pLen);
00103
00126 const double* Dft_getMagnitude(Das2Dft* pThis, size_t* pLen);
00127
00133 typedef struct das2_psd_t{
00134
00135
00136 void* vpPlan;
00137 void* vpIn;
00138 void* vpOut;
00139
00140
00141 size_t uLen;
00142 bool bRealOnly;
00143
00144
00145 bool bCenter;
00146
00147
00148 size_t uUpConvLen;
00149 double* pUpConvReal;
00150 double* pUpConvImg;
00151
00152
00153 char* sWindow;
00154 double* pWnd;
00155 double rWndSqSum;
00156
00157
00158 double* pMag;
00159 size_t uMagLen;
00160
00161
00162 double rPwrIn;
00163 double rPwrOut;
00164
00165 } Das2Psd;
00166
00185 Das2Psd* new_Psd(size_t uLen, bool bCenter, const char* sWindow);
00186
00192 void del_Das2Psd(Das2Psd* pThis);
00193
00194
00216 ErrorCode Psd_calculate(
00217 Das2Psd* pThis, const double* pReal, const double* pImg, size_t uLen
00218 );
00219
00225 ErrorCode Psd_calculate_f(
00226 Das2Psd* pThis, const float* pReal, const float* pImg, size_t uLen
00227 );
00228
00281 double Psd_powerRatio(const Das2Psd* pThis, double* pInput, double* pOutput);
00282
00283
00306 const double* Psd_get(const Das2Psd* pThis, size_t* pLen);
00307
00308 #endif