# Fault Diagnosis of Wind Turbine Gearbox Based on Mel Spectrogram and Improved ResNeXt50 Model
## 2 Preprocessing  
Mel spectrograms integrate the temporal, frequency, and energy information of sound signals, with time on the horizontal axis, frequency on the vertical axis, and the distribution of energy displayed through the intensity of color [17; 18]. The processing procedure first involves preprocessing the audio signal, including pre-emphasis, framing, and windowing. Then, short-time Fourier transform (STFT) is applied to generate a spectrogram, mapping the individual frame signals and concatenating them along the time dimension. Due to various factors in recording equipment and transmission processes, high-frequency components tend to attenuate, leading to an imbalance in spectral characteristics. Pre-emphasis is a technique that applies a high-pass filter to the audio signal, emphasizing the high-frequency components in order to improve the balance of the signal. The process of pre-emphasis is as follows:  
\[y(n)=x(n)-\lambda x(n-1) \tag{1}\]  
In Equation (1), \(y(n)\) represents the signal after pre-emphasis, \(x(n)\) is the input signal, \(x(n-1)\) is the value of the input signal at the sampling point one time unit before the current time point \((n)\), \(\lambda\) is the pre-emphasis coefficient, and the fault frequency range of the wind turbine gearbox is high. The background wind noise is dominated by low frequencies. In order to emphasize the high-frequency fault frequency range [19], \(\lambda\) = 0.97 is selected in this study. Because audio signals are non-stationary, we cannot directly apply Fourier Transform to the entire audio signal. Instead, we need to use framing techniques to segment the audio into smaller frames and process them individually. Frame segmentation is achieved by applying a movable finite-length window for weighting. A certain window function is multiplied with the pre-emphasized signal, resulting in a windowed audio signal. This process allows for the audio to be segmented into smaller frames for further analysis and processing. Then, a short-time Fourier analysis is conducted, assuming that the audio signal remains stationary for a short duration, and a steady-state analysis method is applied for processing [20]. In order to reduce signal distortion, the Hamming window is selected, and its formula is as follows:  
\[\mathrm{w}(n)=\left\{ \begin{array}{l}0.54-0.46\cos[2\pi n/(\mathrm{N}-1)],0 \leq n\leq\mathrm{N}-1\\ 0,\mathrm{others}\end{array} \right. \tag{2}\]  
In Equation (2), \(\mathrm{N}\) is the length of the window, \(n\) is the sampling point index in the window, and \(\mathrm{w}(n)\) is the value of the Hamming window at the nth sampling point. The signal of the \(l\)-th frame after windowing is expressed as follows:  
\[x_{l}(m)=w(m)x(n_{l}+m)\hskip 28.452756 pt0\leq m\leq\mathrm{M}-1 \tag{3}\]  
In Equation (3), \(x_{l}(m)\) is represented as a vector of length \(\mathrm{M}\), where \(m\) is the index of the sample point within the frame, ranging from 0 to \(\mathrm{M}-1\). \(w(m)\) is the Hamming window, and \(x(n_{l}+m)\) indicates the index of the starting sample point of the \(l\)-th frame as \(n_{l}\), which is expressed as the starting sample point index of the \(l\)-th frame plus the sample point index \(m\) within the frame, i.e., \(n_{l}+m\). The short-time Fourier transform of it is as follows:  
\[X_{l}(k)=\sum_{m=0}^{\mathrm{M-1}}x_{l}(m)\cdot e^{-j2\pi\mathrm{k}m/\mathrm{M}} \tag{4}\]  
In Equation (4), \(X_{l}(k)\) represents the STFT result of the \(l\)-th frame, and \(k\) is the frequency index. \(x_{l}(m)\) is the signal after windowing in the \(l\)-th frame. To calculate the energy spectrum, after the Fourier transform is completed, the frequency-domain signal is obtained; the energy of each frequency band range is different, and the energy spectra of different factors are also different.