annotate data/fft/FFTapi.h @ 226:a867be73b638

* Add non-fftw3 fft alternative
author Chris Cannam
date Fri, 09 Feb 2007 11:32:34 +0000
parents
children 7c53640bb9ba
rev   line source
Chris@226 1 /* -*- c-basic-offset: 4 indent-tabs-mode: nil -*- vi:set ts=8 sts=4 sw=4: */
Chris@226 2
Chris@226 3 /*
Chris@226 4 Sonic Visualiser
Chris@226 5 An audio file viewer and annotation editor.
Chris@226 6 Centre for Digital Music, Queen Mary, University of London.
Chris@226 7 This file copyright 2006 Chris Cannam and QMUL.
Chris@226 8
Chris@226 9 This program is free software; you can redistribute it and/or
Chris@226 10 modify it under the terms of the GNU General Public License as
Chris@226 11 published by the Free Software Foundation; either version 2 of the
Chris@226 12 License, or (at your option) any later version. See the file
Chris@226 13 COPYING included with this distribution for more information.
Chris@226 14 */
Chris@226 15
Chris@226 16 #ifndef _FFT_API_H_
Chris@226 17 #define _FFT_API_H_
Chris@226 18
Chris@226 19 #ifdef HAVE_FFTW3F
Chris@226 20
Chris@226 21 #include <fftw3.h>
Chris@226 22
Chris@226 23 #define fftf_complex fftwf_complex
Chris@226 24 #define fftf_malloc fftwf_malloc
Chris@226 25 #define fftf_free fftwf_free
Chris@226 26 #define fftf_plan fftwf_plan
Chris@226 27 #define fftf_plan_dft_r2c_1d fftwf_plan_dft_r2c_1d
Chris@226 28 #define fftf_plan_dft_c2r_1d fftwf_plan_dft_c2r_1d
Chris@226 29 #define fftf_execute fftwf_execute
Chris@226 30 #define fftf_destroy_plan fftwf_destroy_plan
Chris@226 31
Chris@226 32 #else
Chris@226 33
Chris@226 34 // Provide a fallback FFT implementation if FFTW3f is not available.
Chris@226 35
Chris@226 36 typedef float fftf_complex[2];
Chris@226 37 #define fftf_malloc malloc
Chris@226 38 #define fftf_free free
Chris@226 39
Chris@226 40 struct fftf_plan_;
Chris@226 41 typedef fftf_plan_ *fftf_plan;
Chris@226 42
Chris@226 43 fftf_plan fftf_plan_dft_r2c_1d(int n, float *in, fftf_complex *out, unsigned);
Chris@226 44 fftf_plan fftf_plan_dft_c2r_1d(int n, fftf_complex *in, float *out, unsigned);
Chris@226 45 void fftf_execute(const fftf_plan p);
Chris@226 46 void fftf_destroy_plan(fftf_plan p);
Chris@226 47
Chris@226 48 #define FFTW_ESTIMATE 0
Chris@226 49
Chris@226 50 #endif
Chris@226 51
Chris@226 52 #endif
Chris@226 53