OpenWareLaboratory
ShortFastFourierTransform Class Reference

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

Public Member Functions

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

Detailed Description

This class performs direct and inverse ShortFast Fourier Transform.

Note that on ARM, this links in static coefficients for all supported FFT sizes!

Definition at line 17 of file ShortFastFourierTransform.h.

Constructor & Destructor Documentation

◆ ShortFastFourierTransform() [1/2]

ShortFastFourierTransform::ShortFastFourierTransform ( )

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 ShortFastFourierTransform.cpp.

◆ ShortFastFourierTransform() [2/2]

ShortFastFourierTransform::ShortFastFourierTransform ( 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 ShortFastFourierTransform.cpp.

References init().

◆ ~ShortFastFourierTransform()

ShortFastFourierTransform::~ShortFastFourierTransform ( )

Definition at line 47 of file ShortFastFourierTransform.cpp.

References ASSERT, and ComplexShortArray::destroy().

Member Function Documentation

◆ fft()

void ShortFastFourierTransform::fft ( ShortArray  input,
ComplexShortArray  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 59 of file ShortFastFourierTransform.cpp.

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

◆ getSize()

size_t ShortFastFourierTransform::getSize ( )

Get the size of the FFT.

Returns
The size of the FFT

Definition at line 79 of file ShortFastFourierTransform.cpp.

References SimpleArray< T >::getSize().

Referenced by fft(), ifft(), and init().

◆ ifft()

void ShortFastFourierTransform::ifft ( ComplexShortArray  input,
ShortArray  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 69 of file ShortFastFourierTransform.cpp.

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

◆ init()

void ShortFastFourierTransform::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 52 of file ShortFastFourierTransform.cpp.

References ASSERT, ComplexShortArray::create(), and getSize().

Referenced by ShortFastFourierTransform().


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