140 likes | 332 Views
Java Beat Detection Program. A Java Application Based on Eric Scheirer and Others. Sources. Tempo and Beat Analysis of Acoustic Musical Signals by Eric Scheirer Beat Detection Algorithms by Frederic Patin http://www.gamedev.net/reference/programming/features/beatdetection/
E N D
Java Beat Detection Program A Java Application Based on Eric Scheirer and Others
Sources • Tempo and Beat Analysis of Acoustic Musical Signals by Eric Scheirer • Beat Detection Algorithms by Frederic Patin http://www.gamedev.net/reference/programming/features/beatdetection/ • Beat This: A Beat Synchronization Projectby Cheng, Nazer, Uppuluri, Verret http://www.owlnet.rice.edu/~elec301/Projects01/beat_sync/beatalgo.html
Program Input • Wav file • 8-bit • Mono • 22050 samples/sec
Step 1: FFT • Performed on sliding frame of 1024 samples. • With each step, the frame moves forward 256 samples (so chunks overlap) • Resolution of 16.1 ms • Min frequency of 22.5 Hz
FFT (cont.) • Frequency outputs are grouped into 9 bands • Varying sizes, as suggested by Patin • Different from Scheirer and Beat This web site • Use half-hanning window for smoothing
Differentiation • Scheirer’s method for finding onsets in each band • For each band, at each frame, computeDiff[band][f] = BandData[band][f]-BandData[band][f-1]; • Half-wave rectify If(BandData[band][f] <0) BandData[band][f] = 0; • This gives a picture of sudden increases in each band
Peak Finding • Start a few seconds into the recording (for comb filter, explained next) • Take a window of about 20 frames. • Sum frequency data across bands. • Consider the peak to be our first estimation of a beat
Comb Filter • Alternate to autocorreclation described by Scheirer for finding periods of repetition. • I use a simplified method – seems to work better than Scheirer’s or Beat This.
Comb Filter (cont.) • Given a starting time t, • For each band, b, and for every candidate period T:CF(T) = Diff[t] + Diff[t-T] + … + Diff[t-nT] • Sum results across bands • Maximum value is the new estimate for the music’s rhythmic period.
Peak Finding + Comb Filter • When we find a peak at time t • Estimate period T starting from t. • Begin looking for a new peak in the neighborhood of t+T. • Repeat: find peak, find period, find peak, find period… until the end of the data.
Results • St. Etienne • Chemical Brothers • Beethoven • Tito Puente