# Method for Resonant Frequency Attenuation in Dynamic Audio Equalizer
## 1 Introduction
The algorithms and code behind the these commercial resonance suppressor plug-ins are not available to the general public. To the best of our knowledge, academic results on detecting and attenuating resonant frequencies for audio files across the spectrum are scarce. In [PERSON] et al. [9], a system for detecting resonances in a room using the Fast Fourier Transform (FFT) and Peak filters is presented. The system plays a signal through loudspeakers, captures it with a microphone, and digitizes it. In the case of digital audio, the signal is analyzed with respect to the generated signal and the coefficients of the filters are calculated in order to attenuate the resonances. This system works at frequencies below 200 Hz and proposes the use of static filters. Some algorithms for resonant frequency detection employ the FFT to perform a frequency domain analysis. In [PERSON], [PERSON] [10], an algorithm is developed that uses the magnitude spectrum, whereby the highest values from each sample section are identified and the five highest peaks from the entire audio file are selected. These peaks are considered the resonances of the audio signal if the value is higher than the FFT bin for either side of it for the audio region. A more complex algorithm was proposed by [PERSON] et al. [11] where spectrum normalization is performed and two spectrum curves are created: a fine structure curve and a general shape curve of the signal. By splitting the spectrum, the amplitude of all frequencies is matched with the smoothed spectrum, and the maximum peaks in the fine structure can be obtained. Finally, the highest peaks of the signal are identified as resonant frequencies. A comparable study is presented by [PERSON] [12], in which a prototype for automatic and real-time compensation of the psychoacoustic frequency masking effect is developed. In the study, a 32-band dynamic equalizer based on the Bark psychoacoustic scale is employed. The prototype analyzes a control signal and generates a masking threshold curve, which is then used to adjust the equalizer so that the spectrum curve of the input signal aligns with the designed control signal. It is noteworthy that the program is designed as an audio plug-in with a specific buffer size of 1024 samples, ensuring real-time functionality. This paper proposes a method to detect and attenuate resonant frequencies in an audio signal. An amplitude dynamic equalizer with thirty bands and dynamic thresholds is designed. In order to identify the resonant frequencies of the input signal, a frequency domain analysis is conducted, using the magnitude spectrum obtained by the FFT. With the magnitude spectrum of the signal, representative values for each of the thirty bands are obtained. Two frequency band distributions are proposed: one by one-third octave bands and the other by the psychoacoustic scale according to Equivalent Rectangular Bandwidths (ERBs). The scale is selected based on the Spectral Flatness coefficient. The maximum value for each of the thirty bands is then obtained using the amplitude spectrum with the band distribution. The empirical rule of the standard deviation is proposed for the analysis of spectral data. This rule states that 95% of all values in a dataset lie within two standard deviations from the mean [13]. The value of four standard deviations for each octave band is then calculated and linearly interpolated across the center frequencies of the band distribution. The resulting algorithm then generates a curve that approximates the general shape of the spectrum, disregarding the peaks of the signal. The difference between the array of maximum values and the array with the threshold curve is obtained for each of the thirty bands. The attenuation per band is calculated by taking the average of the difference between each matrix and the previously calculated difference. If this is the first iteration, the same value is retained.