FFT
Create a FFT
Buffer with:
const var fft = Engine.createFFT();`.
See this forum thread
to learn more about it.
Class methods
dumpSpectrum
Dumps the spectrum image to the given file (as PNG image). Edit on GitHub
FFT.dumpSpectrum(var file, bool output, int numFreqPixels, int numTimePixels)
getSpectrum2DParameters
Returns the JSON data for the spectrum parameters. Edit on GitHub
FFT.getSpectrum2DParameters()
prepare
Allocates the buffers required for processing. Edit on GitHub
FFT.prepare(int powerOfTwoSize, int maxNumChannels)
process
Process the given data (either a buffer or a array of buffers. Edit on GitHub
FFT.process(var dataToProcess)
setEnableInverseFFT
This enables the inverse transform that will reconstruct the signal from the processed FFT. Edit on GitHub
FFT.setEnableInverseFFT(bool shouldApplyReverseTransformToInput)
setEnableSpectrum2D
Enables the creation of a 2D spectrograph image. Edit on GitHub
FFT.setEnableSpectrum2D(bool shouldBeEnabled)
setMagnitudeFunction
Sets a function that will be executed with the amplitude information of the FFT bins. Edit on GitHub
FFT.setMagnitudeFunction(var newMagnitudeFunction, bool convertToDecibels)
setOverlap
Sets an overlap (from 0...1) for the chunks. Edit on GitHub
FFT.setOverlap(double percentageOfOverlap)
setPhaseFunction
Sets a function that will be executed with the phase information of the FFT bins. Edit on GitHub
FFT.setPhaseFunction(var newPhaseFunction)
setSpectrum2DParameters
Sets the spectrum data from the JSON object. Edit on GitHub
FFT.setSpectrum2DParameters(var jsonData)
setUseFallbackEngine
This forces the FFT object to use the fallback engine. Edit on GitHub
FFT.setUseFallbackEngine(bool shouldUseFallback)
setWindowType
Sets a window function that will be applied to the data chunks before processing. Edit on GitHub
FFT.setWindowType(int windowType)