Changeset 2204 for trunk/psLib/src/fft/psVectorFFT.c
- Timestamp:
- Oct 26, 2004, 2:57:34 PM (22 years ago)
- File:
-
- 1 edited
-
trunk/psLib/src/fft/psVectorFFT.c (modified) (18 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/psLib/src/fft/psVectorFFT.c
r2080 r2204 5 5 * @author Robert DeSonia, MHPCC 6 6 * 7 * @version $Revision: 1.2 6$ $Name: not supported by cvs2svn $8 * @date $Date: 2004-10- 13 20:46:57$7 * @version $Revision: 1.27 $ $Name: not supported by cvs2svn $ 8 * @date $Date: 2004-10-27 00:57:31 $ 9 9 * 10 10 * Copyright 2004 Maui High Performance Computing Center, University of Hawaii … … 27 27 #define P_FFTW_PLAN_RIGOR FFTW_ESTIMATE 28 28 29 static bool p_fftwWisdomImported = false;29 static psBool p_fftwWisdomImported = false; 30 30 31 31 psVector* psVectorFFT(psVector* out, const psVector* in, psFftDirection direction) 32 32 { 33 unsigned intnumElements;33 psU32 numElements; 34 34 psElemType type; 35 35 fftwf_plan plan; … … 85 85 86 86 if ((direction & PS_FFT_REAL_RESULT) != 0) { 87 for ( inti = 0; i < numElements; i++) {87 for (psS32 i = 0; i < numElements; i++) { 88 88 out->data.F32[i] = out->data.C32[i]; 89 89 } … … 98 98 { 99 99 psElemType type; 100 unsigned intnumElements;100 psU32 numElements; 101 101 102 102 if (in == NULL) { … … 127 127 outVec = out->data.F32; 128 128 129 for ( unsigned inti = 0; i < numElements; i++) {129 for (psU32 i = 0; i < numElements; i++) { 130 130 outVec[i] = crealf(inVec[i]); 131 131 } … … 138 138 outVec = out->data.F64; 139 139 140 for ( unsigned inti = 0; i < numElements; i++) {140 for (psU32 i = 0; i < numElements; i++) { 141 141 outVec[i] = creal(inVec[i]); 142 142 } … … 158 158 { 159 159 psElemType type; 160 unsigned intnumElements;160 psU32 numElements; 161 161 162 162 if (in == NULL) { … … 187 187 outVec = out->data.F32; 188 188 189 for ( unsigned inti = 0; i < numElements; i++) {189 for (psU32 i = 0; i < numElements; i++) { 190 190 outVec[i] = cimagf(inVec[i]); 191 191 } … … 198 198 outVec = out->data.F64; 199 199 200 for ( unsigned inti = 0; i < numElements; i++) {200 for (psU32 i = 0; i < numElements; i++) { 201 201 outVec[i] = cimag(inVec[i]); 202 202 } … … 218 218 { 219 219 psElemType type; 220 unsigned intnumElements;220 psU32 numElements; 221 221 222 222 if (real == NULL || imag == NULL) { … … 254 254 outVec = out->data.C32; 255 255 256 for ( unsigned inti = 0; i < numElements; i++) {256 for (psU32 i = 0; i < numElements; i++) { 257 257 outVec[i] = realVec[i] + I * imagVec[i]; 258 258 } … … 266 266 outVec = out->data.C64; 267 267 268 for ( unsigned inti = 0; i < numElements; i++) {268 for (psU32 i = 0; i < numElements; i++) { 269 269 outVec[i] = realVec[i] + I * imagVec[i]; 270 270 } … … 286 286 { 287 287 psElemType type; 288 unsigned intnumElements;288 psU32 numElements; 289 289 290 290 if (in == NULL) { … … 316 316 outVec = out->data.C32; 317 317 318 for ( unsigned inti = 0; i < numElements; i++) {318 for (psU32 i = 0; i < numElements; i++) { 319 319 outVec[i] = crealf(inVec[i]) - I * cimagf(inVec[i]); 320 320 } … … 327 327 outVec = out->data.C64; 328 328 329 for ( unsigned inti = 0; i < numElements; i++) {329 for (psU32 i = 0; i < numElements; i++) { 330 330 outVec[i] = creal(inVec[i]) - I * cimag(inVec[i]); 331 331 } … … 347 347 { 348 348 psElemType type; 349 unsigned intoutNumElements;350 unsigned intinNumElements;351 unsigned intinHalfNumElements;352 unsigned intinNumElementsSquared;349 psU32 outNumElements; 350 psU32 inNumElements; 351 psU32 inHalfNumElements; 352 psU32 inNumElementsSquared; 353 353 354 354 if (in == NULL) { … … 378 378 379 379 // from ADD: P_j = (|C_j|^2+|C_N-j|^2)/N^2, where j = 1,2,...,(N/2-1) 380 for ( unsigned inti = 1; i < inHalfNumElements; i++) {380 for (psU32 i = 1; i < inHalfNumElements; i++) { 381 381 inAbs1 = cabsf(inVec[i]); 382 382 inAbs2 = cabsf(inVec[inNumElements - i]); … … 402 402 403 403 // from ADD: P_j = (|C_j|^2+|C_N-j|^2)/N^2, where j = 1,2,...,(N/2-1) 404 for ( unsigned inti = 1; i < inHalfNumElements; i++) {404 for (psU32 i = 1; i < inHalfNumElements; i++) { 405 405 inAbs1 = cabs(inVec[i]); 406 406 inAbs2 = cabs(inVec[inNumElements - i]);
Note:
See TracChangeset
for help on using the changeset viewer.
