pub struct BiquadCoefs {
pub a1: f32,
pub a2: f32,
pub b0: f32,
pub b1: f32,
pub b2: f32,
}
Fields§
§a1: f32
§a2: f32
§b0: f32
§b1: f32
§b2: f32
Implementations§
Source§impl BiquadCoefs
impl BiquadCoefs
pub fn new(b0: f32, b1: f32, b2: f32, a1: f32, a2: f32) -> Self
Sourcepub fn butter_lowpass(sample_rate: f32, cutoff: f32) -> BiquadCoefs
pub fn butter_lowpass(sample_rate: f32, cutoff: f32) -> BiquadCoefs
Returns settings for a Butterworth lowpass filter. Cutoff is the -3 dB point of the filter in Hz.
Sourcepub fn calc_cascaded_butter_q(order: usize, casc_idx: usize) -> f32
pub fn calc_cascaded_butter_q(order: usize, casc_idx: usize) -> f32
Returns the Q for cascading a butterworth filter:
Sourcepub fn lowpass(sample_rate: f32, q: f32, cutoff: f32) -> BiquadCoefs
pub fn lowpass(sample_rate: f32, q: f32, cutoff: f32) -> BiquadCoefs
Returns settings for a lowpass filter with a specific q
Sourcepub fn resonator(sample_rate: f32, center: f32, bandwidth: f32) -> BiquadCoefs
pub fn resonator(sample_rate: f32, center: f32, bandwidth: f32) -> BiquadCoefs
Returns settings for a constant-gain bandpass resonator. The center frequency is given in Hz. Bandwidth is the difference in Hz between -3 dB points of the filter response. The overall gain of the filter is independent of bandwidth.
Trait Implementations§
Source§impl Clone for BiquadCoefs
impl Clone for BiquadCoefs
Source§fn clone(&self) -> BiquadCoefs
fn clone(&self) -> BiquadCoefs
Returns a duplicate of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source
. Read moreSource§impl Debug for BiquadCoefs
impl Debug for BiquadCoefs
Source§impl Default for BiquadCoefs
impl Default for BiquadCoefs
Source§fn default() -> BiquadCoefs
fn default() -> BiquadCoefs
Returns the “default value” for a type. Read more
impl Copy for BiquadCoefs
Auto Trait Implementations§
impl Freeze for BiquadCoefs
impl RefUnwindSafe for BiquadCoefs
impl Send for BiquadCoefs
impl Sync for BiquadCoefs
impl Unpin for BiquadCoefs
impl UnwindSafe for BiquadCoefs
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