11 ms·
Show HN: Every Breath You Take – Heart Rate Variability Training
Through controlled breathing it is possible to regulate your body's stress response. I've built an app to measure and train this effect with a Polar H10 Heart Rate monitor.
With every breath you take, you can set the pace of your breathing rate, measure your breathing control with the chest accelerometer, and see how heart rate variability responds.
- jackmott 3y ago[dead]
- sirsinsalot 3y agoI've found my HRV (measured by a Garmin watch) directly correlates with my anxiety levels. So much so, that I use it as a marker to check in with myself, because stress and anxiety can quietly creep up ... but my HRV status is always reflective. It's magic. Like having an accurate anxiety metric, even if the anxiety is purely unconscious.
- kbre93 3y agoI've it's quite common for fitness trackers to predict the onset of sickness from heart rate variability. I've found they don't offer much real-time feedback, and don't have breathing detection though which was what I wanted to explore for this project, to train hrv
- lloeki 3y ago> don't have breathing detection FWIW my Garmin watch reports a breath per minute metric. Dunno if this is what you were alluding to.
- kbre93 3y agoRight, but I don't think they measure it directly (could be wrong), I think they measure it based on change in heart rate
- nharada 3y agoIs this a feature that some trackers offer? When I worked at Fitbit I noticed this correlation (along with resting heart rate) and developed a model that could predict onset of illness a few days in advance with fairly good accuracy. But unless the accuracy is perfect it can be difficult to offer it as a product feature without a lot of validation and experiments showing that your health related claim is accurate.
- gcanyon 3y agoI can tell I'm sick by looking at my resting heart rate. If it goes up (generally by 5-10 bpm) and I didn't do a hard workout in the past 12-18 hours, I'm pretty likely to be coming down with something.
- haldujai 3y agoThey probably are but I’m confused as to how you’ve measured your anxiety level to determine correlation with HRV. Depending on your answer this leads to the follow-up of why not use that measure?
- tra3 3y agoGarmin also has a “stress” metrics but I’ve found it unreliable.
- haldujai 3y agoBasically my question is how we’re measuring anxiety to determine correlation. The OP mentions “unconscious anxiety” which is confusing me, wondering if they are using a questionnaire or something else neat. If “unconscious anxiety” is being diagnosed based solely on HRV that‘s not how correlation works.
- sirsinsalot 3y agoIt isn't, as answered elsewhere. When I mean unconsciously, I mean being unaware in that moment. However reflective hindsight reveals not only correlations in habit, behaviour, and so on but also in hindsight from a calmer frame of mind you can be aware of just how anxious you had become. Solely based on HRV would be daft. I'm saying it correlates strongly with many other indicators which together are an indicator of my anxiety, realised or not, at that moment. Ad HRV is a number and other indicators are not, its a great way to have a more quantitative measure which I've found is very helpful. Anecdata and qualitative measures sure, but it works for me.
- lloeki 3y agoAs with all things measured from a wrist worn sensor, and ove the course of the order of a decade of essentially continuous wearing, I've found that the device may be wrong (and completely off the mark at times) but is also mostly right most of the time. I don't expect anything else for a device I wear loose most of the time (and snug+proper placement when working out) yet it still gives me eerily accurate metrics to work with.
- tra3 3y agoDo you use the watch or the garmin app? Is it the instantaneous reading you’re looking at or some sort of average?
- sirsinsalot 3y agoMainly during sleep in the morning report. If I'm anxious during the day, if I realise it or not, my HRV is unbalanced.
- darkerside 3y agoMine correlates directly with sleep, alcohol, and overtraining
- nerdponx 3y agoThis is explicitly part of biofeedback practice, learning to recognize and manage your emotional state through your heart rate.
- deleted 3y ago[deleted]
- deleted 3y ago[deleted]
- mohaba 3y agowow. This is incredible for multiple reasons. I've seen apps that somehow read what looks like an ecg from the h10, so maybe there's further pretty pictures to be made. Not sure why they'd be helpful, but this is certainly cool to look at. It's amazing how much information this device throws off, and it all usually gets simplified down to Heart Rate only. Thanks at the very least for a sample project that I can use to mess with some data acquisition in the future.
- kbre93 3y agoHey no worries and thanks. It was a break-through for this project to find the H10 gives accelerometer data as well as heart rate, so that it would be possible to estimate breathing rate, which I haven't seen other apps do
- deleted 3y ago[deleted]
- shawnz 3y agoIsn't it possible to estimate breathing rate with any optical heart rate monitor? See https://en.wikipedia.org/wiki/Photoplethysmogram#Monitoring_respiration https://en.wikipedia.org/wiki/Photoplethysmogram#Monitoring_..., afaik that's how Fitbit, Apple Watch etc do it
- kbre93 3y agoYes it's common to estimate breathing rate based on the oscillations in the heart rate pattern. But estimating it from the chest expansion is a more direct method
- benjaminberlin 3y agoI never knew the H10 used an accelerometer, I wonder if they use it to help remove false reads during intense movements like those found in running.
- miketery 3y agoNice work! How do you calculate HRV from the series of heart rates? Is it taking the min and max from the latest cycle?
- kbre93 3y agoYep it's taking the difference between peaks and troughs in heart rate, for plotting with the breathing rate it looks at the min and max over the breathing cycle.
- hackernewds 3y agoSo having a very high max and very low min would equate to higher HRV, and better health? Seems a bit perfunctious
- szajbus 3y agoIt's probably good rule of thumb as the fitter you are the lower rest HR you have and your heart rate recovery rate is also higher.
- Temporary_31337 3y agoExactly. Generally the best athletes have very high max HR and low resting HR but by measuring how quickly and how low your HR goes back down after an exercise is a decent indicator for stress, overtraining etc. If your normal rHR is 55 but it only goes back down to 90 after exercise it most likely shows that you are untrained, stressed or overtraining.
- kbre93 3y agoThis is measured over a very short time scale though – so not a persons absolute max and min heart rate, just how it varies over a few seconds. And yes, higher HRV is generally healthier and points to a better balance between the fight-and-flight response, and rest-and-digest response.
- deleted 3y ago[deleted]
- guzik 3y agoI'm curious, have you explored compatibility with other hardware as well, like the Polar H7 or even other types of physiological monitors? We've conducted a study comparing Aidlab physiological monitor’s accuracy of heart rate variability measurements with the Polar H7 and found a high correlation in the data. It would be interesting to know how your app performs when paired with various hardware.
- halbritt 3y agoThe H10 is the gold standard for HRMs and the one most commonly used by anyone doing experimentation with HRV. I don't have the specs memorized off hand, by my recollection is that it does a better job of capturing the entire waveform.
- kbre93 3y agoYep that's right, and the H10 is able to stream the ECG waveform. For this project I used the inter-beat-interval that is sent however, as it means I don't have to run peak detection on the ECG to get heart rate.
- kbre93 3y agoThe H10 is a newer and better version of the H7. Because breathing rate is measured from chest expansion that is pretty easy to verify (there can be noise in the estimate of course due to movement artefacts). Heart rate estimation from the H10 is widely considered to be reliable, The H10 also offers to ability to stream the raw ecg to check this.
- aidenn0 3y agoNaming it after a song about a stalker is an interesting choice...
- ocescrundest 3y agoThanks for sharing. I've been dealing with health problems since a covid infection and have been experimenting with breath work. I haven't been able to find something that shows raw, realtime HRV data like this. I tried a HeartMath product at some point, but it was unclear what exactly it was showing and I didn't find it helpful. The Polar H10 connects to your computer via Bluetooth?
- kbre93 3y agoYep it's via bluetooth
- Alias_Knagg 3y agoYou might want to have a look at this lot. They all have their own little angle on the matter, but there could be one there that would work for you: https://www.movesense.com/showcase/ https://www.movesense.com/showcase/
- kbre93 3y agoInteresting, thanks for sharing. It's cool they do it as a platform, but I'm not sure what the benefit over using a Polar H10 would be, which are widely available, I guess it would be custom branding of the hardware
- deleted 3y ago[deleted]
- gz5 3y agoI have found HRV to be remarkably accurate at 'predicting' illness (seeming to indicate that HRV is impacted before I notice symptoms). Do others see the same? I do need to account for 3 other variables: + did i drink alcohol that night + did i eat a large meal right before bed + did i go on a long run (20+ minutes) that day Those 3 significantly decrease my HRV (alcohol the most). On the other side, not eating within ~6 hours of bedtime significantly increases my HRV, and moderate exercise increases my HRV. Curious what others are seeing? I have measured with watches and rings - both which only measure at night.
- justinwp 3y agofor me: - alcohol -- - long run or ultra race --- (takes a week to recover) - early to bed ++ - short to moderate run + my resting heart rate, sleep respiratory rate, and HRV are highly correlated
- deleted 3y ago[deleted]
- hackernewds 3y agoI have seem multiple times my HRV indicate my sickness as a leading indicator for strep, food poisoning and altitude sickness, and even for COVID. Anecdata of course
- fud101 3y agoI have a H10 and i am a tech geek. Just trying this out now will update with my findings. failed at installing, Collecting pyobjc-core==9.2 Downloading pyobjc-core-9.2.tar.gz (923 kB) ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 923.8/923.8 KB 42.8 MB/s eta 0:00:00 Installing build dependencies ... done Getting requirements to build wheel ... error error: subprocess-exited-with-error × Getting requirements to build wheel did not run successfully. │ exit code: 1 ╰─> [2 lines of output] running egg_info error: PyObjC requires macOS to build [end of output] note: This error originates from a subprocess, and is likely not a problem with pip. error: subprocess-exited-with-error × Getting requirements to build wheel did not run successfully. │ exit code: 1 ╰─> See above for output. note: This error originates from a subprocess, and is likely not a problem with pip.
- wbradley 3y ago> error: PyObjC requires macOS to build Looks like this depends on macOS.
- kbre93 3y agoThis should be fixed now. Let me know if you still have issues
- kbre93 3y agoWhat's your os? Only been test on macOS so far
- Mankaninen 3y agoI'm on Linux Mint (21.2) and get the same error. Probably macOS only. A quick reading in readthedocs confirms it is macOS only, no Linux, no Windows.
- kbre93 3y agoThis should be fixed now. Let me know if you still have issues
- 3y ago
- searealist 3y agoThanks, now I am manually breathing.
- deleted 3y ago[deleted]
- kbre93 3y agoI'm glad
- p-e-w 3y agoIt's pretty amazing how much data this relatively cheap device makes available over BLE, and how easy it is to access that data. Is there a list of health monitoring devices that can be read programmatically without requiring proprietary software or uploading data to the cloud?
- kbre93 3y agoI think most bluetooth low energy devices can be connected to quite easily programmatically as long as you know the data specification. Polar use to publish their data spec on their website but took it down a few years ago so I had to search around to find it.
- rvdca 3y agoI was hoping to intercept and reverse-engineer the protocol of the Oura rings. For some reason, I thought this kind of device would attract a lot of hackers given the platform capabilities but I could not f8nd any other documented attempt except the really thorough iFixit (destructive) teardown : https://www.ifixit.com/Teardown/Oura+Ring+2+Teardown/135207 https://www.ifixit.com/Teardown/Oura+Ring+2+Teardown/135207
- Lash-L 3y agoI know the device uses BLE - I'd start with seeing if there is any data included in the BLE broadcast
- deleted 3y ago[deleted]
- HAL9OOO 3y agoThis is really cool! I have a Wahoo Tickr sensor already, is it possible to use with that or is something missing in these other sensors that the Polar has? I'm going to try picking up a Polar for this.
- kbre93 3y agoIt currently only works with a Polar H10, which has a heart rate monitoring (ECG) and an accelerometer (for measuring breathing rate through chest expansion)
- 1024core 3y agoHas anybody used the H10 to monitor Atrial Fibrillation (aka "afib")? I'd like to use the H10 to collect data that I can share with my physician.
- anonuser123456 3y agoWhat do you expect your doc to do with the data? Are you trying to capture very infrequent events or trying to quantify your afib burden?
- rnk 3y agoI thought an apple watch identify afib history too.
- anonuser123456 3y agoYou have to know if you have afib though, which can be tough to detect for people with infrequent and self limiting cases. Example; I get bigeminy PACs, which apple watch flags as possible afib when there is noise that obscures the p-wave. But my cardiologist has seen the pattern on a more sensitive device and says it’s not afib.
- Temporary_31337 3y agoAlso one can have arrhythmia that is not afib
- 1024core 3y agoJust show him what I'm experiencing. Sometimes it's hard to describe in words; try saying this to your cardiologist: "my heart goes thump-thump and then pauses for a second and then goes thump-thump-thump in rapid succession"
- anonuser123456 3y agoGet a Kardia 6 leed ecg device (around 150 USD). They even have one that fits in your wallet. Heart rate is not enough. You need to look at the QRS and P wave via ECG.
- quijoteuniv 3y agoI would not interfere with autonomos rythim of breathing. Do check with someone that knows before you start experimenting with such a primordial and delicate system of your body! Also work on the reasons you get stressed rather than trying to supress it symptoms (is fine to be stressed if a lion is about to eat you by the way)
- Alias_Knagg 3y agoHas anyone here looked at the Movesense(1) hardware / SDK from Suunto? I have seen some claims(2) that its better than the Polar H10. There are quite a few products based on Movsense (see the showcases) but my experience with two of them is mixed. There seems to be way too much "secret sauce" involved in the processing and presentation of the results. This project looks very interesting from that perspective, but I'm unsure if it would work for the 24x7 monitoring for Cronic Fatigue I'm looking for. (never mind that it's not an app yet :-) 1 https://www.movesense.com/ https://www.movesense.com/ 2 http://www.muscleoxygentraining.com/2020/06/movesense-medical-ecg-review.html http://www.muscleoxygentraining.com/2020/06/movesense-medica...
- deleted 3y ago[deleted]
- deleted 3y ago[deleted]
- kbre93 3y agoInteresting, thanks for sharing, it looks like it has similar core sensors to the Polar H10, but I'm not sure how it compares overall
- Alias_Knagg 3y agoWell, the MD I linked to in [2] above, claims that it's more precise for HRV IIRC. Something about sample rates and filters and skewing of the waveform impacting HRV measurements since they depend on precisely locating waveform peaks. (he has a bunch of posts about the Movessense sensor, so I might not have linked the best one)
- Terho 3y agoHi, you are welcome to drop us a note directly via info@movesense.com if you want to discuss the device use in more detail. In general, there is no secret sauce at all: the sensor API is open and you get full access to raw data (ECG, 9-axis IMU at different sample rates). If you want to run your own algorithms on board, you can modify the sensor firmware (C++) with our developer tools. Companies that use Movesense sensors as a platform to develop their own commercial products naturally have their own ways of analyzing and visualizing the data they measure with the sensor. In commercial projects, companies rarely publish the algorithms they have developed, but some such cases can be found in the Movesense community. As it comes to sensor accuracy & scientific projects, here is a list of publications and validation studies: https://www.movesense.com/publications/ https://www.movesense.com/publications/ Best regards, Terho Lahtinen /Movesense
- mikae1 3y agoSo, can this monitor heart rate — entirely without smartphone apps or proprietary desktop apps — using “Every Breath You Take” and other open-source apps? EDIT: Seems like a “no”: https://support.polar.com/en/support/can_i_record_my_heart_rate_without_a_training_device_or_a_training_app https://support.polar.com/en/support/can_i_record_my_heart_r...
- deleted 3y ago[deleted]
- mpatobin 3y agoI think that link is referring to going for a workout with just the monitor itself to record your heart rate - no other devices present. You can use/build your own mobile or desktop apps without needing their software if that's what you're wondering. I made a custom iOS app for my wife and I to monitor our workouts using their SDK and I really happy with it
- kbre93 3y agoThat article is referring to the internal memory that the Polar H10 has, which can be used to store some data. But you will eventually need to connect the device to retrieve that data. You can access this data programatically with a blue-tooth-low-energy client like my application is doing (using python)
- lukko 3y agoThis is really great! Thank you. I developed a breathing app (https://www.lungy.app https://www.lungy.app) last year - we're actually doing a study at the moment looking at how heart rate variability changes with breathing exercises. We're using a polysomnograph for gathering the data at the moment - using a Polar H10 may be much simpler. Is it possible to get the raw ECG lead data, or is it just BPM at each time step?
- deleted 3y ago[deleted]
- kbre93 3y agoVery nice, yeah the Polar H10 sends raw ECG, as well as the calculated heart rate, so could be what you're looking for.
- lukko 3y agoAmazing - thanks! And for respiratory rate, are you just taking the chest rise and fall from the accelerometer? Would it be obscured by general x,y,z body movement or are you filtering it in some way? It actually looks much smoother than the trace we get from respiratory inductance plethysmography...
- kbre93 3y agoYes basically, I remove the gravity component by high pass filtering, and then take just the component of acceleration which is along the axis of chest expansion (i.e. pointing out from the sensor) off the top of my head this is the z axis. But this only works when you are sitting quite still, movement introduces a lot of noise to the acceleration
- Alias_Knagg 3y agoYou should probably also look at the Movesense sensor I brought up elsewhere in this thread. Signs are indicating (right here!) that you would find it much better supported for a case like yours :-)
- amelia12 3y ago[dead]
- zh3 3y agoPolar heart rate monitors work very well; a lot of them also have "5Khz" output which cuts out the whole bluetooth/ANT+ stack - basically they send out a short range inductive pulse at 5KHz on each heartbeat. For a simple demo, plug an old-school telephone pickup (or any old coil) into a soundcard and listen - you'll hear a short click or chirp on each heartbeat (this how most gym kit that is compatible with polar HRM's work).
- mdrzn 3y agoExtremely interesting, this kinda makes me wanna buy a Poler H10 just to keep it monitored.
- stickperson 3y agoThis looks super cool! I just tried it out and am having a hard time following the README. > The blue circle shows your breathing control What does this mean? What should I be looking at? What should I be aiming for with HRV?
- kbre93 3y agoThe blue circle is your chest expansions and so when it follows the gold circle you’re controlling your breathing well. Good hrv is above 150 ms and is shown as a green band on the bottom graph
- adamgordonbell 3y agoThis looks amazing. Have you seen benefits from HRV training? Would it work with other chest strap pulse meters?
- kbre93 3y agoThanks, I've personally found benefits from being to learn to control my breathing in stressful situations. Right now it only works with the Polar H10, but it would be possible to adapt it if other chest strap monitors have an accelerometer in them.
- alfonsodev 3y agowhat about an Apple Watch ? would it be possible to create an app for it ?
- modo_ 3y agoYou might be interested in this https://www.59breaths.app/ https://www.59breaths.app/
- steve1977 3y agoDoesn’t let you measure HRV (so easily, as an application). If you mean using the Apple Watch as the sensor. There’s a couple of HRV apps for iOS though.
- cancelself 3y agohttps://github.com/nrsh-society/zendo https://github.com/nrsh-society/zendo
- steve1977 3y agoYou can get HRV data after a “mindfulness” session, but not in realtime during the session, at least as far as I know. That’s what I meant with not so easily. I also found that the results don’t match measurements with a HR strap very well, at least for me.
- tux3 3y agoIt's an interesting fact that the heart rate increases during inspiration, and decreases during expiration, which is why you can see the red dots following the blue curve on the graph So if you breathe in a more regular way, it's also normal that your heart rate will vary a little less, since it follows your breathing cycle. There's definitely also an effect where slow, regular respiration can help with anxiety. But I'm not sure how much of what the tool is measuring is really tied to stress response, versus just demonstrating this direct inspiration/heart rate correlation
- kbre93 3y agoAs you breath more slowly, heart rate oscillations (i.e. the variability) increase, which is a reflection of the parasympathetic nervous system activating (the "rest and digest" response). This can help to mediate the stress response, which from the sympathetic nervous system or the fight-or-flight response.
- sirsinsalot 3y agoIt is interesting that I, and many others, experience our digestive cycle as anxiety. At certain points in my digestion, my HR spikes, anxiety spikes, impending doom sensations occur. These are also sensations that happen with pre-stroke SNS responses. Rest and digest, indeed!
- polishdude20 3y agoI get something similar in that I start to feel a tiredness come on about 2-5 mins before I start to get gas pains. If I don't help that gas along (by moving or pushing on my stomach) in short order, it turns into me needing to run for the toilet. It's as if the trapped gas, left untreated, triggers a rapid digestive emptying. Or, the cases where I can receive the gas, there's no other contents in the way. The cases where I can't relieve it, well, there's lots of stuff in the way. Anyways the thing is that I get super tired before the pain in my stomach is even noticed. I've become attuned to it where it now gives me anxiety when it comes on.
- stenmorten 3y agoThis looks great, I really want to try it! When trying to run it on my Mac, it crashes with the error message "Info.plist must contain an NSBluetoothAlwaysUsageDescription". I've created an issue: https://github.com/kbre93/every-breath-you-take/issues/9 https://github.com/kbre93/every-breath-you-take/issues/9
- kbre93 3y agoHi stenmorten try going into Settings > Privacy & Security > Bluetooth, and adding your terminal application or development environment to the list of applications that are allowed to use Bluetooth