# FFT Class Reference

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

`#include <FFT.h>`

List of all members.

## Public Member Functions

FFT (int fftSize=1024, bool zeroPhase=true)
~FFT ()
void process (const MatrixXR &frames, MatrixXC *fft)
int fftSize () const
void setFftSize (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 Real 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 / 2 + 1) point vectors of Complex values (M being the FFT size).

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

Since the input is Real valued, the FFT will be symmetric and only half of the output is needed. This processing unit will only return the (M / 2 + 1)-point array corresponding to positive frequencies of the FFT.

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

 FFT ( int fftSize = `1024`, bool zeroPhase = `true` )

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

Parameters:
 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(), and setZeroPhase().

 ~FFT ( )

Destroys the FFT algorithm and frees its resources.

## Member Function Documentation

 void process ( const MatrixXR & 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 smaller or equal to the fftSize 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.

Referenced by Correlation::process(), and Autocorrelation::process().

 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 FFT().

 bool zeroPhase ( ) const

Returns the zero phase setting. The default is True.

setZeroPhase()

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

Specifies the zeroPhase setting.

Generated on Tue Mar 31 20:38:33 2009 for Loudia by 1.5.6