pub struct ModulationSpectrum { /* private fields */ }Expand description
The magnitude spectrum of a detrended, Hann-windowed track, zero-padded
8x. Its resolution stays 1 / T; the padding samples it finer.
Implementations§
Source§impl ModulationSpectrum
impl ModulationSpectrum
Sourcepub fn magnitudes(&self) -> &[f64]
pub fn magnitudes(&self) -> &[f64]
Returns the magnitudes, one per bin from 0 Hz.
Sourcepub fn magnitude_at(&self, frequency: f64) -> f64
pub fn magnitude_at(&self, frequency: f64) -> f64
Returns the magnitude at a frequency, linearly interpolated between bins; 0 beyond the last bin.
Sourcepub fn peak(&self, lo: Hz, hi: Hz) -> Option<Hz>
pub fn peak(&self, lo: Hz, hi: Hz) -> Option<Hz>
Returns the frequency of the largest bin between lo and hi, with
no interpolation.
Sourcepub fn fundamental(&self, lo: Hz, hi: Hz) -> Option<Hz>
pub fn fundamental(&self, lo: Hz, hi: Hz) -> Option<Hz>
Returns the modulation rate between lo and hi, or None when no
line stands out, as in Self::rate.
Sourcepub fn rate(&self, lo: Hz, hi: Hz) -> Result<Estimate<Hz, Hz>, ConfidenceError>
pub fn rate(&self, lo: Hz, hi: Hz) -> Result<Estimate<Hz, Hz>, ConfidenceError>
The modulation rate between lo and hi: the strongest strict
maximum inside the range, refined by a least-squares sine fit. It
must stand LINE_PROMINENCE times above the median amplitude and
reach MIN_LINE_DEPTH. No
estimate when no line stands out or the span holds fewer than two
cycles of the rate. The spread is the resolution, 1 / T.
§Errors
Never in practice; the reasons are built from counts.
Trait Implementations§
Source§impl Clone for ModulationSpectrum
impl Clone for ModulationSpectrum
Source§impl Debug for ModulationSpectrum
impl Debug for ModulationSpectrum
Source§impl PartialEq for ModulationSpectrum
impl PartialEq for ModulationSpectrum
impl StructuralPartialEq for ModulationSpectrum
Auto Trait Implementations§
impl Freeze for ModulationSpectrum
impl RefUnwindSafe for ModulationSpectrum
impl Send for ModulationSpectrum
impl Sync for ModulationSpectrum
impl Unpin for ModulationSpectrum
impl UnsafeUnpin for ModulationSpectrum
impl UnwindSafe for ModulationSpectrum
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
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>
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>
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)
&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)
&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> ⓘ
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