Skip to content

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).

number = 512

samples between successive frames

number = 2048

frame/FFT size in samples

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[]

Float32Array

number[]

read: () => object

object

current: number

frameCount: number

pendingSamples: number

reset: () => void

void