Open SimoneXilab opened 1 year ago
Hi, I haven't looked at this for some time but one thing to check first is if you are using the newer square BangleJS watch or the older one as this was created some time ago on the older version. Not sure if it would work on the newer one as I've not used it. To debug, in the code there are some debug CSV logs that are created so you could review these to see how the PPG data looks after the functions that look for peaks, as that is effectively what is used to calculate HRV. You'll also want to validate the HR sensor is working correctly perhaps with a different HR app from the bangle store/AppLoader.
Hi Jabituyaben, I am actually interested too in this kind of application. There are some parts of the HRV.js code which do not seem clear to me. vcRaw retrieves the raw data coming from the sensor I supposed, is it in mV right? Why are you iterating the for loop at the beginning within the pulsecount if statement 256 times? Thanks in advance!
Hi Jabituyaben, I am actually interested too in this kind of application. There are some parts of the HRV.js code which do not seem clear to me. vcRaw retrieves the raw data coming from the sensor I supposed, is it in mV right? Why are you iterating the for loop at the beginning within the pulsecount if statement 256 times? Thanks in advance!
Hi, not 100% sure if it's mV but it's from the PPG sensor raw values so probably is mV yes, the units doesn't really matter to be honest. The 256 times would have been to get enough pulse readings to use for calculating a HRV reading - so enough data to process but at the same time doesn't max out the processing power of the watch; there are steps in here that require upscaling the data, which means multiples of 256 so the numbers, arrays and storage start getting used up after a while. You could probably experiment with adjusting this down and see what you get but it might mean adjusting other parts of the script too - pretty easy to do though. Ideally this script should be done as inline C rather than javascript as it would run much faster. The javascript implementation was to give a good overview of some steps to calculate HRV according to the studies I've looked at - javascript is easier to read and easy to iterate testing on the Bangle which was useful. Hope that helps
Actually I get lots of undefined values keeping the 256 counting limit, probably due to different hrm sensor on the two version of the bangle js. Anyway if you have further references to share I am more than happy to read them. Probably I'll ask for a fork to update your version to the bangle js 2 device which is the one of interest. Could it be a problem?
Hi Jabituyaben. I hope this message finds you well. My name is Simone Borghi and I came across your JavaScript script for HRV analysis using Bangle. I have been trying to implement your code on my Bangle JS model, but I have been experiencing some issues with printing the HRV data correctly. I was hoping to ask for your help and guidance on this matter. Is there a particular reason why the HRV data might not be printing correctly on my Bangle model? Do you have any suggestions or tips on how I can resolve this issue and get the data to print correctly? If interested I will send you details of my problem. Furthermore, I wanted to express my admiration for your work and ask if you would be open to discussing the code further. Thank you for your time, and I look forward to hearing back from you soon.