Skip to content

param_eq: fix incorrect filter type for high frequency band

Description:

An attempt to fix error in the parametric equalizer module (param_eq) initialization.

In the Open function, it appears that the coefficient calculation for the high-frequency band incorrectly passed a flag causing it to execute the low-shelf filter code path instead of the high-shelf filter.

Location: In function Open():

CalcShelfEQCoeffs(p_sys->f_highf, 1, p_sys->f_highgain, 0, // <--- Error here
                  i_samplerate, p_sys->coeffs+4*5);

Analysis:

The CalcShelfEQCoeffs function signature is defined as: static void CalcShelfEQCoeffs( float f0, float slope, float gainDB, int high, ... )

The 4th parameter (int high) determines the filter type:

  • 1: High-shelf filter
  • 0: Low-shelf filter

Based on my understanding for the code, this causes the equalizer to create a second low-shelf filter at the high cutoff frequency, which affects all frequencies below the cutoff rather than above it.

Expected Behavior: The 4th parameter should be 1 to correctly generate coefficients for a high-shelf filter.

Edited by felisevan

Merge request reports

Loading