pub struct NonLinearMetrics<T> {
pub samp_en: T,
pub dfa: T,
pub lzc: T,
}Expand description
A struct representing various non-linear heart rate variability (HRV) metrics.
The NonLinearMetrics struct holds key HRV parameters computed from RR intervals using non-linear techniques.
These metrics provide insight into the complexity and fractal characteristics of heart rate dynamics, which reflect autonomic nervous system regulation of the heart.
These non-linear metrics are important for understanding the self-organizing behavior of the cardiovascular system over time.
Fields§
§samp_en: TSample Entropy (SampEn). A measure of the regularity and complexity of the RR intervals. Lower values indicate a more regular signal.
dfa: TDetrended Fluctuation Analysis (DFA). A measure of long-range correlations in the RR intervals, indicating fractal-like properties of the heart rate variability signal.
lzc: TLempel-Ziv Complexity (LZC). A measure of the signal’s complexity based on the number of distinct patterns present in the RR intervals.
Implementations§
Source§impl<T: Float + Sum<T> + Copy + Debug + AddAssign> NonLinearMetrics<T>
impl<T: Float + Sum<T> + Copy + Debug + AddAssign> NonLinearMetrics<T>
Sourcepub fn compute_default(rr_intervals: &[T]) -> Self
pub fn compute_default(rr_intervals: &[T]) -> Self
Computes various non-linear HRV metrics from the given RR intervals with default parameters.
The function calculates the following HRV metrics:
- SampEn (Sample Entropy): A measure of regularity and complexity of the signal.
- DFA (Detrended Fluctuation Analysis): A measure of long-range correlations in the RR intervals.
- LZC (Lempel-Ziv Complexity): A measure of the signal’s complexity based on the number of distinct patterns.
§Arguments
rr_intervals- A slice of RR intervals representing the time between successive heartbeats (in milliseconds).
§Returns
Returns a NonLinearMetrics struct containing the computed non-linear HRV metrics.
Sourcepub fn compute(
rr_intervals: &[T],
tolerance: &T,
scales: Option<&[usize]>,
) -> Self
pub fn compute( rr_intervals: &[T], tolerance: &T, scales: Option<&[usize]>, ) -> Self
Computes various non-linear HRV metrics from the given RR intervals with custom tolerance and scales.
The function calculates the following HRV metrics:
- SampEn (Sample Entropy): A measure of regularity and complexity of the signal.
- DFA (Detrended Fluctuation Analysis): A measure of long-range correlations in the RR intervals.
- LZC (Lempel-Ziv Complexity): A measure of the signal’s complexity based on the number of distinct patterns.
§Arguments
rr_intervals- A slice of RR intervals representing the time between successive heartbeats (in milliseconds).tolerance- A tolerance value used for calculating sample entropy.scales- An optional list of scale sizes to be used for DFA calculation.
§Returns
Returns a NonLinearMetrics struct containing the computed non-linear HRV metrics.
Sourcepub fn compute_samp_en(rr_intervals: &[T], tolerance: &T) -> T
pub fn compute_samp_en(rr_intervals: &[T], tolerance: &T) -> T
Computes the Sample Entropy (SampEn) from the given RR intervals and tolerance value.
SampEn is a measure of the complexity and regularity of the time series. Lower values indicate a more regular signal, while higher values suggest more complexity.
§Arguments
rr_intervals- A slice of RR intervals representing the time between successive heartbeats.tolerance- A tolerance value used to define how similar two sequences must be to be considered similar.
§Returns
Returns the Sample Entropy (SampEn) of the RR intervals as a floating point value.
Sourcepub fn compute_dfa(rr_intervals: &[T], scales: Option<&[usize]>) -> T
pub fn compute_dfa(rr_intervals: &[T], scales: Option<&[usize]>) -> T
Computes the Detrended Fluctuation Analysis (DFA) from the given RR intervals and scale values.
DFA measures the long-range correlations in the RR intervals, indicating fractal-like properties of heart rate variability. This method applies linear regression to segments of the data and calculates the fluctuation at each scale.
§Arguments
rr_intervals- A slice of RR intervals representing the time between successive heartbeats.scales- An optional slice of scale sizes to use for DFA. If None, scales are generated automatically.
§Returns
Returns the scaling exponent (α) from DFA, indicating the long-term correlation.
Sourcepub fn compute_lzc(rr_intervals: &[T]) -> T
pub fn compute_lzc(rr_intervals: &[T]) -> T
Computes the Lempel-Ziv Complexity (LZC) of the RR intervals.
LZC is a measure of the complexity of a binary sequence generated from the RR intervals. It quantifies the number of distinct patterns that appear in the binary sequence.
§Arguments
rr_intervals- A slice of RR intervals representing the time between successive heartbeats.
§Returns
Returns the Lempel-Ziv Complexity (LZC) as a floating point value.
Trait Implementations§
Source§impl<T: Clone> Clone for NonLinearMetrics<T>
impl<T: Clone> Clone for NonLinearMetrics<T>
Source§fn clone(&self) -> NonLinearMetrics<T>
fn clone(&self) -> NonLinearMetrics<T>
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreSource§impl<T: Debug> Debug for NonLinearMetrics<T>
impl<T: Debug> Debug for NonLinearMetrics<T>
Source§impl<T: Default> Default for NonLinearMetrics<T>
impl<T: Default> Default for NonLinearMetrics<T>
Source§fn default() -> NonLinearMetrics<T>
fn default() -> NonLinearMetrics<T>
Source§impl<T: PartialEq> PartialEq for NonLinearMetrics<T>
impl<T: PartialEq> PartialEq for NonLinearMetrics<T>
impl<T: Copy> Copy for NonLinearMetrics<T>
impl<T> StructuralPartialEq for NonLinearMetrics<T>
Auto Trait Implementations§
impl<T> Freeze for NonLinearMetrics<T>where
T: Freeze,
impl<T> RefUnwindSafe for NonLinearMetrics<T>where
T: RefUnwindSafe,
impl<T> Send for NonLinearMetrics<T>where
T: Send,
impl<T> Sync for NonLinearMetrics<T>where
T: Sync,
impl<T> Unpin for NonLinearMetrics<T>where
T: Unpin,
impl<T> UnwindSafe for NonLinearMetrics<T>where
T: UnwindSafe,
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more