[][src]Struct dasp::envelope::Detector

pub struct Detector<F, D> where
    D: Detect<F>,
    F: Frame
{ /* fields omitted */ }

A type that can be used to detect the envelope of a signal.

Implementations

impl<F, R> Detector<F, Peak<R>> where
    F: Frame,
    R: Rectifier<F>, 
[src]

pub fn peak_from_rectifier(
    rectifier: R,
    attack_frames: f32,
    release_frames: f32
) -> Detector<F, Peak<R>>
[src]

Construct a new Peak Detector that uses the given rectifier.

Required Features

  • When using dasp_envelope, this item requires the peak feature to be enabled.
  • When using dasp, this item requires the envelope-peak feature to be enabled.

impl<F> Detector<F, Peak<FullWave>> where
    F: Frame
[src]

pub fn peak(
    attack_frames: f32,
    release_frames: f32
) -> Detector<F, Peak<FullWave>>
[src]

Construct a new full wave Peak Detector.

Required Features

  • When using dasp_envelope, this item requires the peak feature to be enabled.
  • When using dasp, this item requires the envelope-peak feature to be enabled.

impl<F> Detector<F, Peak<PositiveHalfWave>> where
    F: Frame
[src]

pub fn peak_positive_half_wave(
    attack_frames: f32,
    release_frames: f32
) -> Detector<F, Peak<PositiveHalfWave>>
[src]

Construct a new positive half wave Peak Detector.

Required Features

  • When using dasp_envelope, this item requires the peak feature to be enabled.
  • When using dasp, this item requires the envelope-peak feature to be enabled.

impl<F> Detector<F, Peak<NegativeHalfWave>> where
    F: Frame
[src]

pub fn peak_negative_half_wave(
    attack_frames: f32,
    release_frames: f32
) -> Detector<F, Peak<NegativeHalfWave>>
[src]

Construct a new positive half wave Peak Detector.

Required Features

  • When using dasp_envelope, this item requires the peak feature to be enabled.
  • When using dasp, this item requires the envelope-peak feature to be enabled.

impl<F, S> Detector<F, Rms<F, S>> where
    F: Frame,
    S: Slice<Element = <F as Frame>::Float> + SliceMut
[src]

pub fn rms(
    buffer: Fixed<S>,
    attack_frames: f32,
    release_frames: f32
) -> Detector<F, Rms<F, S>>
[src]

Construct a new Rms Detector.

Required Features

  • When using dasp_envelope, this item requires the rms feature to be enabled.
  • When using dasp, this item requires the envelope-rms feature to be enabled.

impl<F, D> Detector<F, D> where
    D: Detect<F>,
    F: Frame
[src]

pub fn new(detect: D, attack_frames: f32, release_frames: f32) -> Detector<F, D>[src]

Construct a Detector with the given Detect implementation.

pub fn set_attack_frames(&mut self, frames: f32)[src]

Set the Detector's attack time as a number of frames.

pub fn set_release_frames(&mut self, frames: f32)[src]

Set the Detector's release time as a number of frames.

pub fn next(&mut self, frame: F) -> <D as Detect<F>>::Output[src]

Given the next input signal frame, detect and return the next envelope frame.

Trait Implementations

impl<F, D> Clone for Detector<F, D> where
    D: Clone + Detect<F>,
    F: Clone + Frame,
    <D as Detect<F>>::Output: Clone
[src]

impl<F, D> Debug for Detector<F, D> where
    D: Debug + Detect<F>,
    F: Debug + Frame,
    <D as Detect<F>>::Output: Debug
[src]

Auto Trait Implementations

impl<F, D> RefUnwindSafe for Detector<F, D> where
    D: RefUnwindSafe,
    <D as Detect<F>>::Output: RefUnwindSafe

impl<F, D> Send for Detector<F, D> where
    D: Send,
    <D as Detect<F>>::Output: Send

impl<F, D> Sync for Detector<F, D> where
    D: Sync,
    <D as Detect<F>>::Output: Sync

impl<F, D> Unpin for Detector<F, D> where
    D: Unpin,
    <D as Detect<F>>::Output: Unpin

impl<F, D> UnwindSafe for Detector<F, D> where
    D: UnwindSafe,
    <D as Detect<F>>::Output: UnwindSafe

Blanket Implementations

impl<T> Any for T where
    T: 'static + ?Sized
[src]

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

impl<S, T> Duplex<S> for T where
    T: FromSample<S> + ToSample<S>, 
[src]

impl<T> From<T> for T[src]

impl<S> FromSample<S> for S[src]

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

impl<T> ToOwned for T where
    T: Clone
[src]

type Owned = T

The resulting type after obtaining ownership.

impl<T, U> ToSample<U> for T where
    U: FromSample<T>, 
[src]

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.