pub struct LevelTrack { /* private fields */ }Expand description
A level track in dB, one value per HOP from start.
Implementations§
Source§impl LevelTrack
impl LevelTrack
Sourcepub fn rms(
samples: &[f64],
first: usize,
rate: SampleRate,
(from, to): (Seconds, Seconds),
f0: Hz,
periods: f64,
) -> Self
pub fn rms( samples: &[f64], first: usize, rate: SampleRate, (from, to): (Seconds, Seconds), f0: Hz, periods: f64, ) -> Self
The centred RMS of samples in dB, from from to to, over the
window of rms_window. samples starts at sample first of the
stem, so a note reads only its own span. The window shrinks at the
ends of the samples.
Sourcepub fn partials(
samples: &[f64],
offset: Seconds,
rate: SampleRate,
(from, to): (Seconds, Seconds),
partials: &[(Hz, Hz)],
) -> Result<Self, FilterError>
pub fn partials( samples: &[f64], offset: Seconds, rate: SampleRate, (from, to): (Seconds, Seconds), partials: &[(Hz, Hz)], ) -> Result<Self, FilterError>
The summed power of single partials in dB, from from to to.
Each partial is a (frequency, cutoff) pair: the zero-phase band
magnitude of band_magnitude over frequency ± cutoff, so a
track has no lag. samples starts at offset in the stem.
§Errors
Returns a FilterError when a band reaches 0 Hz or the Nyquist
frequency.
Sourcepub fn harmonic(
samples: &[f64],
first: usize,
rate: SampleRate,
(from, to): (Seconds, Seconds),
frequency: Hz,
f0: Hz,
) -> Self
pub fn harmonic( samples: &[f64], first: usize, rate: SampleRate, (from, to): (Seconds, Seconds), frequency: Hz, f0: Hz, ) -> Self
The magnitude of one harmonic in dB, from from to to: a sliding
DFT at frequency over one period of f0, centred on each frame.
The window spans a whole period of the fundamental, so every other
harmonic of the note falls on a null, and its step response rises
without overshoot, unlike a Butterworth low-pass. A partial of
amplitude A reads A, its power A^2 / 2 as the RMS track reads it.
samples starts at sample first of the stem. At the start of the
samples the window keeps its whole period and runs from the first
sample, so the nulls hold; at their end it shrinks.
Trait Implementations§
Source§impl Clone for LevelTrack
impl Clone for LevelTrack
Source§impl Debug for LevelTrack
impl Debug for LevelTrack
Source§impl PartialEq for LevelTrack
impl PartialEq for LevelTrack
impl StructuralPartialEq for LevelTrack
Auto Trait Implementations§
impl Freeze for LevelTrack
impl RefUnwindSafe for LevelTrack
impl Send for LevelTrack
impl Sync for LevelTrack
impl Unpin for LevelTrack
impl UnsafeUnpin for LevelTrack
impl UnwindSafe for LevelTrack
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