OpenWareLaboratory
FastFourierTransform Class Reference

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

Public Member Functions

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

Static Public Member Functions

static FastFourierTransformcreate (size_t blocksize)
 
static void destroy (FastFourierTransform *obj)
 

Detailed Description

This class performs direct and inverse Fast Fourier Transform.

Definition at line 14 of file FastFourierTransform.h.

Constructor & Destructor Documentation

◆ FastFourierTransform() [1/2]

FastFourierTransform::FastFourierTransform ( )

Default constructor.

Does not initialize the instance.

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

Definition at line 42 of file FastFourierTransform.cpp.

Referenced by create().

◆ FastFourierTransform() [2/2]

FastFourierTransform::FastFourierTransform ( size_t  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 44 of file FastFourierTransform.cpp.

References init().

◆ ~FastFourierTransform()

FastFourierTransform::~FastFourierTransform ( )

Definition at line 48 of file FastFourierTransform.cpp.

References ComplexFloatArray::destroy().

Member Function Documentation

◆ create()

FastFourierTransform * FastFourierTransform::create ( size_t  blocksize)
static

Definition at line 87 of file FastFourierTransform.cpp.

References FastFourierTransform().

◆ destroy()

void FastFourierTransform::destroy ( FastFourierTransform obj)
static

Definition at line 91 of file FastFourierTransform.cpp.

◆ fft()

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 61 of file FastFourierTransform.cpp.

References ASSERT, SimpleArray< T >::getData(), getSize(), SimpleArray< T >::getSize(), ComplexFloatArray::im(), and ComplexFloatArray::re().

Referenced by FourierPitchDetector::process().

◆ getSize()

size_t FastFourierTransform::getSize ( )

Get the size of the FFT.

Returns
The size of the FFT

Definition at line 81 of file FastFourierTransform.cpp.

References SimpleArray< T >::getSize().

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

◆ ifft()

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 71 of file FastFourierTransform.cpp.

References ASSERT, SimpleArray< T >::getData(), getSize(), SimpleArray< T >::getSize(), and ComplexFloatArray::re().

◆ init()

void FastFourierTransform::init ( size_t  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 54 of file FastFourierTransform.cpp.

References ASSERT, and ComplexFloatArray::create().

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


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