heartbeat icon indicating copy to clipboard operation
heartbeat copied to clipboard

get trigger at peak

Open stephanschulz opened this issue 3 years ago • 5 comments

Thank you again for posting this code. I am able to make it run and I find it works great. I was even able to integrate it in to a openframeworks.cc application.

I was hoping you could point me to the right part of the code where I might be able to extract the moment of a peak. My goal is to make the heart beat readings audible by playing a sound every time we get a peak. The hope if that it will align more or less with the person's actual pulse.

Thank you for any advice.

stephanschulz avatar Nov 09 '20 21:11 stephanschulz

That's great to hear. To get those timings, you would need to add peak detection to the algorithm - this is currently not implemented.

prouast avatar Nov 09 '20 22:11 prouast

Thanks for the info.

Am I assuming correctly to do that on the s_f.rows data? If I get something useful working I will make a PR.

stephanschulz avatar Nov 09 '20 22:11 stephanschulz

Again thank you for the tip about peak detection. I forked your code and made an attempt to add it using this c++ implementation of the using z-scores peak detection algorithm https://stackoverflow.com/questions/22583391/peak-signal-detection-in-realtime-timeseries-data/46998001#46998001

The added code draws an additional graph showing the peaks and troughs of the s_f curve. It also draws a filled circle every time the most recent peak value equals 1.

All this was done to get me one step closer to visualizing the onset of the live heart beat.

Screen Shot 2020-11-13 at 9 11 01 AM

stephanschulz avatar Nov 13 '20 14:11 stephanschulz

Thanks for keeping me up to date on this, very cool to see.

prouast avatar Nov 18 '20 09:11 prouast

很高兴听到。要获得这些时间,您需要在算法中添加峰值检测--这目前还没有实现。

谢谢你让我了解最新情况,很酷。

Its pretty good!!!Do you have Python version?

Jon-Zbw avatar Aug 13 '21 01:08 Jon-Zbw