As said I checked some algorithms that do remove motion artifacts from PPG with acceleration data and they all failed. I tried to analyze why the fail and, as result, developed a very simple mechanism: Lets just take the fft of both PPG and ACC and remove the frequencies from the PPG spectrum that have noise in ACC spectrum.
It will not have a high resolution.
It will most certainly fail if heart rate frequency is close to the acceleration noise frequency.
Mean error will not get closer to the real heart rate then 5-10BPM.
So my algorithm does not always get closer to the truth but it sometimes can, see the attachment. BPM of firmware in red, real BPM from belt sensor in green, calculated BPM in blue. X-Axis is time, Y-Axis BPM.
It looks like it kind of stabilize around the ground truth from the middle point onward, with some oscillation. Is that only a coincident with these particular data or generally the case?
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.
Well I said I give up, but well..
As said I checked some algorithms that do remove motion artifacts from PPG with acceleration data and they all failed. I tried to analyze why the fail and, as result, developed a very simple mechanism: Lets just take the fft of both PPG and ACC and remove the frequencies from the PPG spectrum that have noise in ACC spectrum.
So my algorithm does not always get closer to the truth but it sometimes can, see the attachment. BPM of firmware in red, real BPM from belt sensor in green, calculated BPM in blue. X-Axis is time, Y-Axis BPM.
1 Attachment