FFTComplex Class Reference

Algorithm to perform a Fast Fourier Transform of a vector of Complex values. More...

`#include <FFTComplex.h>`

List of all members.

Public Member Functions

FFTComplex (int frameSize, int fftSize, bool zeroPhase=true)
~FFTComplex ()
void process (const MatrixXC &frames, MatrixXC *fft)
int fftSize () const
void setFftSize (int size, bool callSetup=true)
int frameSize () const
void setFrameSize (int size, bool callSetup=true)
bool zeroPhase () const
void setZeroPhase (bool zeroPhase, bool callSetup=true)

Detailed Description

Algorithm to perform a Fast Fourier Transform of a vector of Complex values.

This class represents an object to perform Fast Fourier Transforms (FFT) on Real data. The FFT is a fast implementation of a Discrete Fourier Transform (DFT). The algorithm takes as input N point vectors of Real values (N being the frame size) and returns M point vectors of Complex values (M being the FFT size).

Note that the algorithm works fastest when M is a power of 2.

When M is different than N the input data is zero padded at the end. Alternatively the algorithm can perform an N/2 rotation and zero pad the center before the FFT to allow a zero phase transform. This is done by using the setZeroPhase() method.

FFTComplex, IFFT, IFFTComplex

Constructor & Destructor Documentation

 FFTComplex ( int frameSize, int fftSize, bool zeroPhase = `true` )

Constructs an FFT object with the specified fftSize and zeroPhase setting.

Parameters:
 frameSize size of the frame must be > 0, it is the size of the input frames. fftSize size of the FFT transform must be > 0, it is the target size of the transform. The algorithm performs faster for sizes which are a power of 2. zeroPhase determines whether or not to perform the zero phase transform.

References setFftSize(), setFrameSize(), and setZeroPhase().

 ~FFTComplex ( )

Destroys the algorithm and frees its resources.

Member Function Documentation

 void process ( const MatrixXC & frames, MatrixXC * fft )

Performs a Fast Fourier Transform on each of the rows of frames and puts the resulting FFT in the rows of fft.

Parameters:
 frames matrix of Real values. The number of columns of frames must be equal to the frameSize property. fft pointer to a matrix of Complex values for the output. The matrix should have the same number of rows as frames and (fftSize / 2) + 1 columns.
Note that if the output matrix is not of the required size it will be resized, reallocating a new memory space if necessary.

 int fftSize ( ) const

Returns the size of the FFT to be performed. The default is 1024.

setFftSize()

 void setFftSize ( int size, bool callSetup = `true` )

Specifies the size of the FFT to be performed. The given size must be higher than 0. Note that if size is a power of 2 will perform faster.

fftSize()

Referenced by FFTComplex().

 int frameSize ( ) const

Returns the size of the frame to be processed. The default is 1024.

setFrameSize()

 void setFrameSize ( int size, bool callSetup = `true` )

Specifies the size of the frame to be processed. The given size must be higher than 0. Note that if size is a power of 2 will perform faster.

frameSize()

Referenced by FFTComplex().

 bool zeroPhase ( ) const

Returns the zero phase setting. The default is True.

setZeroPhase()

 void setZeroPhase ( bool zeroPhase, bool callSetup = `true` )

Specifies the zeroPhase setting.