-1

I would like to get the bpm of a song analyzing the spectrum of the volume. Doing a fft what I get is a peak at the origin and of course that can't be the frequency corresponding to the bpm, so I do the following:

$\overline{h} = h - \frac{1}{l}\sum_0^l h$

where $h$ is the fft of the volume and $l$ is the length of the signal.

Now I expect the bpm frequency to show up in the interval $[1 Hz,3Hz]$ but how can I recognize it?

user1584773
  • 99
  • 1
  • 1
  • 2
    This is a rather poor BPM detection method, but on music with a strong rhythm, you should see a peak in the magnitude of the FFT in the range of interest. The mean subtraction you are doing doesn't do anything besides zeroing the first FFT component, so it is not needed. – pichenettes Feb 28 '14 at 17:07

2 Answers2

1

Unless your FFT is very large you're not going to get much resolution in the range of interest since each FFT bin holds Fs/N Hz of spectrum. ( Fs = sample rate, N=FFT size).

I have successfully got very accurate BPM values by using two FFT's in series and then picking the biggest peak in the region of interest in the final averaged spectrum.

IME this works well for signals with a reasonably prominent beat. e.g. typical modern pop & rock music.

 

1

The BPM of only certain limited styles or forms of music or music performance is represented by periodicity in volume. Make sure you are testing with one of those by inspecting a volume vs. time graph.

hotpaw2
  • 35,346
  • 9
  • 47
  • 90