svcore
1.9
|
00001 /* -*- c-basic-offset: 4 indent-tabs-mode: nil -*- vi:set ts=8 sts=4 sw=4: */ 00002 00003 /* 00004 Sonic Visualiser 00005 An audio file viewer and annotation editor. 00006 Centre for Digital Music, Queen Mary, University of London. 00007 This file copyright 2006 Chris Cannam and QMUL. 00008 00009 This program is free software; you can redistribute it and/or 00010 modify it under the terms of the GNU General Public License as 00011 published by the Free Software Foundation; either version 2 of the 00012 License, or (at your option) any later version. See the file 00013 COPYING included with this distribution for more information. 00014 */ 00015 00016 #ifndef _FFT_API_H_ 00017 #define _FFT_API_H_ 00018 00019 #ifdef HAVE_FFTW3F 00020 00021 #include <fftw3.h> 00022 00023 #define fftf_complex fftwf_complex 00024 #define fftf_malloc fftwf_malloc 00025 #define fftf_free fftwf_free 00026 #define fftf_plan fftwf_plan 00027 #define fftf_plan_dft_r2c_1d fftwf_plan_dft_r2c_1d 00028 #define fftf_plan_dft_c2r_1d fftwf_plan_dft_c2r_1d 00029 #define fftf_execute fftwf_execute 00030 #define fftf_destroy_plan fftwf_destroy_plan 00031 00032 #else 00033 00034 // Provide a fallback FFT implementation if FFTW3f is not available. 00035 00036 typedef float fftf_complex[2]; 00037 #define fftf_malloc malloc 00038 #define fftf_free free 00039 00040 struct fftf_plan_; 00041 typedef fftf_plan_ *fftf_plan; 00042 00043 fftf_plan fftf_plan_dft_r2c_1d(int n, float *in, fftf_complex *out, unsigned); 00044 fftf_plan fftf_plan_dft_c2r_1d(int n, fftf_complex *in, float *out, unsigned); 00045 void fftf_execute(const fftf_plan p); 00046 void fftf_destroy_plan(fftf_plan p); 00047 00048 #define FFTW_ESTIMATE 0 00049 #define FFTW_MEASURE 0 00050 00051 #endif 00052 00053 #endif 00054