@audio/beat-tempo
v1.0.3
Published
Tempo estimation via autocorrelation of onset detection function
Readme
@audio/beat-tempo

Tempo estimation via autocorrelation of onset detection function
npm install @audio/beat-tempoimport 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'
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: $O(N \log F + L^2)$ where $L$ = lag range in ODF frames.
Part of @audio/beat — the beat family umbrella. This README is generated from the umbrella docs.
MIT © audiojs
