ASPiK SDK
Loading...
Searching...
No Matches
FastFFT Class Reference

The FastFFT provides a simple wrapper for the FFTW FFT operation - it is ultra-thin and simple to use. More...

#include <fxobjects.h>

Public Member Functions

void initialize (unsigned int _frameLength, windowType _window)
 initialize the Fast FFT object for operation
 
void destroyFFTW ()
 destroys the FFTW arrays and plans.
 
fftw_complex * doFFT (double *inputReal, double *inputImag=nullptr)
 perform the FFT operation
 
fftw_complex * doInverseFFT (double *inputReal, double *inputImag)
 perform the IFFT operation
 
unsigned int getFrameLength ()
 

Protected Attributes

fftw_complex * fft_input = nullptr
 array for FFT input
 
fftw_complex * fft_result = nullptr
 array for FFT output
 
fftw_complex * ifft_input = nullptr
 array for IFFT input
 
fftw_complex * ifft_result = nullptr
 array for IFFT output
 
fftw_plan plan_forward = nullptr
 FFTW plan for FFT.
 
fftw_plan plan_backward = nullptr
 FFTW plan for IFFT.
 
double * windowBuffer = nullptr
 buffer for window (naked)
 
double windowGainCorrection = 1.0
 window gain correction
 
windowType window = windowType::kHannWindow
 window type
 
unsigned int frameLength = 0
 current FFT length
 

Detailed Description

The FastFFT provides a simple wrapper for the FFTW FFT operation - it is ultra-thin and simple to use.

Audio I/O:

  • processes mono inputs into FFT outputs.

Control I/F:

  • none.
Author
Will Pirkle http://www.willpirkle.com
Remarks
This object is included in Designing Audio Effects Plugins in C++ 2nd Ed. by Will Pirkle
Version
Revision : 1.0
Date
Date : 2018 / 09 / 7

Member Function Documentation

◆ destroyFFTW()

void FastFFT::destroyFFTW ( )

destroys the FFTW arrays and plans.

destroy FFTW objects and plans

◆ doFFT()

fftw_complex * FastFFT::doFFT ( double *  inputReal,
double *  inputImag = nullptr 
)

perform the FFT operation

do the FFT and return real and imaginary arrays

  • NOTES:
Parameters
inputRealan array of real valued points
inputImagan array of imaginary valued points (will be 0 for audio which is real-valued)
Returns
a pointer to a fftw_complex array: a 2D array of real (column 0) and imaginary (column 1) parts

◆ doInverseFFT()

fftw_complex * FastFFT::doInverseFFT ( double *  inputReal,
double *  inputImag 
)

perform the IFFT operation

do the IFFT and return real and imaginary arrays

  • NOTES:
Parameters
inputRealan array of real valued points
inputImagan array of imaginary valued points (will be 0 for audio which is real-valued)
Returns
a pointer to a fftw_complex array: a 2D array of real (column 0) and imaginary (column 1) parts

◆ getFrameLength()

unsigned int FastFFT::getFrameLength ( )
inline

get the current FFT length

◆ initialize()

void FastFFT::initialize ( unsigned int  _frameLength,
windowType  _window 
)

initialize the Fast FFT object for operation

setup the FFT for a given framelength and window type

  • NOTES:
    See notes on symmetrical window arrays in comments.
Parameters
_frameLengththe FFT length - MUST be a power of 2
_windowthe window type (note: may be set to windowType::kNone)

The documentation for this class was generated from the following files: