Struct envelope_detector::rms::Rms
[−]
[src]
pub struct Rms<F> where
F: Frame, { /* fields omitted */ }
Iteratively extracts the RMS (root mean square) envelope from a window over a signal of
sample Frame
s.
Methods
impl<F> Rms<F> where
F: Frame,
[src]
F: Frame,
fn new(n_window_frames: usize) -> Self
Construct a new Rms.
fn reset(&mut self)
Zeroes the sum and the buffer of the window
.
fn set_window_frames(&mut self, n_window_frames: usize)
Set the size of the window
as a number of frames.
If the current window length is longer than the given length, the difference will be popped
from the front of the window
while adjusting the sum
accordingly.
If the current window length is shorter than the given length, the difference will be
pushed to the front of the window
using frames at signal equilibrium.
If the length already is already correct, no re-sizing occurs.
fn window_frames(&self) -> usize
The length of the window as a number of frames.
fn next(&mut self, new_frame: F) -> F::Float
The next RMS given the new frame in the sequence.
The Rms pops its front frame and adds the new frame to the back.
The yielded RMS is the RMS of all frame squares in the window
after the new frame is
added.
Returns Frame::equilibrium
if the window
is empty.
Trait Implementations
impl<F> Mode<F> for Rms<F> where
F: Frame,
[src]
F: Frame,
fn next_frame(&mut self, frame: F) -> F
Update state that is unique to the Mode.
impl<F: Clone> Clone for Rms<F> where
F: Frame,
F::Float: Clone,
F::Float: Clone,
[src]
F: Frame,
F::Float: Clone,
F::Float: Clone,
fn clone(&self) -> Rms<F>
Returns a copy of the value. Read more
fn clone_from(&mut self, source: &Self)
1.0.0
Performs copy-assignment from source
. Read more
impl<F> Debug for Rms<F> where
F: Frame,
F::Float: Debug,
[src]
F: Frame,
F::Float: Debug,