Skip to content
nickgillian edited this page Aug 21, 2016 · 3 revisions

#FFT

##Description The FFT class computes the Fourier transform of an N-dimensional signal using a Fast Fourier Transform algorithm. 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 / 2. 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 FFT 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 FFT Window Size / 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 FFT Window Size / 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. Check the FFT documentation for more information.

The FFT class is part of the Feature Extraction Modules.

FFT An example showing the output (magnitude data only) of the FFT Feature Extraction module. The input to the FFT consisted of a 100Hz sine wave signal, this is why you can see a large peak in the FFT magnitude data at a frequency value of 100. Note that the FFT Window size for this example was set to 256, this is why you can see the frequencies 'spill' into the surrounding frequency bins around 100Hz, setting the FFT Window size value to a larger window size (for instance 4096, 8192, etc.) would result in a much more accurate FFT analysis, although this would be more computationally expensive.

##Applications The FFT module is good at converting a signal from the time domain to the frequency domain. This is useful as a number of powerful features can then be extracted from the frequency domain signals, such as the fundamental frequency of the signal, the centroid, the fundamental frequency/signal ratio, etc.. These additional features are not computed by the FFT module itself, the FFT module should therefore be used with the FFTFeatures module, or you could easily write your own custom FFT feature extraction module if you need specific features extracted from the FFT signal.

##Example FFT Example