Jason (jcreed) wrote,

Have been messing around with beat detection algorithms this evening for no good reason other than I have other work to do and, wah, I don't wanna do it.

I thought of convolving the signal against isin(2πθx) + cos(2πθx) for various θ to see which gave me the biggest amplitude, but that didn't seem very stable with different samples from the same song. What did work nicely was first taking the original (44.1kHz) sample and taking little 100-frame chunks and computing the total energy in each chunk, that is, Σ_i x_i * x_i. Then after that I did the convolution thing, and it had a nice lovely big narrow spike at about 1.25Hz, (which is what I expected from just manually counting beats and measuring the time) and smaller spikes at 2.5Hz, 3.75Hz, and 5Hz, as you would expect, since if you see beats coming every second, then you'll also detect them if you check every half second, every third of a second, etc.

Now if only I could automate this somehow I wouldn't have to use these stupid ass shareware programs that do, like, one task and not even very well and the demo doesn't let you save and they ask like $45 for it. Jesus.

  • Post a new comment


    Anonymous comments are disabled in this journal

    default userpic

    Your reply will be screened

    Your IP address will be recorded