pub enum ThresholdMethod {
Median,
MedianMad,
StandardDeviation,
Fixed,
}Expand description
Threshold calculation method (ThresholdType).
Variants§
Median
Median absolute deviation scaled (thresholdRate percent).
BIT-EXACT WITH THE LEGACY REFERENCE, AND STATISTICALLY WRONG. Computes
median(|x|) * medianFactor * scale, i.e. it MULTIPLIES by 0.6745
where the robust estimator sigma = median(|x|) / 0.6745 divides. The
resulting threshold is 1/0.6745^2 = 2.20x LOWER than the nominal
magnification_percent implies – a “500%” setting cuts at 2.27 MAD,
not 5. On real 20 kHz MED64 data that is inside the noise: measured
462 raw crossings/channel/s against 0.54 at a true 5 sigma, which the
refractory then collapses into a uniform ~50 Hz/channel on EVERY
channel, with a one-sample spike-triggered average and zero bursts.
Kept, and kept as the default, because tests/spike_detect_parity.rs
asserts equality with the reference detector and this crate’s
contract is a faithful port. Use ThresholdMethod::MedianMad to
detect actual spikes.
MedianMad
median(|x|) / 0.6745 * scale – the standard robust noise estimate,
and the same convention this crate already uses for the ASDR
auto-threshold (analysis::burst::multi, AutoThresholdBase::MedianMad).
DIVERGES FROM THE LEGACY MEDIAN PATH BY 2.20x BY DESIGN. Prefer this for analysis.
StandardDeviation
Standard deviation scaled (thresholdRate percent).
Fixed
Fixed per-channel millivolt thresholds from workflow settings.
Trait Implementations§
Source§impl Clone for ThresholdMethod
impl Clone for ThresholdMethod
impl Copy for ThresholdMethod
Source§impl Debug for ThresholdMethod
impl Debug for ThresholdMethod
impl Eq for ThresholdMethod
Source§impl PartialEq for ThresholdMethod
impl PartialEq for ThresholdMethod
impl StructuralPartialEq for ThresholdMethod
Auto Trait Implementations§
impl Freeze for ThresholdMethod
impl RefUnwindSafe for ThresholdMethod
impl Send for ThresholdMethod
impl Sync for ThresholdMethod
impl Unpin for ThresholdMethod
impl UnsafeUnpin for ThresholdMethod
impl UnwindSafe for ThresholdMethod
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