@audio/ beat-tempo
Status calibrated
npm2.0.0licenseMIT
Tempo estimation via autocorrelation of onset detection function
import tempo from '@audio/beat-tempo'
Autocorrelation of the onset detection function. Finds the dominant periodicity by correlating the spectral flux ODF with itself at different lags. Perceptual weighting (log-Gaussian centered at 120 BPM) resolves octave ambiguity.
import tempo from '@audio/beat-tempo'
let { bpm, confidence } = tempo(samples, { fs: 44100 })
let { bpm, candidates } = tempo(samples, { fs: 44100, candidates: 3 })
| Param | Default | |
|---|---|---|
fs |
44100 |
Sample rate |
minBpm |
60 |
Minimum BPM to consider |
maxBpm |
200 |
Maximum BPM to consider |
candidates |
1 |
Number of tempo candidates to return |
Use when: General tempo estimation — robust for most material.
Ref: Ellis, "Beat Tracking by Dynamic Programming" (JNMR 2007).
Complexity: where = lag range in ODF frames.
Part of @audio/beat — the beat family umbrella. This README is generated from the umbrella docs.
MIT © audiojs