Chris@226: /* -*- c-basic-offset: 4 indent-tabs-mode: nil -*- vi:set ts=8 sts=4 sw=4: */ Chris@226: Chris@226: /* Chris@226: Sonic Visualiser Chris@226: An audio file viewer and annotation editor. Chris@226: Centre for Digital Music, Queen Mary, University of London. Chris@226: This file copyright 2006 Chris Cannam and QMUL. Chris@226: Chris@226: This program is free software; you can redistribute it and/or Chris@226: modify it under the terms of the GNU General Public License as Chris@226: published by the Free Software Foundation; either version 2 of the Chris@226: License, or (at your option) any later version. See the file Chris@226: COPYING included with this distribution for more information. Chris@226: */ Chris@226: Chris@226: #ifndef _FFT_API_H_ Chris@226: #define _FFT_API_H_ Chris@226: Chris@226: #ifdef HAVE_FFTW3F Chris@226: Chris@226: #include Chris@226: Chris@226: #define fftf_complex fftwf_complex Chris@226: #define fftf_malloc fftwf_malloc Chris@226: #define fftf_free fftwf_free Chris@226: #define fftf_plan fftwf_plan Chris@226: #define fftf_plan_dft_r2c_1d fftwf_plan_dft_r2c_1d Chris@226: #define fftf_plan_dft_c2r_1d fftwf_plan_dft_c2r_1d Chris@226: #define fftf_execute fftwf_execute Chris@226: #define fftf_destroy_plan fftwf_destroy_plan Chris@226: Chris@226: #else Chris@226: Chris@226: // Provide a fallback FFT implementation if FFTW3f is not available. Chris@226: Chris@226: typedef float fftf_complex[2]; Chris@226: #define fftf_malloc malloc Chris@226: #define fftf_free free Chris@226: Chris@226: struct fftf_plan_; Chris@226: typedef fftf_plan_ *fftf_plan; Chris@226: Chris@226: fftf_plan fftf_plan_dft_r2c_1d(int n, float *in, fftf_complex *out, unsigned); Chris@226: fftf_plan fftf_plan_dft_c2r_1d(int n, fftf_complex *in, float *out, unsigned); Chris@226: void fftf_execute(const fftf_plan p); Chris@226: void fftf_destroy_plan(fftf_plan p); Chris@226: Chris@226: #define FFTW_ESTIMATE 0 Chris@293: #define FFTW_MEASURE 0 Chris@226: Chris@226: #endif Chris@226: Chris@226: #endif Chris@226: