in reply to calculating the bpm of a song in mp3 format
The algorithm I would use to calculate BPM is to
- calculate the modulation envelope of the waveform using either a Hilbert transform or rectification and smoothing
- compute the Fast Fourier Transform (FFT) of the modulation envelope
- look for the strongest peak in the 0.2-5Hz range (depending on the music)
- Assign the center of the peak to be the BPM.
How to do all of this in perl? I would use PDL. It is very efficient in manipulating vector quantities like sound waveforms and has a built in FFT function.
-Mark
|
---|
In Section
Seekers of Perl Wisdom