API

Data import

The following functions are used to import data. They return the read data in an array.

HeartRateVariability.infileFunction
infile(file)

This function reads the data from a txt or csv file.

Arguments:

  • file: is the path of the input file
source
infile(record,annotator)

This function reads the data from a wbdb file.

Arguments:

  • record: is the name of the record
  • annotator: is the annotator of the record
Note

In order to use the infile function for wfdb files, the WFDB Software Package from Pysionet is required. See Installation for more information.

source

Analysis

The following functions are used to analyze the data using time series, frequency or nonlinear methods. Each of them returns a NamedTuple containing the results of the analysis.

HeartRateVariability.time_domainFunction
time_domain(n)

Arguments:

  • n: the array that contains the NN-inetrvals

Results:

  • mean: the mean value
  • sdnn: the standard deviation
  • rmssd: the root mean square of successive differences
  • sdsd: the standard deviation of successive differences
  • nn50: the number of successive NN intervals with an interval smaller than 50 ms
  • pnn50: the percentage of successive NN intervals with an interval smaller than 50 ms
  • nn20: the number of successive NN intervals with an interval smaller than 20 ms
  • pnn20: the percentage of successive NN intervals with an interval smaller than 20 ms
  • rRR: the percentage of relative RR intervals
source
HeartRateVariability.frequencyFunction
frequency(n)

Arguments:

  • n: the array that contains the NN-inetrvals

Results:

  • vlf: the very low-frequency power
  • lf: the low-frequency power
  • hf: the high-frequency power
  • lfhf_ratio: the lf/hf ratio
  • tp: the total power
source
HeartRateVariability.nonlinearFunction
nonlinear(n,m=2,r=6)

Arguments:

  • n: the array that contains the NN-inetrvals
  • m: the embedding dimension, default=2
  • r: the tolerance, default=6

Results:

  • apen: the approximate entropy
  • sampen: the sample entropy
  • hurst: the hurst exponent (only valid if the length of n is >= 100)
  • renyi0, renyi1, renyi2: the Rényi entropy of order 0,1 and 2
source
HeartRateVariability.geometricFunction
geometric(n,e="mean")

Arguments:

  • n: the array that contains the NN-inetrvals
  • e: the maximum distance between two intervals, default="mean" (the mean value of the succsessive differences), has to be "mean" or a number

Results:

  • poincare: the Poincaré plot
  • recurrence: the recurrence plot
source