/* * 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 "pstats.h" #ifdef DATATYPEdouble #define CPXTYPE fftw_complex #define PLAN fftw_plan #define FFTMALLOC fftw_malloc #define MAKEPLAN fftw_plan_dft_1d #define DOFFT fftw_execute #define DESTROYPLAN fftw_destroy_plan #define FFTFREE fftw_free #elif defined(DATATYPEfloat) #define CPXTYPE fftwf_complex #define PLAN fftwf_plan #define FFTMALLOC fftwf_malloc #define MAKEPLAN fftwf_plan_dft_1d #define DOFFT fftwf_execute #define DESTROYPLAN fftwf_destroy_plan #define FFTFREE fftwf_free #endif #ifndef CPXTYPE int main(void) { fprintf(stderr,"Datatype not available in FFTW\n" ); return 0; } #else int main(int argc,char ** argv) { int nfft=1024; int isinverse=0; int numffts=1000,i; CPXTYPE * in=NULL; CPXTYPE * out=NULL; PLAN p; pstats_init(); while (1) { int c = getopt (argc, argv, "n:ix:h"); if (c == -1) break; switch (c) { case 'n': nfft = atoi (optarg); break; case 'x': numffts = atoi (optarg); break; case 'i': isinverse = 1; break; case 'h': case '?': default: fprintf(stderr,"options:\n-n N: complex fft length\n-i: inverse\n-x N: number of ffts to compute\n" ""); } } in=FFTMALLOC(sizeof(CPXTYPE) * nfft); out=FFTMALLOC(sizeof(CPXTYPE) * nfft); for (i=0;i