c@174: #include c@174: #include c@174: #include c@174: #include c@174: #include "kiss_fft.h" c@174: #include "kiss_fftr.h" c@174: #include "kiss_fftnd.h" c@174: #include "kiss_fftndr.h" c@174: c@174: #include "pstats.h" c@174: c@174: static c@174: int getdims(int * dims, char * arg) c@174: { c@174: char *s; c@174: int ndims=0; c@174: while ( (s=strtok( arg , ",") ) ) { c@174: dims[ndims++] = atoi(s); c@174: //printf("%s=%d\n",s,dims[ndims-1]); c@174: arg=NULL; c@174: } c@174: return ndims; c@174: } c@174: c@174: int main(int argc,char ** argv) c@174: { c@174: int k; c@174: int nfft[32]; c@174: int ndims = 1; c@174: int isinverse=0; c@174: int numffts=1000,i; c@174: kiss_fft_cpx * buf; c@174: kiss_fft_cpx * bufout; c@174: int real = 0; c@174: c@174: nfft[0] = 1024;// default c@174: c@174: while (1) { c@174: int c = getopt (argc, argv, "n:ix:r"); c@174: if (c == -1) c@174: break; c@174: switch (c) { c@174: case 'r': c@174: real = 1; c@174: break; c@174: case 'n': c@174: ndims = getdims(nfft, optarg ); c@174: if (nfft[0] != kiss_fft_next_fast_size(nfft[0]) ) { c@174: int ng = kiss_fft_next_fast_size(nfft[0]); c@174: fprintf(stderr,"warning: %d might be a better choice for speed than %d\n",ng,nfft[0]); c@174: } c@174: break; c@174: case 'x': c@174: numffts = atoi (optarg); c@174: break; c@174: case 'i': c@174: isinverse = 1; c@174: break; c@174: } c@174: } c@174: int nbytes = sizeof(kiss_fft_cpx); c@174: for (k=0;k