2. tempo estimation
Contents
A kick every half second gives two kicks per second, or 120 beats per minute (BPM). Its period is the time from one beat to the next. Divide 60 by the period in seconds to get BPM. Now add hi-hats halfway between the kicks. The hats and kicks together mark 240 events per minute, and a listener tapping every other kick marks 60. The recording supports all three rates. A tempo estimator has to choose which pulse to follow. [5, 6]
Measuring the gaps
A tap-tempo button measures the gaps between your taps. Taking the middle gap after sorting them, the median, keeps one late tap from dominating. Software can do something similar with the onsets from section 1. The BeatRoot tracker also measures gaps between hits that have other hits in between. In the kick-and-hat pattern, consecutive hits are a quarter second apart, but many pairs are half a second apart. BeatRoot groups similar gaps and collects support for periods related by simple multiples. [7]
Looking for repetition
Keep a running score of how strongly a new sound seems to start in each window. This series is the onset envelope. Slide a copy of it half a second to the right. If the kicks repeat every half second, their peaks line up again. Trying many shifts and measuring the agreement at each one is called autocorrelation. With 100 measurements per second, a shift of 50 frames means 120 BPM. A second strong match at 100 frames means 60 BPM. [8]
In the formula below, is the onset score at frame , is the number of frames, and is the shift. Each product compares two scores frames apart.
A comb filter tests a period another way. It mixes the current signal with a delayed version so regularly spaced accents reinforce one another. Scheirer runs filters tuned to different periods across several frequency bands. A tempogram shows which rates are strongest as the analysis window moves through the track. A longer window helps distinguish nearby rates. A shorter one follows a DJ’s tempo change sooner. During an intro with no clear pulse, several candidate rates and their strengths can be more informative than one BPM reading. [6, 8, 9, 10]