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).
FFT.dumpSpectrum(var file, bool output)
getSpectrum2DParameters
Returns the JSON data for the spectrum parameters.
FFT.getSpectrum2DParameters()
prepare
Allocates the buffers required for processing.
FFT.prepare(int powerOfTwoSize, int maxNumChannels)
process
Process the given data (either a buffer or a array of buffers.
FFT.process(var dataToProcess)
setEnableInverseFFT
This enables the inverse transform that will reconstruct the signal from the processed FFT.
FFT.setEnableInverseFFT(bool shouldApplyReverseTransformToInput)
setEnableSpectrum2D
Enables the creation of a 2D spectrograph image.
FFT.setEnableSpectrum2D(bool shouldBeEnabled)
setMagnitudeFunction
Sets a function that will be executed with the amplitude information of the FFT bins.
FFT.setMagnitudeFunction(var newMagnitudeFunction, bool convertToDecibels)
setOverlap
Sets an overlap (from 0...1) for the chunks.
FFT.setOverlap(double percentageOfOverlap)
setPhaseFunction
Sets a function that will be executed with the phase information of the FFT bins.
FFT.setPhaseFunction(var newPhaseFunction)
setSpectrum2DParameters
Sets the spectrum data from the JSON object.
FFT.setSpectrum2DParameters(var jsonData)
setWindowType
Sets a window function that will be applied to the data chunks before processing.
FFT.setWindowType(int windowType)