OnsetDetection
Spectral flux calculating and peaks finding
Static Method Summary
Static Public Methods | ||
public static |
calculateSF(audioData: Float32Array, fft: Object, params: Object): Array Get spectral flux |
|
public static |
Finding local maxima in an array |
|
public static |
Normalize data to have a mean of 0 and standard deviation of 1 |
Static Public Methods
public static calculateSF(audioData: Float32Array, fft: Object, params: Object): Array source
Get spectral flux
Params:
Name | Type | Attribute | Description |
audioData | Float32Array | non-interleaved IEEE 32-bit linear PCM with a nominal range of -1 -> +1 (Web Audio API - Audio Buffer) |
|
fft | Object | object with methods for performing FFT |
|
params | Object |
|
parameters |
params.bufferSize | Number |
|
FFT windows size |
params.hopSize | Number |
|
spacing of audio frames in samples |
public static findPeaks(spectralFlux: Array, params: Object): Array source
Finding local maxima in an array
Params:
Name | Type | Attribute | Description |
spectralFlux | Array | input data |
|
params | Object |
|
parametrs |
params.decayRate | Number |
|
how quickly previous peaks are forgotten |
params.peakFindingWindow | Number |
|
minimum distance between peaks |
params.meanWndMultiplier | Number |
|
multiplier for peak finding window |
params.peakThreshold | Number |
|
minimum value of peaks |