I calculate the beats per minute (BPM) out of Kinect hand positions tracked from a conductor. I do that by finding the last and the second last minimum in my history data. I then calculate the time difference between these two minimums and extrapolate this difference to a minute to get the current BPM.
However I am struggling finding the correct mathematical equation for that. How would I start? It is basically just the following, but how would I use the $history$ instead of first and secondLow? And have a function like $bpm(x) = ?$ or similar.
$bpm = 60 / (firstLow - secondLow)$
To show how my data-set does look like I add a simple graphic which should give you a little more details.
Thank you very much for your help.