# Fault Diagnosis Method for Rolling Bearings Based on Two-Channel CNN under Unbalanced Datasets
## 2 Feature Extraction Method
### Gst  
Vibrational signal analysis techniques such as EMD [34], Short time Fourier transform (STFT) [35], Wigner-Ville distribution (WVD) [36], and wavelet packet transform (WPT) [37] are widely used in fault diagnosis. Compared with GST, these methods have some shortcomings when used as deep learning inputs. For EMD because IMF is frequency independent, it is impossible to judge the correlation between fault characteristics and IMF, so IMFs have difficulty being unified as deep learning inputs. STFT obtains the time-frequency spectrum based on a sliding time window. When the window width is short, it has high time resolution and low frequency resolution. Once STFT determines the window function, the corresponding time-frequency resolution is also determined. For non-stationary signals, WVD is similar to STFT. WVD analyzes the time-frequency distribution of vibration signals. However, WVD has the problem of cross-interference in engineering applications, and unlike manual analysis, it is difficult for deep learning methods to distinguish cross-term interference automatically. WPT can decompose the high frequency parts compared to wavelet transform, which improves the resolution of a high frequency band. However, the characteristic frequency of bearing faults in rotating machinery is generally less than ten times that of the rotation frequency so WPT may increase computational cost. In conclusion, GST is chosen as the time-frequency domain feature extraction method, and the specific implementation method is described as follows. The formula for the Fourier transform is:  
\[H(f)=\int_{-\infty}^{+\infty}x(t)e^{-i2\pi ft}dt \tag{7}\]  
Since the classical Fourier transform cannot locate both time and frequency, a window function \(w(t)\) can be introduced, then the formula for the Fourier transform is:  
\[H(f)=\int_{-\infty}^{+\infty}x(t)w(t)e^{-i2\pi ft}dt \tag{8}\]  
If the window function is a normalized Gaussian window function with scaling and translation, then the window function is:  
\[w(t-\tau)=\frac{1}{\sigma\sqrt{2\pi}}e^{-\frac{(t-\tau)^{2}}{2\sigma^{2}}} \tag{9}\]  
The frequency spectrum of the signal \(x(t)\) is:  
\[STFT(\sigma,\tau,f)=\int_{-\infty}^{+\infty}x(t)\frac{1}{\sigma\sqrt{2\pi}}e^{ \frac{-(t-\tau)^{2}}{2\sigma^{2}}}e^{-i2\pi ft}dt \tag{10}\]  
Because (10) is a function of three independent variables, it is not practical as a tool for time-frequency analysis. If \(\sigma(f)\) is simplified to \(\sigma(f)=\frac{1}{|f|}\), then the S-transform is defined as:  
\[S(\tau,f)=\int_{-\infty}^{+\infty}x(t)\frac{|f|}{\sqrt{2\pi}}e^{-\frac{\sigma ^{2}(t-\tau)^{2}}{2}}e^{-i2\pi ft}dt \tag{11}\]  
The S-transform is the extension of the continuous wavelet transform (CWT). In (11), the window width is fixed, which means that the width of the time-frequency window has the same resolution for all frequency components. The test signals of rotating machines are generally non-stationary signals with many frequency components. The change is more violent in the high-frequency part, and the duration is relatively short. At this time, the time window should be taken narrower. On the contrary, the time window should be taken wider. Based on the above analysis, it is possible to relate the scale factor to the frequency. Let the scale factor become a function of the frequency \(f\) to adjust the width of the time window adaptively with frequency. Let \(\sigma(f)=\frac{1}{\lambda\left|f\right|^{p}}\), where \(\lambda>0,p>0\). According to (10), the generalized S-transform can be obtained:  
\[GST(\tau,f)=\int_{-\infty}^{+\infty}x(t)\frac{\lambda\left|f\right|^{p}}{ \sqrt{2\pi}}e^{\frac{-\lambda^{2}f^{2}(p-t)^{2}}{2}}e^{-i2\pi ft}dt \tag{12}\]  
When \(\lambda=1,p=1\), GST is the standard S-transform. The Gaussian window function can be chosen flexibly with the change of frequency scale, which makes the GST better adapted to the analysis and processing of different practical signals. In general, \(p\) should not be too large, although GST does not theoretically limit its value.