Struct NonLinearMetrics

Source
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: T

Sample Entropy (SampEn). A measure of the regularity and complexity of the RR intervals. Lower values indicate a more regular signal.

§dfa: T

Detrended Fluctuation Analysis (DFA). A measure of long-range correlations in the RR intervals, indicating fractal-like properties of the heart rate variability signal.

§lzc: T

Lempel-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>

Source

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.

Source

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.

Source

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.

Source

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.

Source

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>

Source§

fn clone(&self) -> NonLinearMetrics<T>

Returns a duplicate of the value. Read more
1.0.0 · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl<T: Debug> Debug for NonLinearMetrics<T>

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl<T: Default> Default for NonLinearMetrics<T>

Source§

fn default() -> NonLinearMetrics<T>

Returns the “default value” for a type. Read more
Source§

impl<T: PartialEq> PartialEq for NonLinearMetrics<T>

Source§

fn eq(&self, other: &NonLinearMetrics<T>) -> bool

Tests for self and other values to be equal, and is used by ==.
1.0.0 · Source§

fn ne(&self, other: &Rhs) -> bool

Tests for !=. The default implementation is almost always sufficient, and should not be overridden without very good reason.
Source§

impl<T: Copy> Copy for NonLinearMetrics<T>

Source§

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> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. Read more
Source§

impl<T> DynClone for T
where T: Clone,

Source§

fn __clone_box(&self, _: Private) -> *mut ()

Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> IntoEither for T

Source§

fn into_either(self, into_left: bool) -> Either<Self, Self>

Converts 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 more
Source§

fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
where F: FnOnce(&Self) -> bool,

Converts 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
Source§

impl<T> Pointable for T

Source§

const ALIGN: usize

The alignment of pointer.
Source§

type Init = T

The type for initializers.
Source§

unsafe fn init(init: <T as Pointable>::Init) -> usize

Initializes a with the given initializer. Read more
Source§

unsafe fn deref<'a>(ptr: usize) -> &'a T

Dereferences the given pointer. Read more
Source§

unsafe fn deref_mut<'a>(ptr: usize) -> &'a mut T

Mutably dereferences the given pointer. Read more
Source§

unsafe fn drop(ptr: usize)

Drops the object pointed to by the given pointer. Read more
Source§

impl<T> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
Source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
Source§

impl<V, T> VZip<V> for T
where V: MultiLane<T>,

Source§

fn vzip(self) -> V