Hi,
I did this in a project once and after a lot of searching, this is the best paper I have found on the subject:
http://www.owlnet.rice.edu/~elec301/Projects01/beat_sync/beatalgo.html (its Matlab Code)
Here is a small outline of the steps involved in doing this Perl.
- first convert your mp3 file into a .wav file with the lame encoder (-d option).
- Using the Win32::Sound module load this .wav file and read the samples.
- Take a FFT to convert your time signal into frequency domain
- Optionally, you can use a comb filter (it involves convolving a series of sample signals to determine which signal yields the highest energy) as described in the above paper. Personally, I skipped it
Cheers!
san.
print length "The answer to life, universe & everything!"