Skip to main content

ac_gain_db

Function ac_gain_db 

Source
pub fn ac_gain_db(
    wdf: &[f64],
    reference: &[f64],
    freq_hz: f64,
    sample_rate: f64,
) -> f64
Expand description

Steady-state, level-independent AC gain ratio in dB at freq_hz: 20*log10(amp_wdf / amp_ref). Positive = WDF louder than the reference.

Unlike normalized_rms_error_db, this directly compares the magnitude of the test tone, so it reports the TRUE level gap even when one signal rides on a large DC bias or is far below the other. Returns -inf when the reference tone is silent.