HRVKit (libHRVKit) is an iOS static library for performing heart rate
variability analysis on heart rate interval (R-R) data. It is highly
optimized, validated, thread-safe, and suitable for continous HRV
monitoring using an iOS device. The main workhorse is the HRVAnalysis
class which accepts R-R intervals (in seconds) and performs all
necessary calculations. These include:
Filtering irregular(ectopic) beats using a modified low pass
filter.
Resampling the R-R intervals to 4Hz using cubic spline
interpolation.
Detrending the data. Necessary to remove the VLF (very low
frequency) component.
Extracting time-based statistics.
Performing a frequency-based analysis to extract power
spectral density componets.
Time-based statistics include:
Standard Deviation
RMSSD - The root mean square of successive deviations.
pNN50 - The percentage of successive invervals greater than
50 ms.
Frequency-based measures include:
LF - The low frequency (.04 - .15 Hz) energy component in
ms2.
HF - The high frequency (.15 - .4 Hz) energy component in
ms2.
fHF - The frequency in Hz at which the greatest HF spectral
energy is observed.
Breath Rate - The frequency in Hz between .15 - 1.5 Hz at
which greatest spectral energy is observed. This roughly translates to
the breathing rate.
Complete PSD spectrogram. Power spectral density (in sec2)
between 0 - 2Hz. All of the above measures are derived from this.
These results are encapsulated within the HRVResults class which
is broadcast via NSNotificationCenter as accumulated R-R intervals are
processed. In a typical, continuous monitoring scenario, the first
HRVResult will be broadcast following a 64 second initialization.
Subsequent broadcasts will be performed every 3 seconds. In addition,
an instantaneous HRVResult can be calculated using the accumulated
results up to that point. This is more suitable for a one-off
calculation in which R-R data is provided all at once and then a single
result is required.