VMDConfig

Struct VMDConfig 

#[non_exhaustive]
pub struct VMDConfig { pub num_modes: usize, pub alpha: AlphaSpec, pub tau: f64, pub tolerance: f64, pub max_iterations: usize, pub init: ModeInitialization, pub dc_mode: bool, pub random_seed: Option<u64>, }
Expand description

Configuration for vmd.

Construct via VMDConfig::default and chain with_* setters; the struct is #[non_exhaustive] so struct-literal construction from outside the crate is blocked.

Fields (Non-exhaustive)§

This struct is marked as non-exhaustive
Non-exhaustive structs could have additional fields added in future. Therefore, non-exhaustive structs cannot be constructed in external crates using the traditional Struct { .. } syntax; cannot be matched against without a wildcard ..; and struct update syntax will not work.
§num_modes: usize

Number of modes to extract. Must be ≥ 1. Default 5.

§alpha: AlphaSpec

Bandwidth-constraint parameter α. Default AlphaSpec::PaperDefault (α = 2000).

§tau: f64

Dual-ascent step size τ. 0.0 (default) drops the constraint Σ_k u_k = x: the Lagrange multiplier λ stays at zero and only the per-mode bandwidth-penalty quadratic acts, so reconstruction is approximate (~1e-4 on the paper’s three-tone signal) but ADMM converges in fewer iterations. The paper calls this the “noise tolerance” setting because it lets the algorithm soak constraint violations rather than enforcing equality. Positive τ engages dual ascent and drives Σ u_k → x to within tolerance — required for round-trip fidelity (τ = 0.5 reaches < 1e-6 in the paper_3_4_reconstruction_below_1e_minus_6_with_dual_ascent test). Use τ > 0 when you need exact reconstruction; keep τ = 0 when you only care about the mode shapes / center frequencies and want the faster path.

§tolerance: f64

ADMM convergence threshold on Σ_k ‖û_k^{n+1} − û_k^n‖² / ‖û_k^n‖². Default 1e-7.

§max_iterations: usize

Maximum ADMM iterations. Default 500.

§init: ModeInitialization

Center-frequency initialization scheme. Default ModeInitialization::LinearSpaced.

§dc_mode: bool

Force the first mode’s center frequency to 0 and skip its centroid update entirely. Default false.

Note: the (corrected) centroid update already includes the DC bin in its denominator, so any mode that picks up DC/trend energy will naturally anchor near ω = 0 without this flag — dc_mode = false is the right choice for most decompositions, including signals with a constant offset.

Set dc_mode = true only when you need to guarantee a slot at ω = 0 regardless of what the data does. Useful when (a) trend energy is small enough that another mode could otherwise win the centroid race for the lowest slot, or (b) you want a stable, reproducible “trend mode” placement across runs on related signals where DC content varies.

§random_seed: Option<u64>

Seed for ModeInitialization::Uniform. Ignored otherwise. None falls back to a fixed sentinel (0xVMD_DEFAULT) so a default Uniform run is reproducible across processes; set explicitly for independent draws.

Implementations§

§

impl VMDConfig

pub fn with_num_modes(self, num_modes: usize) -> Self

Override the number of modes K.

pub fn with_alpha(self, alpha: AlphaSpec) -> Self

Override the bandwidth-constraint specification.

pub fn with_tau(self, tau: f64) -> Self

Override the dual-ascent step τ.

pub fn with_tolerance(self, tolerance: f64) -> Self

Override the convergence tolerance.

pub fn with_max_iterations(self, max_iterations: usize) -> Self

Override the maximum ADMM iteration count.

pub fn with_init(self, init: ModeInitialization) -> Self

Override the center-frequency initialization scheme.

pub fn with_dc_mode(self, dc_mode: bool) -> Self

Toggle DC mode (forces ω_0 = 0).

pub fn with_seed(self, seed: u64) -> Self

Set the seed used by ModeInitialization::Uniform.

Trait Implementations§

§

impl Clone for VMDConfig

§

fn clone(&self) -> VMDConfig

Returns a duplicate of the value. Read more
1.0.0§

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

Performs copy-assignment from source. Read more
§

impl Debug for VMDConfig

§

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

Formats the value using the given formatter. Read more
§

impl Default for VMDConfig

§

fn default() -> Self

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

Auto Trait Implementations§

Blanket Implementations§

§

impl<T> Any for T
where T: 'static + ?Sized,

§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
§

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

§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
§

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

§

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

Mutably borrows from an owned value. Read more
§

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

§

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
§

impl<T> From<T> for T

§

fn from(t: T) -> T

Returns the argument unchanged.

§

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

§

fn into(self) -> U

Calls U::from(self).

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

§

impl<T> IntoEither for T

§

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
§

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
§

impl<T> Pointable for T

§

const ALIGN: usize

The alignment of pointer.
§

type Init = T

The type for initializers.
§

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

Initializes a with the given initializer. Read more
§

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

Dereferences the given pointer. Read more
§

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

Mutably dereferences the given pointer. Read more
§

unsafe fn drop(ptr: usize)

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

impl<T> Same for T

§

type Output = T

Should always be Self
§

impl<SS, SP> SupersetOf<SS> for SP
where SS: SubsetOf<SP>,

§

fn to_subset(&self) -> Option<SS>

The inverse inclusion map: attempts to construct self from the equivalent element of its superset. Read more
§

fn is_in_subset(&self) -> bool

Checks if self is actually part of its subset T (and can be converted to it).
§

fn to_subset_unchecked(&self) -> SS

Use with care! Same as self.to_subset but without any property checks. Always succeeds.
§

fn from_subset(element: &SS) -> SP

The inclusion map: converts self to the equivalent element of its superset.
§

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

§

type Owned = T

The resulting type after obtaining ownership.
§

fn to_owned(&self) -> T

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

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

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

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

§

type Error = Infallible

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

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

Performs the conversion.
§

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

§

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

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

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

Performs the conversion.
§

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

§

fn vzip(self) -> V

§

impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
where ST: ?Sized, DT: ?Sized,

§

impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
where ST: ?Sized, DT: ?Sized,

§

impl<T> Read<Exclusive, BecauseExclusive> for T
where T: ?Sized,