Got an overview of the current HR algorithm at https://github.com/espruino/Espruino/blob/407dd17e0903840df724ebf25f83d2bb95863fb5/libs/misc/heartrate.c
Basically a FIR filter emphasizing 0.9 Hz - 3 Hz with step recognition via demanding two upward steps after having been below moving average. [Idea that comes into mind is to demand upward steps to be above moving average? Will try]:
Then a median filter from the last 8 peaks. Confidence is out of the spread of those 8 values.
I struggled a bit with line 268. Seems to introduce a factor of 175/16=10.9.
Probably to bring result in good range for integer arithmetic?
Espruino is a JavaScript interpreter for low-power Microcontrollers. This site is both a support community for Espruino and a place to share what you are working on.
Got an overview of the current HR algorithm at https://github.com/espruino/Espruino/blob/407dd17e0903840df724ebf25f83d2bb95863fb5/libs/misc/heartrate.c
Basically a FIR filter emphasizing 0.9 Hz - 3 Hz with step recognition via demanding two upward steps after having been below moving average. [Idea that comes into mind is to demand upward steps to be above moving average? Will try]:
Then a median filter from the last 8 peaks. Confidence is out of the spread of those 8 values.
I struggled a bit with line 268. Seems to introduce a factor of 175/16=10.9.
Probably to bring result in good range for integer arithmetic?
And here is where the raw values come from.: https://github.com/espruino/Espruino/blob/407dd17e0903840df724ebf25f83d2bb95863fb5/libs/misc/hrm_vc31.c Need to understand what was done to the signal already and what options the hardware brings.