createFluxAnalyzer
createFluxAnalyzer(
opts?):object
Defined in: packages/pleco-xa/src/streaming/analyzers.js:143
Create an incremental spectral-flux analyzer.
Each complete frame is Hann-windowed and transformed (nFft-point FFT); flux is the sum of positive magnitude increases versus the previous frame’s spectrum: flux[t] = sum_k max(0, |X_t[k]| - |X_{t-1}[k]|) The first frame has no predecessor and reports flux 0. Flux spikes at energy/amplitude onsets (e.g. an amplitude step in the input).
Parameters
Section titled “Parameters”number = 512
samples between successive frames
number = 2048
frame/FFT size in samples
Returns
Section titled “Returns”object
push() returns the flux values newly completed by this chunk; read() reports the most recent value and totals without consuming anything.
push: (
chunk) =>number[]
Parameters
Section titled “Parameters”Float32Array
Returns
Section titled “Returns”number[]
read: () =>
object
Returns
Section titled “Returns”object
current
Section titled “current”current:
number
frameCount
Section titled “frameCount”frameCount:
number
pendingSamples
Section titled “pendingSamples”pendingSamples:
number
reset: () =>
void
Returns
Section titled “Returns”void