2 * Copyright (C) 2008 Sampo Savolainen <v2@iki.fi>
4 * This program is free software; you can redistribute it and/or modify
5 * it under the terms of the GNU General Public License as published by
6 * the Free Software Foundation; either version 2 of the License, or
7 * (at your option) any later version.
9 * This program is distributed in the hope that it will be useful,
10 * but WITHOUT ANY WARRANTY; without even the implied warranty of
11 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12 * GNU General Public License for more details.
14 * You should have received a copy of the GNU General Public License along
15 * with this program; if not, write to the Free Software Foundation, Inc.,
16 * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
19 #ifndef __ardour_fft_h__
20 #define __ardour_fft_h__
26 #include <sys/types.h>
27 #include <complex> // this needs to be included before fftw3.h
31 #include "ardour/types.h"
47 void analyze (ARDOUR::Sample*, WindowingType w = NONE);
50 uint32_t bins () const { return _data_size; }
52 float power_at_bin (uint32_t i) const { return _power_at_bin[i]; }
53 float phase_at_bin (uint32_t i) const { return _phase_at_bin[i]; }
56 float* get_hann_window ();
58 uint32_t const _window_size;
59 uint32_t const _data_size;