estimate_tempo
estimate_tempo(
tgram,sr?,hop_length?,start_bpm?,std_bpm?,max_tempo?):object
Defined in: packages/pleco-xa/src/scripts/xa-tempogram.js:579
Estimate the global tempo from a (lag) tempogram using tempo scoring: time-mean of the tempogram, pseudo-log-normal prior logprior = -0.5 * ((log2(bpm) - log2(start_bpm)) / std_bpm)^2 and argmax of log1p(1e6 * mean) + logprior with tempi at/above max_tempo masked out. (The previous raw argmax had no prior and returned the 60 BPM subharmonic on a plain 120 BPM click train.)
Parameters
Section titled “Parameters”(any[] | Float32Array<ArrayBufferLike> | Float64Array<ArrayBufferLike>)[]
tempogram [n_lags][n_frames] as returned by tempogram()
number = 22050
sample rate
hop_length?
Section titled “hop_length?”number = 512
hop length used for the onset envelope
start_bpm?
Section titled “start_bpm?”number = 120
center of the log-normal prior
std_bpm?
Section titled “std_bpm?”number = 1.0
prior standard deviation (log2 space)
max_tempo?
Section titled “max_tempo?”number = 320.0
mask tempi at/above this value
Returns
Section titled “Returns”object
tempo in BPM and the measured mean-tempogram value at the chosen lag (never a fabricated confidence)
strength
Section titled “strength”strength:
number
tempo:
number
Throws
Section titled “Throws”on empty input or when every lag is masked