audioJS

@audio/beat-tempo

Status calibrated

npm2.0.0licenseMIT

Tempo estimation via autocorrelation of onset detection function

Overview

Install
Updated
Family
beat, 5 packages under it
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: O(Nlog⁡F+L2)O(N \log F + L^2) where LL = lag range in ODF frames.


Part of @audio/beat — the beat family umbrella. This README is generated from the umbrella docs.

MIT © audiojs