npm.io
1.0.2 • Published 4h ago

@audio/sinusoidal-track

Licence
MIT
Version
1.0.2
Deps
2
Size
7 kB
Vulns
0
Weekly
0

@audio/sinusoidal-track npm MIT

Peak picking + partial tracking

npm install @audio/sinusoidal-track
import track from '@audio/sinusoidal-track'

Sinusoidal analysis: STFT spectral peaks with parabolic interpolation, linked frame-to-frame into partial trajectories by nearest-frequency continuation within a cents threshold (McAulay & Quatieri 1986). Produces the model consumed by sinusoidal-synth (additive resynthesis) and sinusoidal-residual (noise layer).

let model = track(data, { frameSize: 2048, hop: 512 })
// model.partials: [{ start, freqs: number[], amps: number[] }, ...]
Param Default
fs 44100 Sample rate
frameSize 2048 STFT frame
hop 512 STFT hop
maxPartials 40 Peaks kept per frame
threshold -60 Peak floor, dB relative to frame max
maxJump 60 Max cents jump for partial continuation

Returns { partials, frames, hop, frameSize, fs }partials only includes trajectories lasting ≥3 frames.

Use when: the analysis stage of the sinusoids+noise (SMS) pipeline — additive resynthesis, residual extraction, or trajectory-based processing (smoothing, transposition).


Part of @audio/sinusoidal — the sinusoidal family umbrella.

MIT audiojs

Keywords