Skip to main content

compute_average_response

Function compute_average_response 

Source
pub fn compute_average_response(
    frequencies: &[f32],
    magnitude_db: &[f32],
    freq_range: Option<(f32, f32)>,
) -> f32
Expand description

Compute a log-frequency weighted reference response level in dB.

§Arguments

  • frequencies - Frequency points in Hz
  • magnitude_db - Magnitude in dB
  • freq_range - Optional (start_freq, end_freq) to limit the averaging range. If None, averages over the full bandwidth.

§Returns

The log-frequency weighted average in the dB domain.

This is intended as a stable acoustic reference level for comparison and normalization. It is not a pressure- or energy-domain average.