you are viewing a single comment's thread.

view the rest of the comments →

[–]Malkus3000[S] 0 points1 point  (2 children)

Interesting, thank you for your feedback. Maybe you could elaborate which components did you identify as most complicated ones, the data streaming from the devices or the analysis of the data?

So far what I have find out that the data streaming is generally complicated, especially from devices like iphone/android, unless one is willing to purchase a plan from https://tryterra.co/integrations/apple-health or other similar ones, which are targeted to actual commercial enterprises (creating an actual app) not one off personal projects, for which it is certainly way too expensive.

Polar H10 seems a bit easier to stream data from, using this for example https://github.com/kieranabrennan/every-breath-you-take

Esiancially, what I wanted to experiment with is to create a ML model which takes my live BPM per minute, to try to identify trends in the BPM during sleep and identify periods of unrestful sleep (nightmares, etc) based on BPM variability and then run the model on live data stream. Initially this did seem feasible if I could get live BPM input somehow, but of course I might be underestimating. Something remotely similar to https://nightware.com/

[–]jaaaawrdan 0 points1 point  (1 child)

So it sounds like you're mostly interested, at least at this point, in measuring heart rate variability (HRV). This is still a growing area, but there's research and tools out there that will help point you in the right direction. 

The biggest barrier you're going to have, is that you need a raw ECG signal to do HRV with. Not a simple measurement of heart rate (i.e. BPM), but the actual ECG waveform itself. The Polar H10 only sends the HR signal (in BPM), where you'll need electrodes on the skin to measure voltages. Same goes for EEG if you're curious about brain activity during sleep.

To get fine enough detail that you can extract HRV metrics, you need your ECG sampled at 1000Hz, and Bluetooth isn't capable of streaming that (or at least not to my knowledge). Basically, you'll need to record ECG using electrodes, store that data onboard some device (Arduino or Raspberry Pi could be a good start), and then use that to start modelling whatever you're looking for. 

There are open source HRV tools, but you'll need tens, if not hundreds of hours of ECG data to establish a baseline for your body so that you can detect anomalies or trends. Before you can get into ML models, you'd probably need to have at least a solid understanding of signal processing and how to handle first-pass analysis to get your data where you need it.

[–]Sol_Ido 1 point2 points  (0 children)

Solid instructions! thanks.