FFT addon for openFrameworks that wrapps FFTW and KissFFT.
ofxFft is a Fast-Fourier Transform addon for openFrameworks
ofxFft wraps two libraries with the same interface: FFTW and KISS FFT. KISS FFT is included with OF, MIT licensed, and enabled by default. FFTW is GPL and must be manually enabled using the OFX_FFT_USE_FFTW
compiler define.
To install ofxFft, move the ofxFft folder to your of/addons/
folder.
Search paths required when using ofxFFt:
of/addons/ofxFft/src
of/addons/ofxFft/libs/kiss
Basic usage is demonstrated by example-eq and example-basic.
With OF version 0.9.0, the OF Project Generator will add the compiler search paths for the project automatically if configured to include ofxFft.
Project files for the examples are not included so you will need to generate the project files for your operating system and development environment using the OF ProjectGenerator which is included with the OpenFrameworks distribution.
Point the ProjectGenerator to addons/ofxFft
, change the project name to the exact name of the example you want to generate (ie example-basic
), and make sure to choose ofxFft
from the addons. Hitting "Generate" will populate that example with the project files you will need to build it.
To use ofxFft with FFTW instead of KISS FFT, make sure you download the precompiled libraries.
Next, you'll need to add OFX_FFT_USE_FFTW
to your compiler flags for each project using ofxFFT:
Xcode:
Linux (Makefiles & Codeblocks):
Codeblocks (Win):
Visual Studio:
And link with:
If you're using FFTW with the example projects, in ofApp.cpp, comment the line:
fft = ofxFft::create(bufferSize, OF_FFT_WINDOW_HAMMING);
and uncomment out the line:
//fft = ofxFft::create(bufferSize, OF_FFT_WINDOW_HAMMING, OF_FFT_FFTW);
FFTW was compiled with:
./configure --disable-shared --enable-static --enable-float --enable-threads
make
sudo make install
which puts the static libraries in .libs
Note that the library is compiled in 32-bit mode on both Windows and OS X.