#include <FFTComplex.h>
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) |
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 | ( | int | frameSize, | |
int | fftSize, | |||
bool | zeroPhase = true | |||
) |
Constructs an FFT object with the specified fftSize and zeroPhase setting.
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.
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.
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. |
int fftSize | ( | ) | const |
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.
Referenced by FFTComplex().
int frameSize | ( | ) | const |
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.
Referenced by FFTComplex().
bool zeroPhase | ( | ) | const |
void setZeroPhase | ( | bool | zeroPhase, | |
bool | callSetup = true | |||
) |