Skip to main content

rlc_bandpass_filter

Function rlc_bandpass_filter 

Source
pub fn rlc_bandpass_filter(
    signal: &[f64],
    r_ohms: f64,
    l_henrys: f64,
    c_farads: f64,
    r_load: f64,
    sample_rate: f64,
) -> Vec<f64>
Expand description

Series RLC bandpass filter.

For a series RLC circuit with output across the load resistor RL in the topology: Vin -> R_series -> L -> C -> RL -> GND

The transfer function considering the load resistor is: H(s) = RL / (R + sL + 1/(sC) + RL) = s * RL * C / (s^2 * L * C + s * (R + RL) * C + 1)

This is a bandpass with: f0 = 1 / (2pisqrt(L*C)) Q = sqrt(L/C) / (R + RL)

Uses bilinear transform to convert to discrete-time biquad.