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