2 Copyright (C) 2003-2009 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 object
36 This object computes forward and backward FFTs, using the complex type to
37 store the results. The phase vocoder or aubio_mfft_t objects should be
38 preferred to using directly aubio_fft_t. The FFT are computed using FFTW3
39 (although support for another library could be added).
42 typedef struct _aubio_fft_t aubio_fft_t;
44 /** create new FFT computation object
46 \param size length of the FFT
49 aubio_fft_t * new_aubio_fft (uint_t size);
52 \param s fft object as returned by new_aubio_fft
55 void del_aubio_fft(aubio_fft_t * s);
57 /** compute forward FFT
59 \param s fft object as returned by new_aubio_fft
60 \param input input signal
61 \param spectrum output spectrum
64 void aubio_fft_do (aubio_fft_t *s, fvec_t * input, cvec_t * spectrum);
65 /** compute backward (inverse) FFT
67 \param s fft object as returned by new_aubio_fft
68 \param spectrum input spectrum
69 \param output output signal
72 void aubio_fft_rdo (aubio_fft_t *s, cvec_t * spectrum, fvec_t * output);
74 /** compute forward FFT
76 \param s fft object as returned by new_aubio_fft
77 \param input real input signal
78 \param compspec complex output fft real/imag
81 void aubio_fft_do_complex (aubio_fft_t *s, fvec_t * input, fvec_t * compspec);
82 /** compute backward (inverse) FFT from real/imag
84 \param s fft object as returned by new_aubio_fft
85 \param compspec real/imag input fft array
86 \param output real output array
89 void aubio_fft_rdo_complex (aubio_fft_t *s, fvec_t * compspec, fvec_t * output);
91 /** convert real/imag spectrum to norm/phas spectrum
93 \param compspec real/imag input fft array
94 \param spectrum cvec norm/phas output array
97 void aubio_fft_get_spectrum(fvec_t * compspec, cvec_t * spectrum);
98 /** convert real/imag spectrum to norm/phas spectrum
100 \param compspec real/imag input fft array
101 \param spectrum cvec norm/phas output array
104 void aubio_fft_get_realimag(cvec_t * spectrum, fvec_t * compspec);
106 /** compute phas spectrum from real/imag parts
108 \param compspec real/imag input fft array
109 \param spectrum cvec norm/phas output array
112 void aubio_fft_get_phas(fvec_t * compspec, cvec_t * spectrum);
113 /** compute imaginary part from the norm/phas cvec
115 \param spectrum norm/phas input array
116 \param compspec real/imag output fft array
119 void aubio_fft_get_imag(cvec_t * spectrum, fvec_t * compspec);
121 /** compute norm component from real/imag parts
123 \param compspec real/imag input fft array
124 \param spectrum cvec norm/phas output array
127 void aubio_fft_get_norm(fvec_t * compspec, cvec_t * spectrum);
128 /** compute real part from norm/phas components
130 \param spectrum norm/phas input array
131 \param compspec real/imag output fft array
134 void aubio_fft_get_real(cvec_t * spectrum, fvec_t * compspec);