how to calculate heart rate and spo2 from maxrefdes117

This calculation of heart rate is done in the function "maxim_heart_rate_and_oxygen_saturation(}". To me, it looks like they are looking for the number of samples between peaks in the data. Some comments in the code lead me to believe that there are 25 samples per second so each sample is 0.04 seconds (40 milliseconds). Multiply by the samples between peaks and divide into 60 seconds (60000 milliseconds) and that gives you beats per minute.

You can read the function here: