pub struct IMF {
pub data: Vec<f64>,
pub frequency: Option<Vec<f64>>,
pub amplitude: Option<Vec<f64>>,
}Expand description
Numerical tolerance for singularity detection in cubic spline interpolation
This threshold is used in the Thomas algorithm (tridiagonal matrix solver) to detect near-singular matrices that would cause numerical instability or division by zero.
§Mathematical Rationale
The value 1e-12 is chosen based on:
- Machine epsilon for f64: ~2.22e-16 (smallest representable difference)
- Safety margin: 1e-12 is ~10^4 times larger than machine epsilon
- Numerical stability: Provides buffer against round-off error accumulation
- Practical experience: Standard threshold in numerical analysis libraries
§When This Matters
Singularity occurs when:
- Input points have identical or nearly-identical x-coordinates
- Extreme spacing variations cause ill-conditioned interpolation
- Accumulated floating-point errors approach matrix degeneracy
§Trade-offs
- Smaller values (e.g., 1e-15): Risk false positives from round-off errors
- Larger values (e.g., 1e-9): May reject valid but ill-conditioned problems
- Default value (1e-12): Balances robustness with numerical accuracy
Users can override the default if they need to handle extremely ill-conditioned data. Intrinsic Mode Function (IMF) - a single component from EMD
Fields§
§data: Vec<f64>The IMF data
frequency: Option<Vec<f64>>The instantaneous frequency (if computed)
amplitude: Option<Vec<f64>>The instantaneous amplitude (if computed)
Implementations§
Source§impl IMF
impl IMF
Sourcepub fn compute_instantaneous_attributes(&mut self) -> Result<()>
pub fn compute_instantaneous_attributes(&mut self) -> Result<()>
Compute instantaneous frequency and amplitude using Hilbert transform
This method computes the analytic signal via Hilbert transform to extract:
- Instantaneous amplitude (envelope)
- Instantaneous frequency (derivative of phase)
Trait Implementations§
Auto Trait Implementations§
impl Freeze for IMF
impl RefUnwindSafe for IMF
impl Send for IMF
impl Sync for IMF
impl Unpin for IMF
impl UnwindSafe for IMF
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
Mutably borrows from an owned value. Read more
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>
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 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>
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