<p>A variety of packages exist that allow the calculation of these metrics. I will describe these packages by category:</p>

<h3>Software</h3>

<ul>
<li>Kubios is a program from Finland that has a nice <a href="https://i.sstatic.net/9DJwk.png" rel="nofollow noreferrer">GUI</a>, in which you can import both ECG data or IBI (not PPG), to calculate all the metrics. They support some a variety of file-formats, but you can import any other text-file with some additional specifications (e.g. the time indices). The software allows several settings for filtering e.g., and allows you to easily segment and analyse the data. However, batch analyses are not possible, so all the steps must be repeated for every subject.<br>
<em>NB. The website has gone offline just this week. The software (for both Mac OS and Windows) can still be downloaded though. Ping me in the Axon Terminal and I'll send you the links.</em><br>
*NNB. Kubios now links to a <a href="https://www.facebook.com/kubios" rel="nofollow noreferrer">Facebook page</a>. They are currently working on a new release. *</li>
<li><a href="https://github.com/milegroup/ghrv" rel="nofollow noreferrer">gHRV</a> is implemented in Python and works with a <a href="http://milegroup.github.io/ghrv/docfigures/Figure12.jpg" rel="nofollow noreferrer">GUI</a> (<a href="https://milegroup.github.io/ghrv/doc.html" rel="nofollow noreferrer">website</a>). Some typical formats are accepted, including IBIs in an ASCII text format. However, it cannot read the time indices. Therefore, the program will not know whether or when R-peaks and, subsequently, IBIs were missed (compare <a href="https://i.sstatic.net/fvgvk.png" rel="nofollow noreferrer">true data in Kubios</a> vs <a href="https://i.sstatic.net/FrdlL.png" rel="nofollow noreferrer">gHRV loaded</a>). Interpolation and time, frequency and non-linear analyses are possible. </li>
</ul>

<h2>Python</h2>

<ul>
<li>gHRV can also be used in Python itself with the source code. This give you more flexibility and allows you to batch analyze your data. I have not been able to test this, however. </li>
<li><a href="https://github.com/rhenanbartels/hrv" rel="nofollow noreferrer">hrv</a> is a module that is currently being developed by Rhenan Bartels. At the moment, only simple time domain analyses are possible which works well with complete IBI datasets. At the moment of typing, Rhenan is developing a frequency domain analysis, and he will implement a way to interpolate missing data. He is also open to suggestions if you need a particular functionality. </li>
</ul>

<h2>R</h2>

<ul>
<li><a href="http://rhrv.r-forge.r-project.org/" rel="nofollow noreferrer">RHRV</a> is a complete R-package that organizes the data in a structured way. You need to import the IBIs or time indices of the beats (or some device specific files), after which all metrics can be calculated. There are also filtering methods and allows easy manual removal of outliers in GUI if necessary. The package is documented well and there are some video tutorials. </li>
</ul>

<h2>Matlab</h2>

<ul>
<li><a href="https://github.com/jramshur/HRVAS" rel="nofollow noreferrer">HRV Analysis Software</a> (HRVAS) 

<blockquote>
  <p>is a heart rate variability (HRV) analysis tool developed using MATLAB. HRVAS can detrend and filter IBI and can perform time domain, frequency domain, time-frequency, Poincare', and nonlinear HRV analysis <a href="https://sourceforge.net/projects/hrvas/" rel="nofollow noreferrer">(From website)</a>.</p>
</blockquote></li>
</ul>

CC BY-SA 3.0
2016-10-28T09:40:09.450Z
Another excellent question and answer Robin!
Comte
CC BY-SA 3.0
2016-10-26T17:51:06.513Z
2016-10-31T14:52:21.740Z
2016-10-31T14:52:21.740Z
Robin Kramer-ten Have
<blockquote>
<p>Heart rate variability (HRV), the change in the time intervals between adjacent heartbeats, is an emergent property of interdependent regulatory systems that operate on different time scales to adapt to challenges and achieve optimal performance (<a href="http://journal.frontiersin.org/article/10.3389/fpsyg.2014.01040" rel="nofollow noreferrer">Shaffer et al., 2014</a>).</p>
</blockquote>
<p>In laymen terms, HRV is a measure of effort and exertion, either physical or mental. The time intervals between adjacent heartbeats, <a href="https://cogsci.stackexchange.com/questions/16076/what-is-the-difference-between-rr-intervals-and-nn-intervals-in-hrv-data">also referred to as RR intervals, NN intervals or InterBeat Intervals (IBI)</a>, are determined based on peak values in physiological signals. The IBI can be determined with either electrocardiogram (ECG) and photoplethysmography (PPG; <a href="http://hamlyn.doc.ic.ac.uk/bsn2014/poster/BSN2014-poster09p-maeda.pdf" rel="nofollow noreferrer">Madea et al., n.d.</a>; see Figure 1).
<a href="https://i.sstatic.net/82fcm.jpg" rel="nofollow noreferrer"><img src="https://i.sstatic.net/82fcm.jpg" alt="enter image description here" /></a><br />
Figure 1: ECG (top) and PPG (bottom) patterns and the marked intervals.</p>
<p>With these IBIs, different metrics of HRV can be calculated. These metrics can be subdivided into the time domain (e.g. mean RR, SDRR), frequency domain (e.g. high- and low frequency, or HF/LF) and non-linear metrics (For a review, see Shaffer et al., 2004). The analysis is not straightforward, however, but require some complex calculations.</p>
<p><strong>What are some freely available software packages that allow easy calculation of these metrics?</strong></p>
<hr />
<h3>References</h3>
<p><a href="http://hamlyn.doc.ic.ac.uk/bsn2014/poster/BSN2014-poster09p-maeda.pdf" rel="nofollow noreferrer">Yuka Maeda, Masaki Sekine, Toshiyo Tamura, Koichi Mizutani (n.d.). Evaluation of green light PPG in Heart Rate Variability parameters.</a></p>
<p><a href="http://journal.frontiersin.org/article/10.3389/fpsyg.2014.01040" rel="nofollow noreferrer">Shaffer, F., McCraty, R., &amp; Zerr, C. L. (2014). A healthy heart is not a metronome: an integrative review of the heart's anatomy and heart rate variability. Frontiers in psychology, 5, 1040.</a></p>

<data><analysis><workload><heart-rate-variability><ecg>
Open source software for analyzing Heart Rate Variability (HRV)
Robin Kramer-ten Have
# Open source software for analyzing Heart Rate Variability (HRV)

(Asked by: username_0 on 2016-10-26)

> Heart rate variability (HRV), the change in the time intervals between adjacent heartbeats, is an emergent property of interdependent regulatory systems that operate on different time scales to adapt to challenges and achieve optimal performance ([Shaffer et al., 2014](http://journal.frontiersin.org/article/10.3389/fpsyg.2014.01040)).

In laymen terms, HRV is a measure of effort and exertion, either physical or mental. The time intervals between adjacent heartbeats, [also referred to as RR intervals, NN intervals or InterBeat Intervals (IBI)](https://cogsci.stackexchange.com/questions/16076/what-is-the-difference-between-rr-intervals-and-nn-intervals-in-hrv-data), are determined based on peak values in physiological signals. The IBI can be determined with either electrocardiogram (ECG) and photoplethysmography (PPG; [Madea et al., n.d.](http://hamlyn.doc.ic.ac.uk/bsn2014/poster/BSN2014-poster09p-maeda.pdf); see Figure 1).
[![enter image description here](https://i.sstatic.net/82fcm.jpg)](https://i.sstatic.net/82fcm.jpg)  
Figure 1: ECG (top) and PPG (bottom) patterns and the marked intervals.

With these IBIs, different metrics of HRV can be calculated. These metrics can be subdivided into the time domain (e.g. mean RR, SDRR), frequency domain (e.g. high- and low frequency, or HF/LF) and non-linear metrics (For a review, see Shaffer et al., 2004). The analysis is not straightforward, however, but require some complex calculations.

**What are some freely available software packages that allow easy calculation of these metrics?**

---

### References

[Yuka Maeda, Masaki Sekine, Toshiyo Tamura, Koichi Mizutani (n.d.). Evaluation of green light PPG in Heart Rate Variability parameters.](http://hamlyn.doc.ic.ac.uk/bsn2014/poster/BSN2014-poster09p-maeda.pdf)

[Shaffer, F., McCraty, R., & Zerr, C. L. (2014). A healthy heart is not a metronome: an integrative review of the heart's anatomy and heart rate variability. Frontiers in psychology, 5, 1040.](http://journal.frontiersin.org/article/10.3389/fpsyg.2014.01040)

**Tags:** data, analysis, workload, heart-rate-variability, ecg


---

## 1 answers

### Answer by username_0 on 2016-10-26. Score: 3

A variety of packages exist that allow the calculation of these metrics. I will describe these packages by category:

### Software

* Kubios is a program from Finland that has a nice [GUI](https://i.sstatic.net/9DJwk.png), in which you can import both ECG data or IBI (not PPG), to calculate all the metrics. They support some a variety of file-formats, but you can import any other text-file with some additional specifications (e.g. the time indices). The software allows several settings for filtering e.g., and allows you to easily segment and analyse the data. However, batch analyses are not possible, so all the steps must be repeated for every subject.  
  *NB. The website has gone offline just this week. The software (for both Mac OS and Windows) can still be downloaded though. Ping me in the Axon Terminal and I'll send you the links.*  
  \*NNB. Kubios now links to a [Facebook page](https://www.facebook.com/kubios). They are currently working on a new release. \*
* [gHRV](https://github.com/milegroup/ghrv) is implemented in Python and works with a [GUI](http://milegroup.github.io/ghrv/docfigures/Figure12.jpg) ([website](https://milegroup.github.io/ghrv/doc.html)). Some typical formats are accepted, including IBIs in an ASCII text format. However, it cannot read the time indices. Therefore, the program will not know whether or when R-peaks and, subsequently, IBIs were missed (compare [true data in Kubios](https://i.sstatic.net/fvgvk.png) vs [gHRV loaded](https://i.sstatic.net/FrdlL.png)). Interpolation and time, frequency and non-linear analyses are possible.

## Python

* gHRV can also be used in Python itself with the source code. This give you more flexibility and allows you to batch analyze your data. I have not been able to test this, however.
* [hrv](https://github.com/rhenanbartels/hrv) is a module that is currently being developed by Rhenan Bartels. At the moment, only simple time domain analyses are possible which works well with complete IBI datasets. At the moment of typing, Rhenan is developing a frequency domain analysis, and he will implement a way to interpolate missing data. He is also open to suggestions if you need a particular functionality.

## R

* [RHRV](http://rhrv.r-forge.r-project.org/) is a complete R-package that organizes the data in a structured way. You need to import the IBIs or time indices of the beats (or some device specific files), after which all metrics can be calculated. There are also filtering methods and allows easy manual removal of outliers in GUI if necessary. The package is documented well and there are some video tutorials.

## Matlab

* [HRV Analysis Software](https://github.com/jramshur/HRVAS) (HRVAS)
  > is a heart rate variability (HRV) analysis tool developed using MATLAB. HRVAS can detrend and filter IBI and can perform time domain, frequency domain, time-frequency, Poincare', and nonlinear HRV analysis [(From website)](https://sourceforge.net/projects/hrvas/).

> **Comments:**
> **username_1**: Another excellent question and answer Robin!  

---

