# Fault Diagnosis of Planetary Gear Train Crack Based on DC-DRSN
## 2 Theory and Method  
### Image Conversion Method  
The visual representation of the vibration signal helps identify the failure mode of the gear. Commonly used image conversion methods for vibration signals include short-time Fourier transform (STFT), wavelet transform (WT), Gramian angular summation field (GASF), generalized S-transform (GST), and so on. STFT is a common method in time-domain and frequency-domain analysis. In this method, the signal is divided into short periods, and the Fourier transform is applied to each short period to obtain the spectral information of the signal at different times and frequencies. STFT is able to capture the instantaneous frequency change of the signal in time, and the instantaneous frequency change can reflect abnormal patterns in the frequency domain, which helps identify the fault state of the system. Assuming that the vibration signal is \(x(\tau)\), the STFT is calculated as [23]:  
\[STFT(t,\omega)=\int_{-\infty}^{\infty}x(\tau)\cdot w(\tau-t)\cdot e^{-i\omega t }d\tau \tag{1}\]  
where \(w(\tau-t)\) is the window function; \(e^{-i\omega\tau}\) is the complex exponential term that describes the components of the frequency domain, \(\omega\) is the frequency; \(STFT(t,\omega)\) is the result of the short-time Fourier transform at moments and frequencies. In this paper, to reduce spectrum leakage and maintain computational efficiency, a Hanning window with 256 length and 50% overlap is used. WT provides a time-frequency representation of a signal by convoluting it with a set of translational and scaled wavelet functions. This method inherits the localization idea of STFT and overcomes the defect that the size of the time window is unchanged, which makes the wavelet transform more advantageous in capturing the local information of the signal. The principle formula of WT can be described as [24]:  
\[\mathbf{w}(a,b)=\int_{-\infty}^{\infty}f(t)\psi*[(t-b)/a]dt \tag{2}\]  
where \(\mathbf{w}(a,b)\), \(f(t)\) and \(\psi(t)\) denote the wavelet coefficient, original signal, and wavelet basis function, respectively; \(a\) and \(b\) represent the scale factor and the translation factor, respectively. In this paper, to extract enough feature information from original the vibration signal and accurately distinguish the subtle changes of features, the Morlet wavelet (cmor3-3) is used as the mother wavelet function with a total scale of 256. GASF is the mapping of time series data to a polar coordinate system and the construction of images by calculating cosine similarity between angles. By adjusting the size and resolution of the image, the features of the signal can be extracted at different scales, and the results are as follows [25]:  
\[\widetilde{x}_{i}=\frac{(x_{i}-\max(X)+(x_{i}-\min(X))}{\max(X)-\min(X)} \tag{3}\]  
\[\phi_{i}=\arccos(\widetilde{x}_{i}) \tag{4}\]  
\[r(i)=\frac{x_{i}}{n} \tag{5}\]  
\[GASF= \begin{bmatrix}\cos(\phi_{1}+\phi_{1})&\cdots&\cos(\phi_{1}+\phi_{n})\\ \vdots&\ddots&\vdots\\ \cos(\phi_{n}+\phi_{1})&\cdots&\cos(\phi_{n}+\phi_{n})\end{bmatrix}  \tag{6}\]  
where \(\widetilde{x}_{i}\in\widetilde{X}\), then encode the \(\widetilde{x}_{i}\) value of \(\widetilde{X}\) as the angular cosine, time as the radius \(r(i)\), and \(\phi_{i}\) as the angular cosine value in polar coordinates, and for the time series in the interval [\(-1\), \(1\)], the value range is limited to the interval [\(0\), \(\pi\)] by using the inverse trigonometric function under the polar mapping. In a polar coordinate system, the cosine and angle values for each polar coordinate are calculated. In this paper, the data length of the GASF transformation is 1024, and the window size is 256. GST decomposes a signal into a series of rectangular boxes on the time-frequency plane, and the values in each rectangular box represent the energy of the signal at the corresponding time and frequency, which is suitable for processing nonstationary signals, providing higher resolution and flexibility in time and frequency.