2 Copyright (C) 2003-2013 Paul Brossier <piem@aubio.org>
4 This file is part of aubio.
6 aubio is free software: you can redistribute it and/or modify
7 it under the terms of the GNU General Public License as published by
8 the Free Software Foundation, either version 3 of the License, or
9 (at your option) any later version.
11 aubio is distributed in the hope that it will be useful,
12 but WITHOUT ANY WARRANTY; without even the implied warranty of
13 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14 GNU General Public License for more details.
16 You should have received a copy of the GNU General Public License
17 along with aubio. If not, see <http://www.gnu.org/licenses/>.
23 Fast Fourier Transform
25 Depending on how aubio was compiled, FFT are computed using one of:
26 - [Ooura](http://www.kurims.kyoto-u.ac.jp/~ooura/fft.html)
27 - [FFTW3](http://www.fftw.org)
28 - [vDSP](https://developer.apple.com/library/mac/#documentation/Accelerate/Reference/vDSPRef/Reference/reference.html)
30 \example spectral/test-fft.c
43 This object computes forward and backward FFTs.
46 typedef struct _aubio_fft_t aubio_fft_t;
48 /** create new FFT computation object
50 \param size length of the FFT
53 aubio_fft_t * new_aubio_fft (uint_t size);
56 \param s fft object as returned by new_aubio_fft
59 void del_aubio_fft(aubio_fft_t * s);
61 /** compute forward FFT
63 \param s fft object as returned by new_aubio_fft
64 \param input input signal
65 \param spectrum output spectrum
68 void aubio_fft_do (aubio_fft_t *s, const fvec_t * input, cvec_t * spectrum);
69 /** compute backward (inverse) FFT
71 \param s fft object as returned by new_aubio_fft
72 \param spectrum input spectrum
73 \param output output signal
76 void aubio_fft_rdo (aubio_fft_t *s, const cvec_t * spectrum, fvec_t * output);
78 /** compute forward FFT
80 \param s fft object as returned by new_aubio_fft
81 \param input real input signal
82 \param compspec complex output fft real/imag
85 void aubio_fft_do_complex (aubio_fft_t *s, const fvec_t * input, fvec_t * compspec);
86 /** compute backward (inverse) FFT from real/imag
88 \param s fft object as returned by new_aubio_fft
89 \param compspec real/imag input fft array
90 \param output real output array
93 void aubio_fft_rdo_complex (aubio_fft_t *s, const fvec_t * compspec, fvec_t * output);
95 /** convert real/imag spectrum to norm/phas spectrum
97 \param compspec real/imag input fft array
98 \param spectrum cvec norm/phas output array
101 void aubio_fft_get_spectrum(aubio_fft_t *s, const fvec_t * compspec, cvec_t * spectrum);
102 /** convert real/imag spectrum to norm/phas spectrum
104 \param compspec real/imag input fft array
105 \param spectrum cvec norm/phas output array
108 void aubio_fft_get_realimag(aubio_fft_t *s, const cvec_t * spectrum, fvec_t * compspec);
110 /** compute phas spectrum from real/imag parts
112 \param compspec real/imag input fft array
113 \param spectrum cvec norm/phas output array
116 void aubio_fft_get_phas(aubio_fft_t *s, const fvec_t * compspec, cvec_t * spectrum);
117 /** compute imaginary part from the norm/phas cvec
119 \param spectrum norm/phas input array
120 \param compspec real/imag output fft array
123 void aubio_fft_get_imag(aubio_fft_t *s, const cvec_t * spectrum, fvec_t * compspec);
125 /** compute norm component from real/imag parts
127 \param compspec real/imag input fft array
128 \param spectrum cvec norm/phas output array
131 void aubio_fft_get_norm(aubio_fft_t *s, const fvec_t * compspec, cvec_t * spectrum);
132 /** compute real part from norm/phas components
134 \param spectrum norm/phas input array
135 \param compspec real/imag output fft array
138 void aubio_fft_get_real(aubio_fft_t *s, const cvec_t * spectrum, fvec_t * compspec);
144 #endif /* AUBIO_FFT_H */