pub trait Biquad<T> {
fn run(&mut self, input: T) -> T;
fn update_coefficients(&mut self, new_coefficients: Coefficients<T>);
fn replace_coefficients(
&mut self,
new_coefficients: Coefficients<T>
) -> Coefficients<T>;
fn reset_state(&mut self);
}
Expand description
The required functions of a biquad implementation
Required methods
A single iteration of a biquad, applying the filtering on the input
fn update_coefficients(&mut self, new_coefficients: Coefficients<T>)
fn update_coefficients(&mut self, new_coefficients: Coefficients<T>)
Updating of coefficients
fn replace_coefficients(
&mut self,
new_coefficients: Coefficients<T>
) -> Coefficients<T>
fn replace_coefficients(
&mut self,
new_coefficients: Coefficients<T>
) -> Coefficients<T>
Updating coefficients and returning the old ones. This is useful to avoid deallocating on the audio thread, since
the Coefficients
can then be sent to another thread for deallocation.
fn reset_state(&mut self)
fn reset_state(&mut self)
Set the internal state of the biquad to 0 without allocation.