The following is a compressed summery of what I found out so far (No code from me so far. Credit goes to gordon, helmrich, myownself and others)
Please correct me where I am wrong or point me to good information I did't find so far.
Where is the problem?
As all smartwatches, bangle usese optical sensing ("PPG" = "Photoplethysmography") not electrical as chestbelts do in order to measure heart related information.
This type of sensor signal is much more vulnerable to disturbance, especially by movement, and therefore considerably more difficult to interpret.
On the other hand it contains additional information that eg. could enables estimation of oxygen saturation (SpO2) and more.
In addition to the HR espruino provides a confidence measure. The confidence is a pretty good indicator of the validity of the HR. You shouldn't trust HR below confidence of ~90. Some apps (eg daisy or circle clock) can use that and hide unreliable readings. http://forum.espruino.com/conversations/372681/#16387732
How can I have a quick look or start experimenting?
For a quick start, you may want to just paste this code into left side of WebIDE http://forum.espruino.com/conversations/372681/?offset=25#16390275
Yellow is the raw input signal, red the improved filtered one and after a while you can see all recognised peaks marked in purple over the red graph.
You can see how good the current algorithm works for you (and see that there is even low hanging fruit for improvement still)
The "HRM Accelerometer event recorder" App allows a more detailed analyses by recording this data and more on a computer/phone into a csv file. https://banglejs.com/apps/?id=hrmaccevents
With this csv you can start analysing and testing in whatever tool/language you prefer.
As the name suggests also acceleration data is recorded, which so far is not used at all in espruino HRM. Including it should really make a difference. https://github.com/espruino/BangleApps/issues/1248
This app is also a good example to learn how to get all the relevant sensor readings.
Set up a test harness where a potential algorithm can be optimized and reproducably evaluated on a train/validation/test set of recordings.
Collect a good (increasing level of difficulty; from different persons) set of recordings of bangle PPL and Acc sensor data toghether with refernce data from a good external sensor via BLE
Try differnt algorithms starting with basic ones as eg.
just ignore all PPL readings above a certain threshold of movement measured by Accelerometer
Improve peak finding (as with the eye one sees very clear peaks that are not found)
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.
The following is a compressed summery of what I found out so far (No code from me so far. Credit goes to gordon, helmrich, myownself and others)
Please correct me where I am wrong or point me to good information I did't find so far.
Where is the problem?
(http://forum.espruino.com/conversations/371899/#16355245)
http://forum.espruino.com/conversations/372681/#16387616
http://forum.espruino.com/conversations/373033/?offset=25#16668809
What is the current state?
http://forum.espruino.com/conversations/372681/#16388080
http://forum.espruino.com/conversations/373033/#comment16423860
http://forum.espruino.com/conversations/372681/#16387732
How can I have a quick look or start experimenting?
http://forum.espruino.com/conversations/372681/?offset=25#16390275
Yellow is the raw input signal, red the improved filtered one and after a while you can see all recognised peaks marked in purple over the red graph.
You can see how good the current algorithm works for you (and see that there is even low hanging fruit for improvement still)
With this csv you can start analysing and testing in whatever tool/language you prefer.
As the name suggests also acceleration data is recorded, which so far is not used at all in espruino HRM. Including it should really make a difference.
https://github.com/espruino/BangleApps/issues/1248
This app is also a good example to learn how to get all the relevant sensor readings.
What is the plan?
Result of attempts so far and analysis:
How can I get reliable heart rate right now?
(until me/you/somebody finds the time to improve the algorithm)