OpenWareLaboratory
FastFourierTransform Class Reference

This class performs direct and inverse Fast Fourier Transform. More...

Public Member Functions

 FastFourierTransform ()
 Default constructor.
 FastFourierTransform (int aSize)
 Construct and initialize the instance.
void fft (FloatArray input, ComplexFloatArray output)
 Perform the direct FFT.
int getSize ()
 Get the size of the FFT.
void ifft (ComplexFloatArray input, FloatArray output)
 Perform the inverse FFT.
void init (int aSize)
 Initialize the instance.
 ~FastFourierTransform ()

Detailed Description

This class performs direct and inverse Fast Fourier Transform.

Definition at line 14 of file FastFourierTransform.h.

Constructor & Destructor Documentation

FastFourierTransform::FastFourierTransform ( )

Default constructor.

Does not initialize the instance.

Remarks
You need to call init(int size) before calling any other method

Definition at line 41 of file FastFourierTransform.cpp.

FastFourierTransform::FastFourierTransform ( int  aSize)

Construct and initialize the instance.

Parameters
[in]aSizeThe size of the FFT
Remarks
Only sizes of 32, 64, 128, 256, 512, 1024, 2048, 4096 are supported, due to limitations of the CMSIS library.
Note
When built for ARM Cortex-M processor series, this method uses the optimized CMSIS library

Definition at line 43 of file FastFourierTransform.cpp.

References init().

FastFourierTransform::~FastFourierTransform ( )

Definition at line 47 of file FastFourierTransform.cpp.

References ComplexFloatArray::destroy().

Member Function Documentation

void FastFourierTransform::fft ( FloatArray  input,
ComplexFloatArray  output 
)

Perform the direct FFT.

Parameters
[in]inputThe real-valued input array
[out]outputThe complex-valued output array
Remarks
Calling this method will mess up the content of the input array.
Note
When built for ARM Cortex-M processor series, this method uses the optimized CMSIS library

Definition at line 58 of file FastFourierTransform.cpp.

References ComplexFloatArray::getData(), FloatArray::getSize(), getSize(), ComplexFloatArray::getSize(), ComplexFloatArray::im(), and ComplexFloatArray::re().

Referenced by FourierPitchDetector::process().

int FastFourierTransform::getSize ( )

Get the size of the FFT.

Returns
The size of the FFT

Definition at line 78 of file FastFourierTransform.cpp.

References ComplexFloatArray::getSize().

Referenced by fft(), FourierPitchDetector::getSize(), ifft(), init(), and FourierPitchDetector::process().

void FastFourierTransform::ifft ( ComplexFloatArray  input,
FloatArray  output 
)

Perform the inverse FFT.

The output is rescaled by 1/fftSize.

Parameters
[in]inputThe complex-valued input array
[out]outputThe real-valued output array
Remarks
Calling this method will mess up the content of the input array.
Note
When built for ARM Cortex-M processor series, this method uses the optimized CMSIS library

Definition at line 68 of file FastFourierTransform.cpp.

References ComplexFloatArray::getData(), FloatArray::getSize(), getSize(), ComplexFloatArray::getSize(), and ComplexFloatArray::re().

void FastFourierTransform::init ( int  aSize)

Initialize the instance.

Parameters
aSizeThe size of the FFT
Note
When built for ARM Cortex-M processor series, this method uses the optimized CMSIS library

Definition at line 51 of file FastFourierTransform.cpp.

References ComplexFloatArray::create(), and getSize().

Referenced by FastFourierTransform(), and FourierPitchDetector::init().


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