Giter Club home page Giter Club logo

ofxfft's Introduction

ofxFft

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.

Installation & Usage

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.

Using FFTW

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:

    • Select the Project -> Build Settings -> Other C++ Flags
    • add the following:
    -DOFX_FFT_USE_FFTW
    
  • Linux (Makefiles & Codeblocks):

    • edit config.make in your project folder and add the following to the USER_CFLAGS line:
    -DOFX_FFT_USE_FFTW
    
  • Codeblocks (Win):

    • right-click on your project in the project tree
    • select "Build options..."
    • make sure the project name is selected in the tree (not release or debug)
    • select the "Compiler settings" tab and add the following to the "#defines" tab:
    OFX_FFT_USE_FFTW
    
  • Visual Studio:

    • right click on the project in the project tree and select Properties
    • set the Configuration to All Configurations
    • add the defines and search paths:
    • add the following to Configuration Properties->C/C++->Preprocessor->Preprocessor Definitions:
    OFX_FFT_USE_FFTW
    
  1. If you're using FFTW on Windows, you'll also need to add:
  `of/addons/ofxFft/libs/fftw/include`
  

And link with:

  `of/addons/ofxFft/libs/fftw/lib/win32/libfftw3f-3.dll`
  

Using FFTW in the examples

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 compilation notes

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.

ofxfft's People

Contributors

cibomahto avatar danomatika avatar fx-lange avatar kylemcdonald avatar laserpilot avatar stephanschulz avatar xiaowp avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.