/* * Copyright (c) 2003-2010, Mark Borgerding. All rights reserved. * This file is part of KISS FFT - https://github.com/mborgerding/kissfft * * SPDX-License-Identifier: BSD-3-Clause * See COPYING file for more information. */ #include #include #include #include #include "kiss_fft.h" #include "kiss_fftr.h" #include "kiss_fftnd.h" #include "kiss_fftndr.h" #include "pstats.h" static int getdims(int * dims, char * arg) { char *s; int ndims=0; while ( (s=strtok( arg , ",") ) ) { dims[ndims++] = atoi(s); //printf("%s=%d\n",s,dims[ndims-1]); arg=NULL; } return ndims; } int main(int argc,char ** argv) { int k; int nfft[32]; int ndims = 1; int isinverse=0; int numffts=1000,i; kiss_fft_cpx * buf; kiss_fft_cpx * bufout; int real = 0; nfft[0] = 1024;// default while (1) { int c = getopt (argc, argv, "n:ix:r"); if (c == -1) break; switch (c) { case 'r': real = 1; break; case 'n': ndims = getdims(nfft, optarg ); if (nfft[0] != kiss_fft_next_fast_size(nfft[0]) ) { int ng = kiss_fft_next_fast_size(nfft[0]); fprintf(stderr,"warning: %d might be a better choice for speed than %d\n",ng,nfft[0]); } break; case 'x': numffts = atoi (optarg); break; case 'i': isinverse = 1; break; } } int nbytes = sizeof(kiss_fft_cpx); for (k=0;k