GestureRecognitionToolkit  Version: 0.2.0
The Gesture Recognition Toolkit (GRT) is a cross-platform, open-source, c++ machine learning library for real-time gesture recognition.
FFT.h File Reference

The FFT class computes the Fourier transform of an N dimensional signal using a Fast Fourier Transform algorithm. More...

#include "../../CoreModules/FeatureExtraction.h"
#include "FastFourierTransform.h"

Go to the source code of this file.

Classes

class  FFT
 

Detailed Description

The FFT class computes the Fourier transform of an N dimensional signal using a Fast Fourier Transform algorithm.

Author
Nicholas Gillian ngill.nosp@m.ian@.nosp@m.media.nosp@m..mit.nosp@m..edu
Version
1.0

The FFT class computes N independent FFTs, one for each dimension in the input signal. The FFT is computed using the previous M samples input to the FFT instance, where M is equal to the FFT Window Size parameter, which is set by the user when they initialize the FFT. The FFT Window Size parameter must be a power of two (16,32,64,128,256,512,1024,2048,4096,etc.). Note that, because of the symmetries within the FFT computation, the results of an FFT will be half the FFT Window Size. This means that if you create an FFT with a Window Size of 256, the resulting vectors that you will get (such as the magnitude and phase) will each have 128 elements in them.

For each N dimensional input signal, the FFT will output:

  • An M dimensional vector containing the magnitude of each frequency component
  • An M dimensional vector containing the phase of each frequency component where M is equal to the FFTWindowSize / 2 . These values will be concatenated into one vector, in the order of { [magnitude dimension 1] [phase dimension 1] [magnitude dimension 2] [phase dimension 2] ... [magnitude dimension N] [phase dimension N] }. The size of this concatenated output vector will therefore be equal to N * M * 2 - where N is the number of input dimensions to the FFT, M is the FFTWindowSize/2, and 2 represents the magnitude and phase vectors. If you only really need the magnitude or phase of a signal, as opposed to both, then you can turn off the computation and concatenation of the element you do not need to save unnecessary computations and memory copies, this can either be done in the FFT's constructor or by using the setComputeMagnitude(bool computeMagnitude) and setComputePhase(bool computePhase) functions.

Definition in file FFT.h.