pub struct FrequencyMetrics<T> {
pub lf: T,
pub hf: T,
pub vlf: T,
}Expand description
A struct representing frequency-domain heart rate variability (HRV) metrics.
The FrequencyMetrics struct holds key frequency-domain parameters that are calculated from heart rate variability (HRV) data.
These metrics are derived by analyzing the power spectral density (PSD) of the RR intervals, which can provide insights into the autonomic nervous system’s regulation of the heart and overall cardiovascular health.
These frequency-domain metrics provide a deeper understanding of heart rate variability by focusing on the different frequency bands that reflect various physiological processes and autonomic nervous system regulation.
Fields§
§lf: TLow Frequency (LF) power. Reflects sympathetic and parasympathetic balance, typically between 0.04 and 0.15 Hz.
hf: THigh Frequency (HF) power. Primarily associated with parasympathetic nervous system activity, typically between 0.15 and 0.40 Hz.
vlf: TVery Low Frequency (VLF) power. Represents the power of frequencies below 0.04 Hz, associated with long-term regulatory processes.
Implementations§
Source§impl<T: Float + Sum<T> + Copy + Debug + Signed + 'static + AddAssign + Send + Sync + FromPrimitive> FrequencyMetrics<T>
impl<T: Float + Sum<T> + Copy + Debug + Signed + 'static + AddAssign + Send + Sync + FromPrimitive> FrequencyMetrics<T>
Sourcepub fn compute_sampled(sampled_rr_intervals: &[T], rate: T) -> Self
pub fn compute_sampled(sampled_rr_intervals: &[T], rate: T) -> Self
Computes frequency-domain metrics (LF, HF, VLF) from sampled RR intervals.
The compute_sampled function computes the frequency-domain metrics of heart rate variability (HRV) using the Welch method for spectral density estimation.
It requires a list of sampled RR intervals and a specified sampling rate to estimate the power spectral density (PSD) and extract the frequency components in the low-frequency (LF), high-frequency (HF), and very low-frequency (VLF) bands.
This method employs Welch’s periodogram to calculate the spectral density, with specified frequency bands for LF, HF, and VLF, and computes the total power in these bands using trapezoidal integration.
§Parameters
sampled_rr_intervals: A slice of sampled RR intervals, representing the time differences between successive heartbeats, after being adjusted for the mean interval.rate: The sampling rate used to interpolate the RR intervals, expressed in Hz.
§Returns
A FrequencyMetrics struct containing the computed LF, HF, and VLF values, which represent the power in their respective frequency bands.
§Example
use cardio_rs::frequency_domain::FrequencyMetrics;
use cardio_rs::utils::test_data::RR_INTERVALS;
let rate = 4.0;
let frequency_metrics = FrequencyMetrics::compute_sampled(RR_INTERVALS, rate);§Notes
The frequency bands for LF, HF, and VLF are typically:
- LF: 0.04 - 0.15 Hz
- HF: 0.15 - 0.40 Hz
- VLF: 0.003 - 0.04 Hz
Sourcepub fn compute(rr_intervals: &[T], rate: T) -> Self
pub fn compute(rr_intervals: &[T], rate: T) -> Self
Computes frequency-domain metrics (LF, HF, VLF) from raw RR intervals by first interpolating them.
The compute function computes the frequency-domain metrics of heart rate variability (HRV) based on raw RR intervals by first interpolating them to a uniform 4 Hz rate.
It utilizes the compute_sampled function to estimate the spectral density of the interpolated RR intervals, providing the LF, HF, and VLF values.
§Parameters
rr_intervals: A slice of raw RR intervals, representing the time differences between successive heartbeats.rate: The sampling rate used to interpolate the RR intervals, expressed in Hz.
§Returns
A FrequencyMetrics struct containing the computed LF, HF, and VLF values, which represent the power in their respective frequency bands.
§Example
use cardio_rs::frequency_domain::FrequencyMetrics;
use cardio_rs::utils::test_data::RR_INTERVALS;
let frequency_metrics = FrequencyMetrics::compute(RR_INTERVALS, 4.);§Notes
This method interpolates the RR intervals using a specified rate (defaulted to 4 Hz) before passing them to the compute_sampled method for spectral analysis.
Trait Implementations§
Source§impl<T: Clone> Clone for FrequencyMetrics<T>
impl<T: Clone> Clone for FrequencyMetrics<T>
Source§fn clone(&self) -> FrequencyMetrics<T>
fn clone(&self) -> FrequencyMetrics<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 FrequencyMetrics<T>
impl<T: Debug> Debug for FrequencyMetrics<T>
Source§impl<T: Default> Default for FrequencyMetrics<T>
impl<T: Default> Default for FrequencyMetrics<T>
Source§fn default() -> FrequencyMetrics<T>
fn default() -> FrequencyMetrics<T>
Source§impl<T: PartialEq> PartialEq for FrequencyMetrics<T>
impl<T: PartialEq> PartialEq for FrequencyMetrics<T>
impl<T: Copy> Copy for FrequencyMetrics<T>
impl<T> StructuralPartialEq for FrequencyMetrics<T>
Auto Trait Implementations§
impl<T> Freeze for FrequencyMetrics<T>where
T: Freeze,
impl<T> RefUnwindSafe for FrequencyMetrics<T>where
T: RefUnwindSafe,
impl<T> Send for FrequencyMetrics<T>where
T: Send,
impl<T> Sync for FrequencyMetrics<T>where
T: Sync,
impl<T> Unpin for FrequencyMetrics<T>where
T: Unpin,
impl<T> UnwindSafe for FrequencyMetrics<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