/* A program to time real input fast fourier transform routine */ #include #include #include #include #include "fftlib.h" #include "fftext.h" #if macintosh #include #endif #define NSIZES 3 /* the number of different fft sizes to time */ void main(){ float *a; long fftSize[NSIZES] = {2048, 32768, 524288}; /* size of FFTs, must be powers of 2 */ long fftRepeats[NSIZES] = {2000, 50, 1}; /* number of timing loops */ long isize; long i1; long TheErr; long N; long M; #if macintosh UnsignedWide TheTime1; UnsignedWide TheTime2; double TheTime; #endif printf(" %6d Byte Floats \n", sizeof(a[0])); for (isize = 0; isize < NSIZES; isize++){ N = fftSize[isize]; printf("rffts size = %9d ", N); M = roundtol(LOG2(N)); TheErr = fftInit(M); if(!TheErr){ a = (float *) malloc(N*sizeof(float)); if (a == 0) TheErr = 2; } if(!TheErr){ /* set up a simple test case */ for (i1=0; i1