pub struct Decay { /* private fields */ }Expand description
The decay of one tail: the noise floor and a decay time per fit range.
Implementations§
Source§impl Decay
impl Decay
Sourcepub fn of(tail: &[f64], rate: SampleRate) -> Self
pub fn of(tail: &[f64], rate: SampleRate) -> Self
Analyses the samples of a tail that starts at a stop.
The analysis starts at the loudest 10 ms block, which is the first block unless the tail opens with silence or a pre-delay. That block is the reference level.
- The noise floor is the mean power of the last 10 % of the tail, relative to the power of the reference block.
- A line fitted to the 10 ms block levels down to 10 dB above the floor gives the time where the decay meets the floor.
- The Schroeder integral runs from each sample to that time, plus the energy the decay would add after it at the fitted rate.
- A line fitted to the decay curve between the range limits gives
the decay time,
-60 / slope: the time a 60 dB drop takes.
A fit fails when the floor lies less than 10 dB below the bottom of its range or the curve never reaches that bottom.
Sourcepub fn floor(&self) -> Option<Decibels>
pub fn floor(&self) -> Option<Decibels>
Returns the noise floor relative to the level at the stop, or None
when the end of the tail is digital silence.
Sourcepub fn truncation(&self) -> Seconds
pub fn truncation(&self) -> Seconds
Returns the time after the stop where the integral was truncated.
Sourcepub fn t20(&self) -> Result<Seconds, DecayFailure>
pub fn t20(&self) -> Result<Seconds, DecayFailure>
Sourcepub fn t30(&self) -> Result<Seconds, DecayFailure>
pub fn t30(&self) -> Result<Seconds, DecayFailure>
Trait Implementations§
impl StructuralPartialEq for Decay
Auto Trait Implementations§
impl Freeze for Decay
impl RefUnwindSafe for Decay
impl Send for Decay
impl Sync for Decay
impl Unpin for Decay
impl UnsafeUnpin for Decay
impl UnwindSafe for Decay
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