Minimalistic and efficient FFT implementation for 2n-size inputs. Includes regular and asm.js versions.
var ft = ;var db = ;var frequency = 440;var size = 1024;var sampleRate = 44100;var waveform = size;for var i = 0; i < size; i++waveformi = Math;//get normalized magnitudes for frequencies from 0 to 22050 with interval 44100/1024 ≈ 43Hzvar spectrum = ;//convert to decibelsvar decibels = spectrum
To use asm.js version, require as
require('fourier-transform/asm'). That is ~35% faster.
To all the existing fft packages, without them this one would not be possible. Special thanks to @corbanbrook for the most efficient implementation in dsp.js. This package is based on dsp.js RFFT, which is based on RealFFT.