Minim icon indicating copy to clipboard operation
Minim copied to clipboard

Beat detection from PCM

Open levuphuong opened this issue 7 years ago • 1 comments

Hi

The input is pcm wave data 8 bit, Sample rate 44100, time size 1024. I use sound energy algorithm but detection is not correct. And I have confusion with Variance. What is maximum of V? following the library V-max = 255^2. It would impact to C constant value too much. C = (-0.0025714f * V) + 1.5142857f;

https://github.com/ddf/Minim/blob/master/src/main/java/ddf/minim/analysis/BeatDetect.java

Thanks

levuphuong avatar Dec 20 '18 07:12 levuphuong

This is very old code and was never really good as a general purpose beat detection method. It worked reasonably well on music is strong beats (dance music for instance). I don't recall exactly how it all works, but after looking over the code again, I'm pretty sure that V will never get so large. It should be the average amount that samples in the current buffer differ from the average value of the entire buffer, so I would expect it to every be larger than 2.

Can you be more specific about how the detection is "not correct"?

ddf avatar Feb 22 '19 17:02 ddf