webcam-pulse-detector
webcam-pulse-detector copied to clipboard
How to smooth data
When plotting the output from your program, it produces a waveform like this:

I understand this output is more sensitive than an on-finger bpm reader, but with a little imagination the waveform looks similar to what is produced by my on device, like this:

The waveform on the pulse reader is ultimately transformed to give 1 value as the bpm. Any idea how this transformation is completed? In other words, how do I transform the output from your model to give a reliable, stable bpm? I've tried aggregating at varying levels (1 sec, 2 sec, etc.) with different statistics (mean, min, max, mode), but these values rarely match my on-finger device.
The closest your model gets to my on-finger device is at the local minima on the waveforms. Is this the value I should select for?
Thanks!
@cmeaton I would suggest reading up on digital signal processing. This task seems well suited to an application of the Kalman filter.
e.g. https://scipy-cookbook.readthedocs.io/items/KalmanFiltering.html
@keyan IIUC, the Kalman filter estimates smoothed data by considering observed data and an a prior model. What I don't understand is how to determine the a priori model in this case. Is it a manually-defined expected range of values, or something determined statistically?