#include #include #include #ifndef SINGLE #include #else #include #endif /* FFTW_MEASURE: find the optimal plan by actually computing several FFTs FFTW_ESTIMATE: do not run any FFT and provide a "reasonable" plan FFTW_OUT_OF_PLACE: a plan assumes that the in and out are distinct FFTW_IN_PLACE: a plan assumes that the in and out are same */ int main(int argc, char *argv[]) { int N=0,i,j; fftw_complex *in,*out; fftw_plan fwd_plan, bck_plan; double err=0.0; if(argc>1) { N = atoi(argv[1]); } else { printf("usage: %s N\n\t N = length of vector\n",argv[0]); } if(N<1) { printf("\tN = %d ... exiting\n",N); exit(1); } in = (fftw_complex *)malloc(N*sizeof(fftw_complex)); out = (fftw_complex *)malloc(N*sizeof(fftw_complex)); for (i=0; i 0.0) printf("ERROR:: N=%d index=%d err=%.3e \n", N,i,err); } fftw_destroy_plan(fwd_plan); fftw_destroy_plan(bck_plan); return 0; }