API
Data import
The following functions are used to import data. They return the read data in an array.
HeartRateVariability.infile
— Functioninfile(file)
This function reads the data from a txt or csv file.
Arguments:
- file: is the path of the input file
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
In order to use the infile function for wfdb files, the WFDB Software Package from Pysionet is required. See Installation for more information.
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_domain
— Functiontime_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
HeartRateVariability.frequency
— Functionfrequency(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
HeartRateVariability.nonlinear
— Functionnonlinear(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
HeartRateVariability.geometric
— Functiongeometric(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