pub struct Rms<S, D>{ /* private fields */ }
Expand description
An adaptor that yields the RMS of the signal.
The window size of the RMS detector is equal to the given ring buffer length.
Implementations§
Source§impl<S, D> Rms<S, D>
impl<S, D> Rms<S, D>
Sourcepub fn next_squared(&mut self) -> <Self as Signal>::Frame
pub fn next_squared(&mut self) -> <Self as Signal>::Frame
The same as Signal::next
but does not calculate the final square root required to
determine the RMS.
Sourcepub fn into_parts(self) -> (S, Rms<S::Frame, D>)
pub fn into_parts(self) -> (S, Rms<S::Frame, D>)
Consumes the Rms
signal and returns its inner signal S
and Rms
detector.
Trait Implementations§
Source§impl<S, D> Signal for Rms<S, D>
impl<S, D> Signal for Rms<S, D>
Source§fn is_exhausted(&self) -> bool
fn is_exhausted(&self) -> bool
Whether or not the signal is exhausted of meaningful frames. Read more
Source§fn map<M, F>(self, map: M) -> Map<Self, M, F>
fn map<M, F>(self, map: M) -> Map<Self, M, F>
A signal that maps one set of frames to another. Read more
Source§fn zip_map<O, M, F>(self, other: O, map: M) -> ZipMap<Self, O, M, F>
fn zip_map<O, M, F>(self, other: O, map: M) -> ZipMap<Self, O, M, F>
A signal that maps one set of frames to another. Read more
Source§fn add_amp<S>(self, other: S) -> AddAmp<Self, S>
fn add_amp<S>(self, other: S) -> AddAmp<Self, S>
Provides an iterator that yields the sum of the frames yielded by both
other
and self
in lock-step. Read moreSource§fn mul_amp<S>(self, other: S) -> MulAmp<Self, S>
fn mul_amp<S>(self, other: S) -> MulAmp<Self, S>
Provides an iterator that yields the product of the frames yielded by both
other
and
self
in lock-step. Read moreSource§fn offset_amp(
self,
offset: <<Self::Frame as Frame>::Sample as Sample>::Signed,
) -> OffsetAmp<Self>where
Self: Sized,
fn offset_amp(
self,
offset: <<Self::Frame as Frame>::Sample as Sample>::Signed,
) -> OffsetAmp<Self>where
Self: Sized,
Provides an iterator that offsets the amplitude of every channel in each frame of the
signal by some sample value and yields the resulting frames. Read more
Source§fn scale_amp(
self,
amp: <<Self::Frame as Frame>::Sample as Sample>::Float,
) -> ScaleAmp<Self>where
Self: Sized,
fn scale_amp(
self,
amp: <<Self::Frame as Frame>::Sample as Sample>::Float,
) -> ScaleAmp<Self>where
Self: Sized,
Produces an
Iterator
that scales the amplitude of the sample of each channel in every
Frame
yielded by self
by the given amplitude. Read moreSource§fn offset_amp_per_channel<F>(self, amp_frame: F) -> OffsetAmpPerChannel<Self, F>
fn offset_amp_per_channel<F>(self, amp_frame: F) -> OffsetAmpPerChannel<Self, F>
Produces a new
Signal
that offsets the amplitude of every Frame
in self
by the
respective amplitudes in each channel of the given amp_frame
. Read moreSource§fn scale_amp_per_channel<F>(self, amp_frame: F) -> ScaleAmpPerChannel<Self, F>
fn scale_amp_per_channel<F>(self, amp_frame: F) -> ScaleAmpPerChannel<Self, F>
Produces a new
Signal
that scales the amplitude of every Frame
in self
by the
respective amplitudes in each channel of the given amp_frame
. Read moreSource§fn from_hz_to_hz<I>(
self,
interpolator: I,
source_hz: f64,
target_hz: f64,
) -> Converter<Self, I>where
Self: Sized,
I: Interpolator,
fn from_hz_to_hz<I>(
self,
interpolator: I,
source_hz: f64,
target_hz: f64,
) -> Converter<Self, I>where
Self: Sized,
I: Interpolator,
Converts the rate at which frames of the
Signal
are yielded using interpolation. Read moreSource§fn scale_hz<I>(self, interpolator: I, multi: f64) -> Converter<Self, I>where
Self: Sized,
I: Interpolator,
fn scale_hz<I>(self, interpolator: I, multi: f64) -> Converter<Self, I>where
Self: Sized,
I: Interpolator,
Multiplies the rate at which frames of the
Signal
are yielded by the given value. Read moreSource§fn delay(self, n_frames: usize) -> Delay<Self>where
Self: Sized,
fn delay(self, n_frames: usize) -> Delay<Self>where
Self: Sized,
Delays the
Signal
by the given number of frames. Read moreSource§fn into_interleaved_samples(self) -> IntoInterleavedSamples<Self>where
Self: Sized,
fn into_interleaved_samples(self) -> IntoInterleavedSamples<Self>where
Self: Sized,
Source§fn clip_amp(
self,
thresh: <<Self::Frame as Frame>::Sample as Sample>::Signed,
) -> ClipAmp<Self>where
Self: Sized,
fn clip_amp(
self,
thresh: <<Self::Frame as Frame>::Sample as Sample>::Signed,
) -> ClipAmp<Self>where
Self: Sized,
Clips the amplitude of each channel in each
Frame
yielded by self
to the given
threshold amplitude. Read moreSource§fn inspect<F>(self, inspect: F) -> Inspect<Self, F>
fn inspect<F>(self, inspect: F) -> Inspect<Self, F>
Create a new
Signal
that calls the enclosing function on each iteration. Read moreSource§fn fork<S>(self, ring_buffer: Bounded<S>) -> Fork<Self, S>
fn fork<S>(self, ring_buffer: Bounded<S>) -> Fork<Self, S>
Forks
Self
into two signals that produce the same frames. Read moreSource§fn bus(self) -> Bus<Self>where
Self: Sized,
fn bus(self) -> Bus<Self>where
Self: Sized,
Moves the
Signal
into a Bus
from which its output may be divided into multiple other
Signal
s in the form of Output
s. Read moreSource§fn take(self, n: usize) -> Take<Self> ⓘwhere
Self: Sized,
fn take(self, n: usize) -> Take<Self> ⓘwhere
Self: Sized,
Converts the
Signal
into an Iterator
that will yield the given number for Frame
s
before returning None
. Read moreSource§fn until_exhausted(self) -> UntilExhausted<Self> ⓘwhere
Self: Sized,
fn until_exhausted(self) -> UntilExhausted<Self> ⓘwhere
Self: Sized,
Converts the
Signal
into an Iterator
yielding frames until the signal.is_exhausted()
returns true
. Read moreSource§fn buffered<S>(self, ring_buffer: Bounded<S>) -> Buffered<Self, S>
fn buffered<S>(self, ring_buffer: Bounded<S>) -> Buffered<Self, S>
Buffers the signal using the given ring buffer. Read more
Source§fn rms<S>(self, ring_buffer: Fixed<S>) -> Rms<Self, S>
fn rms<S>(self, ring_buffer: Fixed<S>) -> Rms<Self, S>
An adaptor that yields the RMS of the signal. Read more
Source§fn detect_envelope<D>(
self,
detector: Detector<Self::Frame, D>,
) -> DetectEnvelope<Self, D>
fn detect_envelope<D>( self, detector: Detector<Self::Frame, D>, ) -> DetectEnvelope<Self, D>
An adaptor that detects and yields the envelope of the signal. Read more
Auto Trait Implementations§
impl<S, D> Freeze for Rms<S, D>
impl<S, D> RefUnwindSafe for Rms<S, D>where
S: RefUnwindSafe,
<<S as Signal>::Frame as Frame>::Float: RefUnwindSafe,
<S as Signal>::Frame: RefUnwindSafe,
D: RefUnwindSafe,
impl<S, D> Send for Rms<S, D>
impl<S, D> Sync for Rms<S, D>
impl<S, D> Unpin for Rms<S, D>
impl<S, D> UnwindSafe for Rms<S, D>where
S: UnwindSafe,
<<S as Signal>::Frame as Frame>::Float: UnwindSafe,
<S as Signal>::Frame: UnwindSafe,
D: UnwindSafe,
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