pub(crate) struct BiquadFilterNode {
channel_info: ChannelInfo,
filter: FilterType,
frequency: Param,
detune: Param,
q: Param,
gain: Param,
b0: f64,
b1: f64,
b2: f64,
a1: f64,
a2: f64,
state: SmallVec<[BiquadState; 2]>,
}Expand description
Fields§
§channel_info: ChannelInfo§filter: FilterType§frequency: Param§detune: Param§q: Param§gain: Param§b0: f64The computed filter parameter b0 This is actually b0 / a0, we pre-divide for efficiency
b1: f64The computed filter parameter b1 This is actually b1 / a0, we pre-divide for efficiency
b2: f64The computed filter parameter b2 This is actually b2 / a0, we pre-divide for efficiency
a1: f64The computed filter parameter a1 This is actually a1 / a0, we pre-divide for efficiency
a2: f64The computed filter parameter a2 This is actually a2 / a0, we pre-divide for efficiency
state: SmallVec<[BiquadState; 2]>Stored filter state, this contains the last two frames of input and output values for every channel
Implementations§
Source§impl BiquadFilterNode
impl BiquadFilterNode
pub fn new( options: BiquadFilterNodeOptions, channel_info: ChannelInfo, sample_rate: f32, ) -> Self
pub fn update_parameters(&mut self, info: &BlockInfo, tick: Tick) -> bool
Sourcefn constant_z_transform(&mut self, b0: f64)
fn constant_z_transform(&mut self, b0: f64)
Set to the constant z-transform y[n] = b0 * x[n]
Sourcefn update_coefficients(&mut self, fs: f32)
fn update_coefficients(&mut self, fs: f32)
Update the coefficients a1, a2, b0, b1, b2, given the sample_rate
See https://webaudio.github.io/web-audio-api/#filters-characteristics
Trait Implementations§
Source§impl AudioNodeCommon for BiquadFilterNode
impl AudioNodeCommon for BiquadFilterNode
fn channel_info(&self) -> &ChannelInfo
fn channel_info_mut(&mut self) -> &mut ChannelInfo
Source§impl AudioNodeEngine for BiquadFilterNode
impl AudioNodeEngine for BiquadFilterNode
fn node_type(&self) -> AudioNodeType
fn process(&mut self, inputs: Chunk, info: &BlockInfo) -> Chunk
fn get_param(&mut self, id: ParamType) -> &mut Param
Source§fn message_specific(&mut self, message: AudioNodeMessage, sample_rate: f32)
fn message_specific(&mut self, message: AudioNodeMessage, sample_rate: f32)
Messages specific to this node
fn message(&mut self, msg: AudioNodeMessage, sample_rate: f32)
fn input_count(&self) -> u32
fn output_count(&self) -> u32
Source§fn channel_count(&self) -> u8
fn channel_count(&self) -> u8
Number of input channels for each input port
fn channel_count_mode(&self) -> ChannelCountMode
fn channel_interpretation(&self) -> ChannelInterpretation
fn set_channel_interpretation(&mut self, i: ChannelInterpretation)
fn set_channel_count(&mut self, c: u8)
fn set_channel_count_mode(&mut self, m: ChannelCountMode)
Source§fn destination_data(&mut self) -> Option<Chunk>
fn destination_data(&mut self) -> Option<Chunk>
If we’re the destination node, extract the contained data
fn set_listenerdata(&mut self, _: Block)
Auto Trait Implementations§
impl Freeze for BiquadFilterNode
impl RefUnwindSafe for BiquadFilterNode
impl Send for BiquadFilterNode
impl Sync for BiquadFilterNode
impl Unpin for BiquadFilterNode
impl UnwindSafe for BiquadFilterNode
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