Skip to main content

BiquadCascade

Struct BiquadCascade 

Source
pub struct BiquadCascade<const COEFFS_LEN: usize, const STATE_LEN: usize> {
    pub coeffs: [f32; COEFFS_LEN],
    pub state: [f32; STATE_LEN],
    /* private fields */
}
Expand description

Compile-time fixed-size Biquad Cascade Direct Form I filter holding its state buffer.

Fields§

§coeffs: [f32; COEFFS_LEN]§state: [f32; STATE_LEN]

Implementations§

Source§

impl<const COEFFS_LEN: usize, const STATE_LEN: usize> BiquadCascade<COEFFS_LEN, STATE_LEN>

Source

pub fn new(coeffs: [f32; COEFFS_LEN]) -> Self

Create a new Biquad cascade filter given coefficients and number of stages.

Examples found in repository?
examples/filter_workbench_and_analysis.rs (line 189)
23fn main() {
24    println!("===============================================================================");
25    println!("      embedded-dsp Filter Design, Analysis & Verification Workbench            ");
26    println!("===============================================================================");
27    println!();
28
29    const FS: f32 = 48000.0;
30
31    // -----------------------------------------------------------------------------------------
32    // 1. IIR Filter Design: Butterworth vs Chebyshev Cascades
33    // -----------------------------------------------------------------------------------------
34    println!("--- 1. IIR Filter Design: 4th-Order Butterworth & Chebyshev Cascades ---");
35    let cutoff_hz = 4800.0f32; // Cutoff at 4.8 kHz (normalized fc = 0.10)
36    let cutoff_norm = cutoff_hz / FS;
37
38    // 4th-Order Butterworth (2 biquad stages = 10 coefficients)
39    let mut butter_coeffs = [0.0f32; 10];
40    butterworth_lowpass_biquads(cutoff_hz, FS, 4, &mut butter_coeffs);
41
42    // 4th-Order Chebyshev Lowpass (2 biquad stages, 1.0% passband ripple)
43    let mut cheby_coeffs = [0.0f32; 10];
44    chebyshev_lowpass_biquads(cutoff_norm, 1.0, 4, &mut cheby_coeffs);
45
46    println!("  Butterworth 4th-Order Biquad Cascade Coeffs (2 stages):");
47    println!(
48        "    Stage 0: b0={:.4}, b1={:.4}, b2={:.4}, a1={:.4}, a2={:.4}",
49        butter_coeffs[0], butter_coeffs[1], butter_coeffs[2], butter_coeffs[3], butter_coeffs[4]
50    );
51    println!(
52        "    Stage 1: b0={:.4}, b1={:.4}, b2={:.4}, a1={:.4}, a2={:.4}",
53        butter_coeffs[5], butter_coeffs[6], butter_coeffs[7], butter_coeffs[8], butter_coeffs[9]
54    );
55
56    println!("  Chebyshev 4th-Order (1% ripple) Cascade Coeffs (2 stages):");
57    println!(
58        "    Stage 0: b0={:.4}, b1={:.4}, b2={:.4}, a1={:.4}, a2={:.4}",
59        cheby_coeffs[0], cheby_coeffs[1], cheby_coeffs[2], cheby_coeffs[3], cheby_coeffs[4]
60    );
61    println!(
62        "    Stage 1: b0={:.4}, b1={:.4}, b2={:.4}, a1={:.4}, a2={:.4}",
63        cheby_coeffs[5], cheby_coeffs[6], cheby_coeffs[7], cheby_coeffs[8], cheby_coeffs[9]
64    );
65
66    // -----------------------------------------------------------------------------------------
67    // 2. Windowed-Sinc FIR Design & Custom Frequency Sampling
68    // -----------------------------------------------------------------------------------------
69    println!("\n--- 2. FIR Filter Design: Windowed-Sinc & Frequency Sampling ---");
70    // 33-tap Windowed-Sinc Lowpass Filter (Blackman-windowed sinc)
71    const FIR_TAPS: usize = 33;
72    let mut fir_lowpass_taps = [0.0f32; FIR_TAPS];
73    let fir_status = fir_windowed_sinc_lowpass(cutoff_norm, &mut fir_lowpass_taps);
74    println!(
75        "  33-Tap Windowed-Sinc Lowpass FIR Status: {:?}",
76        fir_status
77    );
78    println!(
79        "    Center Tap [16]: {:.4}, Edge Tap [0]: {:.4}",
80        fir_lowpass_taps[16], fir_lowpass_taps[0]
81    );
82
83    // 33-Tap Custom Arbitrary Frequency Sampling FIR
84    let mut desired_mag = [0.0f32; 33]; // DC through Nyquist for 64-pt FFT
85    let desired_phase = [0.0f32; 33];
86    // Brickwall lowpass specification: 1.0 up to bin 6 (~4.5 kHz), 0.0 above
87    for (k, m) in desired_mag.iter_mut().enumerate() {
88        *m = if k <= 6 { 1.0 } else { 0.0 };
89    }
90    let mut sampled_fir_taps = [0.0f32; 33];
91    let fsamp_status =
92        fir_custom_frequency_sampling(&desired_mag, &desired_phase, 64, &mut sampled_fir_taps);
93    println!("  Custom Frequency-Sampling FIR Status: {:?}", fsamp_status);
94    println!(
95        "    Sampled FIR Center Tap [16]: {:.4}",
96        sampled_fir_taps[16]
97    );
98
99    // -----------------------------------------------------------------------------------------
100    // 3. Frequency-Domain DTFT Analysis & Stability Checks
101    // -----------------------------------------------------------------------------------------
102    println!("\n--- 3. Frequency Response (DTFT) & Pole Stability Verification ---");
103    // Evaluate frequency response at Passband (1 kHz), Cutoff (4.8 kHz), and Stopband (15 kHz)
104    let test_freqs = [1000.0f32, 4800.0, 15000.0];
105    println!("  DTFT Frequency Response Comparison (Butterworth vs Chebyshev vs FIR):");
106    println!(
107        "    {:<10} {:<18} {:<18} {:<18}",
108        "Freq (Hz)", "Butterworth (dB)", "Chebyshev (dB)", "FIR Lowpass (dB)"
109    );
110    println!("    ----------------------------------------------------------------------");
111
112    for &f in &test_freqs {
113        let fnorm = f / FS;
114
115        // Butterworth cascade response
116        let h_butter = biquad_cascade_frequency_response(&butter_coeffs, fnorm);
117        let butter_db = response_magnitude_db(h_butter);
118
119        // Chebyshev cascade response
120        let h_cheby = biquad_cascade_frequency_response(&cheby_coeffs, fnorm);
121        let cheby_db = response_magnitude_db(h_cheby);
122
123        // FIR response
124        let h_fir = fir_frequency_response(&fir_lowpass_taps, fnorm);
125        let fir_db = response_magnitude_db(h_fir);
126
127        println!(
128            "    {:<10.0} {:<18.2} {:<18.2} {:<18.2}",
129            f, butter_db, cheby_db, fir_db
130        );
131    }
132
133    // FIR Group Delay Evaluation
134    let gd_passband = fir_group_delay(&fir_lowpass_taps, 1000.0 / FS);
135    let gd_cutoff = fir_group_delay(&fir_lowpass_taps, 4800.0 / FS);
136    println!("\n  Linear-Phase FIR Group Delay:");
137    println!(
138        "    • Group Delay @ 1.0 kHz: {:.2} samples (Exact constant delay = (N-1)/2 = 16.0)",
139        gd_passband
140    );
141    println!("    • Group Delay @ 4.8 kHz: {:.2} samples", gd_cutoff);
142
143    // IIR Stability Verification
144    let stage0: [f32; 5] = butter_coeffs[..5].try_into().unwrap();
145    let stage1: [f32; 5] = butter_coeffs[5..].try_into().unwrap();
146    let pole_r0 = biquad_pole_radius(&stage0);
147    let pole_r1 = biquad_pole_radius(&stage1);
148    let is_stable = biquad_cascade_is_stable(&butter_coeffs);
149    println!("\n  IIR Cascade Pole Stability Check:");
150    println!(
151        "    • Stage 0 Pole Radius : {:.4} (< 1.0 -> Stable: {})",
152        pole_r0,
153        biquad_is_stable(&stage0)
154    );
155    println!(
156        "    • Stage 1 Pole Radius : {:.4} (< 1.0 -> Stable: {})",
157        pole_r1,
158        biquad_is_stable(&stage1)
159    );
160    println!("    • Overall Cascade Stable: {}", is_stable);
161
162    // -----------------------------------------------------------------------------------------
163    // 4. Implementation Topology: Direct Form I vs Transposed DF-II & Const Generics
164    // -----------------------------------------------------------------------------------------
165    println!("\n--- 4. Topology Comparison: DF-I vs Transposed DF-II vs Const Generics ---");
166    let input_signal = [1.0f32, 0.5, -0.5, -1.0, 0.0, 1.0, 0.5, -0.5, 0.0, 0.0];
167
168    // Direct Form I
169    let mut df1_state = [0.0f32; 8];
170    let mut df1_inst = BiquadCascadeInstanceF32 {
171        num_stages: 2,
172        coeffs: &butter_coeffs,
173        state: &mut df1_state,
174    };
175    let mut df1_out = [0.0f32; 10];
176    biquad_cascade_df1_f32(&mut df1_inst, &input_signal, &mut df1_out);
177
178    // Transposed Direct Form II
179    let mut df2t_state = [0.0f32; 4];
180    let mut df2t_inst = BiquadCascadeDf2tInstanceF32 {
181        num_stages: 2,
182        coeffs: &butter_coeffs,
183        state: &mut df2t_state,
184    };
185    let mut df2t_out = [0.0f32; 10];
186    biquad_cascade_df2t_f32(&mut df2t_inst, &input_signal, &mut df2t_out);
187
188    // Const-Generic BiquadCascade
189    let mut cg_biquad = BiquadCascade::<10, 8>::new(butter_coeffs);
190    let mut cg_out = [0.0f32; 10];
191    cg_biquad.process(&input_signal, &mut cg_out);
192
193    println!("  Filter Output Comparison (first 5 samples):");
194    println!("    DF-I Output   : {:?}", &df1_out[..5]);
195    println!("    DF-II T Output: {:?}", &df2t_out[..5]);
196    println!("    Const-Generic : {:?}", &cg_out[..5]);
197
198    // -----------------------------------------------------------------------------------------
199    // 5. Vector Distance Metrics
200    // -----------------------------------------------------------------------------------------
201    println!("\n--- 5. Vector Distance & Similarity Metrics ---");
202    let vec_a = [1.0f32, 2.0, 3.0, 4.0, 5.0];
203    let vec_b = [1.2f32, 1.9, 3.1, 3.8, 5.2];
204
205    let d_euc = euclidean_distance_f32(&vec_a, &vec_b);
206    let d_cos = cosine_distance_f32(&vec_a, &vec_b);
207    let d_cheb = chebyshev_distance_f32(&vec_a, &vec_b);
208    let d_man = manhattan_distance_f32(&vec_a, &vec_b);
209    let d_can = canberra_distance_f32(&vec_a, &vec_b);
210    let d_bc = bray_curtis_distance_f32(&vec_a, &vec_b);
211
212    println!("  Vector A: {:?}", vec_a);
213    println!("  Vector B: {:?}", vec_b);
214    println!("    • Euclidean Distance   : {:.4}", d_euc);
215    println!("    • Cosine Distance      : {:.6}", d_cos);
216    println!("    • Chebyshev Distance   : {:.4}", d_cheb);
217    println!("    • Manhattan Distance   : {:.4}", d_man);
218    println!("    • Canberra Distance    : {:.4}", d_can);
219    println!("    • Bray-Curtis Distance : {:.4}", d_bc);
220
221    // -----------------------------------------------------------------------------------------
222    // 6. Information-Theoretic & Statistical Metrics
223    // -----------------------------------------------------------------------------------------
224    println!("\n--- 6. Information Theory & Advanced Statistics ---");
225    let prob_dist_p = [0.1f32, 0.4, 0.3, 0.2];
226    let prob_dist_q = [0.25f32, 0.25, 0.25, 0.25]; // Uniform distribution
227    let logits = [2.0f32, 1.0, 0.1, -1.5];
228
229    let entropy_p = entropy_f32(&prob_dist_p);
230    let kl_p_q = kullback_leibler_f32(&prob_dist_p, &prob_dist_q);
231    let lse_result = logsumexp_f32(&logits);
232
233    println!("  Distribution P: {:?}", prob_dist_p);
234    println!("  Distribution Q (Uniform): {:?}", prob_dist_q);
235    println!("    • Shannon Entropy H(P)         : {:.4} nats", entropy_p);
236    println!("    • KL Divergence D_KL(P || Q)    : {:.4} nats", kl_p_q);
237    println!("    • LogSumExp of Logits {:?}: {:.4}", logits, lse_result);
238
239    println!();
240    println!("===============================================================================");
241    println!("            Filter Workbench & Analysis Execution Complete!                    ");
242    println!("===============================================================================");
243}
Source

pub fn process(&mut self, src: &[f32], dst: &mut [f32])

Process input slice src into output slice dst.

Examples found in repository?
examples/filter_workbench_and_analysis.rs (line 191)
23fn main() {
24    println!("===============================================================================");
25    println!("      embedded-dsp Filter Design, Analysis & Verification Workbench            ");
26    println!("===============================================================================");
27    println!();
28
29    const FS: f32 = 48000.0;
30
31    // -----------------------------------------------------------------------------------------
32    // 1. IIR Filter Design: Butterworth vs Chebyshev Cascades
33    // -----------------------------------------------------------------------------------------
34    println!("--- 1. IIR Filter Design: 4th-Order Butterworth & Chebyshev Cascades ---");
35    let cutoff_hz = 4800.0f32; // Cutoff at 4.8 kHz (normalized fc = 0.10)
36    let cutoff_norm = cutoff_hz / FS;
37
38    // 4th-Order Butterworth (2 biquad stages = 10 coefficients)
39    let mut butter_coeffs = [0.0f32; 10];
40    butterworth_lowpass_biquads(cutoff_hz, FS, 4, &mut butter_coeffs);
41
42    // 4th-Order Chebyshev Lowpass (2 biquad stages, 1.0% passband ripple)
43    let mut cheby_coeffs = [0.0f32; 10];
44    chebyshev_lowpass_biquads(cutoff_norm, 1.0, 4, &mut cheby_coeffs);
45
46    println!("  Butterworth 4th-Order Biquad Cascade Coeffs (2 stages):");
47    println!(
48        "    Stage 0: b0={:.4}, b1={:.4}, b2={:.4}, a1={:.4}, a2={:.4}",
49        butter_coeffs[0], butter_coeffs[1], butter_coeffs[2], butter_coeffs[3], butter_coeffs[4]
50    );
51    println!(
52        "    Stage 1: b0={:.4}, b1={:.4}, b2={:.4}, a1={:.4}, a2={:.4}",
53        butter_coeffs[5], butter_coeffs[6], butter_coeffs[7], butter_coeffs[8], butter_coeffs[9]
54    );
55
56    println!("  Chebyshev 4th-Order (1% ripple) Cascade Coeffs (2 stages):");
57    println!(
58        "    Stage 0: b0={:.4}, b1={:.4}, b2={:.4}, a1={:.4}, a2={:.4}",
59        cheby_coeffs[0], cheby_coeffs[1], cheby_coeffs[2], cheby_coeffs[3], cheby_coeffs[4]
60    );
61    println!(
62        "    Stage 1: b0={:.4}, b1={:.4}, b2={:.4}, a1={:.4}, a2={:.4}",
63        cheby_coeffs[5], cheby_coeffs[6], cheby_coeffs[7], cheby_coeffs[8], cheby_coeffs[9]
64    );
65
66    // -----------------------------------------------------------------------------------------
67    // 2. Windowed-Sinc FIR Design & Custom Frequency Sampling
68    // -----------------------------------------------------------------------------------------
69    println!("\n--- 2. FIR Filter Design: Windowed-Sinc & Frequency Sampling ---");
70    // 33-tap Windowed-Sinc Lowpass Filter (Blackman-windowed sinc)
71    const FIR_TAPS: usize = 33;
72    let mut fir_lowpass_taps = [0.0f32; FIR_TAPS];
73    let fir_status = fir_windowed_sinc_lowpass(cutoff_norm, &mut fir_lowpass_taps);
74    println!(
75        "  33-Tap Windowed-Sinc Lowpass FIR Status: {:?}",
76        fir_status
77    );
78    println!(
79        "    Center Tap [16]: {:.4}, Edge Tap [0]: {:.4}",
80        fir_lowpass_taps[16], fir_lowpass_taps[0]
81    );
82
83    // 33-Tap Custom Arbitrary Frequency Sampling FIR
84    let mut desired_mag = [0.0f32; 33]; // DC through Nyquist for 64-pt FFT
85    let desired_phase = [0.0f32; 33];
86    // Brickwall lowpass specification: 1.0 up to bin 6 (~4.5 kHz), 0.0 above
87    for (k, m) in desired_mag.iter_mut().enumerate() {
88        *m = if k <= 6 { 1.0 } else { 0.0 };
89    }
90    let mut sampled_fir_taps = [0.0f32; 33];
91    let fsamp_status =
92        fir_custom_frequency_sampling(&desired_mag, &desired_phase, 64, &mut sampled_fir_taps);
93    println!("  Custom Frequency-Sampling FIR Status: {:?}", fsamp_status);
94    println!(
95        "    Sampled FIR Center Tap [16]: {:.4}",
96        sampled_fir_taps[16]
97    );
98
99    // -----------------------------------------------------------------------------------------
100    // 3. Frequency-Domain DTFT Analysis & Stability Checks
101    // -----------------------------------------------------------------------------------------
102    println!("\n--- 3. Frequency Response (DTFT) & Pole Stability Verification ---");
103    // Evaluate frequency response at Passband (1 kHz), Cutoff (4.8 kHz), and Stopband (15 kHz)
104    let test_freqs = [1000.0f32, 4800.0, 15000.0];
105    println!("  DTFT Frequency Response Comparison (Butterworth vs Chebyshev vs FIR):");
106    println!(
107        "    {:<10} {:<18} {:<18} {:<18}",
108        "Freq (Hz)", "Butterworth (dB)", "Chebyshev (dB)", "FIR Lowpass (dB)"
109    );
110    println!("    ----------------------------------------------------------------------");
111
112    for &f in &test_freqs {
113        let fnorm = f / FS;
114
115        // Butterworth cascade response
116        let h_butter = biquad_cascade_frequency_response(&butter_coeffs, fnorm);
117        let butter_db = response_magnitude_db(h_butter);
118
119        // Chebyshev cascade response
120        let h_cheby = biquad_cascade_frequency_response(&cheby_coeffs, fnorm);
121        let cheby_db = response_magnitude_db(h_cheby);
122
123        // FIR response
124        let h_fir = fir_frequency_response(&fir_lowpass_taps, fnorm);
125        let fir_db = response_magnitude_db(h_fir);
126
127        println!(
128            "    {:<10.0} {:<18.2} {:<18.2} {:<18.2}",
129            f, butter_db, cheby_db, fir_db
130        );
131    }
132
133    // FIR Group Delay Evaluation
134    let gd_passband = fir_group_delay(&fir_lowpass_taps, 1000.0 / FS);
135    let gd_cutoff = fir_group_delay(&fir_lowpass_taps, 4800.0 / FS);
136    println!("\n  Linear-Phase FIR Group Delay:");
137    println!(
138        "    • Group Delay @ 1.0 kHz: {:.2} samples (Exact constant delay = (N-1)/2 = 16.0)",
139        gd_passband
140    );
141    println!("    • Group Delay @ 4.8 kHz: {:.2} samples", gd_cutoff);
142
143    // IIR Stability Verification
144    let stage0: [f32; 5] = butter_coeffs[..5].try_into().unwrap();
145    let stage1: [f32; 5] = butter_coeffs[5..].try_into().unwrap();
146    let pole_r0 = biquad_pole_radius(&stage0);
147    let pole_r1 = biquad_pole_radius(&stage1);
148    let is_stable = biquad_cascade_is_stable(&butter_coeffs);
149    println!("\n  IIR Cascade Pole Stability Check:");
150    println!(
151        "    • Stage 0 Pole Radius : {:.4} (< 1.0 -> Stable: {})",
152        pole_r0,
153        biquad_is_stable(&stage0)
154    );
155    println!(
156        "    • Stage 1 Pole Radius : {:.4} (< 1.0 -> Stable: {})",
157        pole_r1,
158        biquad_is_stable(&stage1)
159    );
160    println!("    • Overall Cascade Stable: {}", is_stable);
161
162    // -----------------------------------------------------------------------------------------
163    // 4. Implementation Topology: Direct Form I vs Transposed DF-II & Const Generics
164    // -----------------------------------------------------------------------------------------
165    println!("\n--- 4. Topology Comparison: DF-I vs Transposed DF-II vs Const Generics ---");
166    let input_signal = [1.0f32, 0.5, -0.5, -1.0, 0.0, 1.0, 0.5, -0.5, 0.0, 0.0];
167
168    // Direct Form I
169    let mut df1_state = [0.0f32; 8];
170    let mut df1_inst = BiquadCascadeInstanceF32 {
171        num_stages: 2,
172        coeffs: &butter_coeffs,
173        state: &mut df1_state,
174    };
175    let mut df1_out = [0.0f32; 10];
176    biquad_cascade_df1_f32(&mut df1_inst, &input_signal, &mut df1_out);
177
178    // Transposed Direct Form II
179    let mut df2t_state = [0.0f32; 4];
180    let mut df2t_inst = BiquadCascadeDf2tInstanceF32 {
181        num_stages: 2,
182        coeffs: &butter_coeffs,
183        state: &mut df2t_state,
184    };
185    let mut df2t_out = [0.0f32; 10];
186    biquad_cascade_df2t_f32(&mut df2t_inst, &input_signal, &mut df2t_out);
187
188    // Const-Generic BiquadCascade
189    let mut cg_biquad = BiquadCascade::<10, 8>::new(butter_coeffs);
190    let mut cg_out = [0.0f32; 10];
191    cg_biquad.process(&input_signal, &mut cg_out);
192
193    println!("  Filter Output Comparison (first 5 samples):");
194    println!("    DF-I Output   : {:?}", &df1_out[..5]);
195    println!("    DF-II T Output: {:?}", &df2t_out[..5]);
196    println!("    Const-Generic : {:?}", &cg_out[..5]);
197
198    // -----------------------------------------------------------------------------------------
199    // 5. Vector Distance Metrics
200    // -----------------------------------------------------------------------------------------
201    println!("\n--- 5. Vector Distance & Similarity Metrics ---");
202    let vec_a = [1.0f32, 2.0, 3.0, 4.0, 5.0];
203    let vec_b = [1.2f32, 1.9, 3.1, 3.8, 5.2];
204
205    let d_euc = euclidean_distance_f32(&vec_a, &vec_b);
206    let d_cos = cosine_distance_f32(&vec_a, &vec_b);
207    let d_cheb = chebyshev_distance_f32(&vec_a, &vec_b);
208    let d_man = manhattan_distance_f32(&vec_a, &vec_b);
209    let d_can = canberra_distance_f32(&vec_a, &vec_b);
210    let d_bc = bray_curtis_distance_f32(&vec_a, &vec_b);
211
212    println!("  Vector A: {:?}", vec_a);
213    println!("  Vector B: {:?}", vec_b);
214    println!("    • Euclidean Distance   : {:.4}", d_euc);
215    println!("    • Cosine Distance      : {:.6}", d_cos);
216    println!("    • Chebyshev Distance   : {:.4}", d_cheb);
217    println!("    • Manhattan Distance   : {:.4}", d_man);
218    println!("    • Canberra Distance    : {:.4}", d_can);
219    println!("    • Bray-Curtis Distance : {:.4}", d_bc);
220
221    // -----------------------------------------------------------------------------------------
222    // 6. Information-Theoretic & Statistical Metrics
223    // -----------------------------------------------------------------------------------------
224    println!("\n--- 6. Information Theory & Advanced Statistics ---");
225    let prob_dist_p = [0.1f32, 0.4, 0.3, 0.2];
226    let prob_dist_q = [0.25f32, 0.25, 0.25, 0.25]; // Uniform distribution
227    let logits = [2.0f32, 1.0, 0.1, -1.5];
228
229    let entropy_p = entropy_f32(&prob_dist_p);
230    let kl_p_q = kullback_leibler_f32(&prob_dist_p, &prob_dist_q);
231    let lse_result = logsumexp_f32(&logits);
232
233    println!("  Distribution P: {:?}", prob_dist_p);
234    println!("  Distribution Q (Uniform): {:?}", prob_dist_q);
235    println!("    • Shannon Entropy H(P)         : {:.4} nats", entropy_p);
236    println!("    • KL Divergence D_KL(P || Q)    : {:.4} nats", kl_p_q);
237    println!("    • LogSumExp of Logits {:?}: {:.4}", logits, lse_result);
238
239    println!();
240    println!("===============================================================================");
241    println!("            Filter Workbench & Analysis Execution Complete!                    ");
242    println!("===============================================================================");
243}
Source

pub fn reset(&mut self)

Reset internal filter delay state.

Trait Implementations§

Source§

impl<const COEFFS_LEN: usize, const STATE_LEN: usize> Clone for BiquadCascade<COEFFS_LEN, STATE_LEN>

Source§

fn clone(&self) -> BiquadCascade<COEFFS_LEN, STATE_LEN>

Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl<const COEFFS_LEN: usize, const STATE_LEN: usize> Debug for BiquadCascade<COEFFS_LEN, STATE_LEN>

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl<const COEFFS_LEN: usize, const STATE_LEN: usize> Format for BiquadCascade<COEFFS_LEN, STATE_LEN>

Source§

fn format(&self, f: Formatter<'_>)

Writes the defmt representation of self to fmt.

Auto Trait Implementations§

§

impl<const COEFFS_LEN: usize, const STATE_LEN: usize> Freeze for BiquadCascade<COEFFS_LEN, STATE_LEN>

§

impl<const COEFFS_LEN: usize, const STATE_LEN: usize> RefUnwindSafe for BiquadCascade<COEFFS_LEN, STATE_LEN>

§

impl<const COEFFS_LEN: usize, const STATE_LEN: usize> Send for BiquadCascade<COEFFS_LEN, STATE_LEN>

§

impl<const COEFFS_LEN: usize, const STATE_LEN: usize> Sync for BiquadCascade<COEFFS_LEN, STATE_LEN>

§

impl<const COEFFS_LEN: usize, const STATE_LEN: usize> Unpin for BiquadCascade<COEFFS_LEN, STATE_LEN>

§

impl<const COEFFS_LEN: usize, const STATE_LEN: usize> UnsafeUnpin for BiquadCascade<COEFFS_LEN, STATE_LEN>

§

impl<const COEFFS_LEN: usize, const STATE_LEN: usize> UnwindSafe for BiquadCascade<COEFFS_LEN, STATE_LEN>

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Az for T

Source§

fn az<Dst>(self) -> Dst
where T: Cast<Dst>,

Casts the value.
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<Src, Dst> CastFrom<Src> for Dst
where Src: Cast<Dst>,

Source§

fn cast_from(src: Src) -> Dst

Casts the value.
Source§

impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
where ST: ?Sized, DT: ?Sized,

Source§

impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
where ST: ?Sized, DT: ?Sized,

Source§

impl<T> CheckedAs for T

Source§

fn checked_as<Dst>(self) -> Option<Dst>
where T: CheckedCast<Dst>,

Casts the value.
Source§

impl<Src, Dst> CheckedCastFrom<Src> for Dst
where Src: CheckedCast<Dst>,

Source§

fn checked_cast_from(src: Src) -> Option<Dst>

Casts the value.
Source§

impl<T> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<Src, Dst> LosslessTryInto<Dst> for Src
where Dst: LosslessTryFrom<Src>,

Source§

fn lossless_try_into(self) -> Option<Dst>

Performs the conversion.
Source§

impl<Src, Dst> LossyInto<Dst> for Src
where Dst: LossyFrom<Src>,

Source§

fn lossy_into(self) -> Dst

Performs the conversion.
Source§

impl<T> OverflowingAs for T

Source§

fn overflowing_as<Dst>(self) -> (Dst, bool)
where T: OverflowingCast<Dst>,

Casts the value.
Source§

impl<Src, Dst> OverflowingCastFrom<Src> for Dst
where Src: OverflowingCast<Dst>,

Source§

fn overflowing_cast_from(src: Src) -> (Dst, bool)

Casts the value.
Source§

impl<T> Read<Exclusive, BecauseExclusive> for T
where T: ?Sized,

Source§

impl<T> Same for T

Source§

type Output = T

Should always be Self
Source§

impl<T> SaturatingAs for T

Source§

fn saturating_as<Dst>(self) -> Dst
where T: SaturatingCast<Dst>,

Casts the value.
Source§

impl<Src, Dst> SaturatingCastFrom<Src> for Dst
where Src: SaturatingCast<Dst>,

Source§

fn saturating_cast_from(src: Src) -> Dst

Casts the value.
Source§

impl<T> StrictAs for T

Source§

fn strict_as<Dst>(self) -> Dst
where T: StrictCast<Dst>,

Casts the value.
Source§

impl<Src, Dst> StrictCastFrom<Src> for Dst
where Src: StrictCast<Dst>,

Source§

fn strict_cast_from(src: Src) -> Dst

Casts the value.
Source§

impl<SS, SP> SupersetOf<SS> for SP
where SS: SubsetOf<SP>,

Source§

fn to_subset(&self) -> Option<SS>

The inverse inclusion map: attempts to construct self from the equivalent element of its superset. Read more
Source§

fn is_in_subset(&self) -> bool

Checks if self is actually part of its subset T (and can be converted to it).
Source§

fn to_subset_unchecked(&self) -> SS

Use with care! Same as self.to_subset but without any property checks. Always succeeds.
Source§

fn from_subset(element: &SS) -> SP

The inclusion map: converts self to the equivalent element of its superset.
Source§

impl<T> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
Source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = !

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
Source§

impl<T> UnwrappedAs for T

Source§

fn unwrapped_as<Dst>(self) -> Dst
where T: UnwrappedCast<Dst>,

Casts the value.
Source§

impl<Src, Dst> UnwrappedCastFrom<Src> for Dst
where Src: UnwrappedCast<Dst>,

Source§

fn unwrapped_cast_from(src: Src) -> Dst

Casts the value.
Source§

impl<T> WrappingAs for T

Source§

fn wrapping_as<Dst>(self) -> Dst
where T: WrappingCast<Dst>,

Casts the value.
Source§

impl<Src, Dst> WrappingCastFrom<Src> for Dst
where Src: WrappingCast<Dst>,

Source§

fn wrapping_cast_from(src: Src) -> Dst

Casts the value.