Open source software for analyzing Heart Rate Variability (HRV) 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).

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), 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.; see Figure 1).

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.
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 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, 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. They are currently working on a new release. *
gHRV is implemented in Python and works with a GUI (website). 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 vs gHRV loaded). 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 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 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 (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).