pub struct HilbertTransform {
pub real_part: Vec<f64>,
pub imaginary_part: Vec<f64>,
pub amplitude: Vec<f64>,
pub phase: Vec<f64>,
}Expand description
Hilbert transform of a real signal, yielding the analytic signal.
The analytic signal is z[n] = x[n] + i*H{x}[n], where H{x} is the Hilbert transform. From this, instantaneous amplitude, phase, and frequency can be extracted.
Fields§
§real_part: Vec<f64>Real part of the analytic signal (original signal).
imaginary_part: Vec<f64>Imaginary part of the analytic signal (Hilbert transform).
amplitude: Vec<f64>Instantaneous amplitude (envelope).
phase: Vec<f64>Instantaneous phase in radians.
Implementations§
Source§impl HilbertTransform
impl HilbertTransform
Sourcepub fn compute(signal: &[f64]) -> Self
pub fn compute(signal: &[f64]) -> Self
Compute the Hilbert transform of signal using FFT.
Returns the analytic signal components.
Sourcepub fn instantaneous_frequency(&self, fs: f64) -> Vec<f64>
pub fn instantaneous_frequency(&self, fs: f64) -> Vec<f64>
Compute instantaneous frequency from the phase using finite differences.
fs is the sampling frequency in Hz.
Phase unwrapping is applied before differencing.
Trait Implementations§
Source§impl Clone for HilbertTransform
impl Clone for HilbertTransform
Source§fn clone(&self) -> HilbertTransform
fn clone(&self) -> HilbertTransform
Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreAuto Trait Implementations§
impl Freeze for HilbertTransform
impl RefUnwindSafe for HilbertTransform
impl Send for HilbertTransform
impl Sync for HilbertTransform
impl Unpin for HilbertTransform
impl UnsafeUnpin for HilbertTransform
impl UnwindSafe for HilbertTransform
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<SS, SP> SupersetOf<SS> for SPwhere
SS: SubsetOf<SP>,
impl<SS, SP> SupersetOf<SS> for SPwhere
SS: SubsetOf<SP>,
Source§fn to_subset(&self) -> Option<SS>
fn to_subset(&self) -> Option<SS>
The inverse inclusion map: attempts to construct
self from the equivalent element of its
superset. Read moreSource§fn is_in_subset(&self) -> bool
fn is_in_subset(&self) -> bool
Checks if
self is actually part of its subset T (and can be converted to it).Source§fn to_subset_unchecked(&self) -> SS
fn to_subset_unchecked(&self) -> SS
Use with care! Same as
self.to_subset but without any property checks. Always succeeds.Source§fn from_subset(element: &SS) -> SP
fn from_subset(element: &SS) -> SP
The inclusion map: converts
self to the equivalent element of its superset.