pub struct MaskParams { /* private fields */ }Expand description
Settings of the harmonic masks.
The mask of note n at frequency f and time t is
M_n(f, t) = sum_{h=1..H} exp(-(f - h f_n(t))^2 / (2 sigma^2)), where
f_n(t) follows the note’s contour. A cell lies inside a mask when the
value reaches the threshold.
Implementations§
Source§impl MaskParams
impl MaskParams
Sourcepub fn new() -> Self
pub fn new() -> Self
20 harmonics, sigma of one unpadded bin, fs / frame_len, and a
threshold of exp(-2), the mask value two sigma from a harmonic.
That covers the 4-bin main lobe of a Hann window. Zero padding narrows
the bins but not the lobe, so sigma ignores the padding.
Sourcepub fn with_harmonics(self, harmonics: usize) -> Self
pub fn with_harmonics(self, harmonics: usize) -> Self
Sets the number of harmonics H. Harmonics at or above the Nyquist
frequency are skipped.
Sourcepub fn with_sigma(self, sigma: Hz) -> Self
pub fn with_sigma(self, sigma: Hz) -> Self
Sets sigma, for example to the unison spread when it is known.
Sourcepub fn with_threshold(self, threshold: Normalized) -> Self
pub fn with_threshold(self, threshold: Normalized) -> Self
Sets the mask value a cell needs to count as inside.
Trait Implementations§
Source§impl Clone for MaskParams
impl Clone for MaskParams
impl Copy for MaskParams
Source§impl Debug for MaskParams
impl Debug for MaskParams
Source§impl Default for MaskParams
impl Default for MaskParams
Source§impl PartialEq for MaskParams
impl PartialEq for MaskParams
impl StructuralPartialEq for MaskParams
Auto Trait Implementations§
impl Freeze for MaskParams
impl RefUnwindSafe for MaskParams
impl Send for MaskParams
impl Sync for MaskParams
impl Unpin for MaskParams
impl UnsafeUnpin for MaskParams
impl UnwindSafe for MaskParams
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
impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
impl<T> CloneAny for T
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
§impl<T> Downcast for Twhere
T: Any,
impl<T> Downcast for Twhere
T: Any,
§fn into_any(self: Box<T>) -> Box<dyn Any>
fn into_any(self: Box<T>) -> Box<dyn Any>
Converts
Box<dyn Trait> (where Trait: Downcast) to Box<dyn Any>, which can then be
downcast into Box<dyn ConcreteType> where ConcreteType implements Trait.§fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>
fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>
Converts
Rc<Trait> (where Trait: Downcast) to Rc<Any>, which can then be further
downcast into Rc<ConcreteType> where ConcreteType implements Trait.§fn as_any(&self) -> &(dyn Any + 'static)
fn as_any(&self) -> &(dyn Any + 'static)
Converts
&Trait (where Trait: Downcast) to &Any. This is needed since Rust cannot
generate &Any’s vtable from &Trait’s.§fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
Converts
&mut Trait (where Trait: Downcast) to &Any. This is needed since Rust cannot
generate &mut Any’s vtable from &mut Trait’s.§impl<T> DowncastSend for T
impl<T> DowncastSend for T
§impl<T> DowncastSync for T
impl<T> DowncastSync for T
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