# Method for Resonant Frequency Attenuation in Dynamic Audio Equalizer
## 2 Materials and Methods
### Filter Bank and Signal Filtering  
The arrays obtained in the sections of the maximum representative value per band (see Section 2.2) and the smoothed threshold curve of the input signal spectrum (see Section 2.3) are employed to ascertain the resonant frequencies by calculating the attenuation per band required to smooth the spectrum. Consequently, a cycle is made to go through the arrays in order to perform a node by node comparison. In the event that the value of the maximum amplitude exceeds the threshold curve, the subtraction between the threshold and the maximum is obtained; otherwise, a value of zero is assigned. The two arrays are vectors of dimension 30, corresponding to one value for each band. Each vector contains the relevant spectrum information. The first vector has the maximum value per band in decibels, with negative float values. The second vector is the threshold curve vector, which has 30 floating point values in decibels less than 0. The difference array is employed to determine the attenuation that each filter will process. This calculation is conducted by averaging the preceding values and the current values. The averaging process serves to mitigate abrupt changes between each sample  
Figure 6: Magnitude spectrum divided by octave bands to obtain threshold per octave. Figure 7: Magnitude spectrum of drum audio input signal and threshold curve generated from spectrum using standard deviation. buffer. The final attenuation vector is converted from decibels to linear scale, resulting in a vector of dimension 30 with values between 0 and 1 in floating point, thereby representing the attenuation for each frequency band. The implemented filter is a second-order IIR-Peak-type filter proposed in [PERSON] et al. [1], which is described as follows: for gain \(G\) greater than one, it increases the gain in the operating band; for \(G\) between zero and one, it attenuates the signal. The bandwidth \(BW\) is specified by the quality factor \(Q=fc/BW\) and has a center frequency \(f_{c}\). It is satisfied that outside the operating range, it has a unity gain. Furthermore, the filter exhibits unity gain in the limit where the frequency is zero and in the Nyquist limit (at half the sampling frequency, \(f_{s}\)). This type of equalizer is employed due to its minimal computational expense and latency. Equalizers exhibiting these attributes are referenced as parametric EQs, graphic EQs (IIR), analog-matched EQs, and dynamic EQs [1] and most of these equalizers use this type of filter. The Z-domain transfer function of the filter is described by Equation (10). \[H(z)=\frac{b_{0}+b_{1}z^{-1}+b_{2}z^{-2}}{a_{0}+a_{1}z^{-1}+a_{2}z^{-2}}. \tag{10}\]  
In accordance with the provided Equations (11)-(13), the coefficients  
The transfer function is required for each filter, applied for each band. This results in the formation of a matrix of numerator and denominator coefficients. Table 1 contains a matrix that was generated from the analysis of an audio recording of a drum kit at a specific time instant. Its frequency response is shown in Figure 9.  
The matrix is then used to process the input signal, which is passed through a cascade of thirty second-order filters in order to process the entire spectrum by bands. In this study, the MATLAB DSP System Toolbox object dsp.SOSFilter was utilized for signal filtering, implementing an IIR filter structure with second-order sections. The default filtering structure is Direct form II transposed and the signal is filtered using the object, giving as arguments the input signal in matrix form (mono or stereo) and the coefficient  
Figure 8: Magnitude response of Peak filter. Figure 9: System magnitude response for audio file of drum kit. attenuation variables of the second-order Peak IIR filter, as defined by Equation (10), were altered. A system becomes unstable when the poles are outside the unit circle, and it ceases to be of minimum phase when the zeros are outside the unit circle [19].