WorldFamousElectronics / PulseSensorPlayground

A PulseSensor library (for Arduino) that collects our most popular projects in one place.
https://PulseSensor.com
MIT License
200 stars 97 forks source link

Obtaining HRV Biofeedback from PulseSensor Serial Plotter #58

Closed georod99 closed 6 years ago

georod99 commented 6 years ago

Antecedents. HRV Biofeedback is becoming more and more frequent during therapy sessions. It is used to treat stress and many other illnesses. I refer you to the web for more information. I copy here some “clarification” I posted in another issue: People are used to measure the pulse of a person in BPM (beats per minute). This is done usually counting the beats during 15 seconds and multiplying by 4. This is an average. The device your doctor puts in your finger also gives an average number. The problem is that the frequency at which the heart beats is not constant, it increases during inspiration, and decreases during expiration. This is regulated by the Autonomic Nervous System. A good athlete can have a variation as large as 20 beats, meaning that when inspiring the heart accelerates to, let’s say, 60, and when expires descends to 40. This number, 20, is what is called HRV, or Heart Rate Variability. There are many ways to measure HRV, but when Biofeedback is attempted, it is this number that is used. When I talk about real time BPM I mean the number that one would obtain if the heart would continue beating at that frequency for one minute. In a typical Biofeedback session, the therapist asks you to breath following a pacer, and measures the HRV for that breathing frequency. This is done during several minutes. Then the pace is changed and a new value of HRV is obtained. The normal ranges measured is from 5 to 9 breaths per minute, and most individuals have a Maximum HRV at around 6 breaths per minute. Many researchers have found that when breathing at this rate (the optimal) stress is reduced. You can have more information about the benefits of biofeedback in the Internet. Now to the PulseSensor_BPM. This is the graph obtained from the PulseSensor in the Serial Plotter:

Instead of this graph, I should like to see this:

  1. Delete the blue line. It shows the BPM of the last ten seconds. This is no good for HRV analysis.
  2. Change the upper graph (IBI) to BPM (dividing 60,000 by the value of IBI (in ms). This new “staircase” would have a horizontal length and a vertical height equal to one beat.
  3. Add a sine wave with a period of 10 s. It would serve as the breathing pacer. Once this is achieved, I will post more improvements that can be made. Anyone?
biomurph commented 6 years ago

@georod99 This issue is best kept in the Heart Rate Variability Sketch repository. We are working on these improvements to the Biofeedback sketch there.