# Continuous Wavelet Transform and CNN for Fault Detection in a Helical Gearbox
## 2 Continuous Wavelet Transform (CWT) for Fault Diagnosis  
CWT is an effective technique for machinery fault diagnosis using vibration signals. This technique can be used to detect and characterize stationary and transitory signals [20]. Wavelet bases decompose signals over oscillatory waveforms that reveal many signal properties. The wavelet transform (WT) of time-series data, such as the vibration signal \(x(t)\), is able to show the changes in frequency content over time. This facilitates the detection and localization of short-duration phenomena in the signal. For comparison, the modulus of the FFT provides a general picture of the range of frequencies and associated amplitudes contained in the segment of the analyzed signal. The modulus of WT indicates how the energy of the vibration signal changes over time and, at each time moment, at what frequency the signal's energy is.  
Wavelets offer well-localized information, and few coefficients are needed to represent local transients in the signal. Wavelets are localized in the time domain because they have a limited time duration, and they are also localized in the frequency domain since they have a limited frequency bandwidth. Mathematically, the CWT computes the inner products of a continuous signal with a set of continuous wavelets, revealing the signal's similarity to a set of basic functions. A wavelet, \(h(t)\), is a small wave-like function with oscillating characteristics. There are many different shapes of basic functions. In order to be classified as a wavelet, the function \(h(t)\) must satisfy several mathematical criteria [21]. WT can be implemented in the time domain and in the frequency domain. In the time domain, for each coefficient, one has to perform a convolution operation, as in Formula (1) [22].  
\[CWT(a,b)=\left\langle x(t),h_{b,a}\right\rangle=w(a)\int\limits_{-\infty}^{ \infty}x(t)h_{b,a}^{*}(t)dt, \tag{1}\]where \(h_{b,a}\) is the set of daughter wavelets obtained from the mother wavelet \(h(t)\) by scaling with \(a\) and translating with \(b\) along the time axis, as in Formula (2).  
\[h_{b,a}(t)=h\bigg{(}\frac{t-b}{a}\bigg{)} \tag{2}\]  
The asterisk (\"*\") denotes the complex conjugate of the dilated and translated wavelet function, and \(w(a)\) is the weighting function chosen to be \(1/\sqrt{a}\) for the reason of energy conservation [23].  
WT quantifies the local matching of the wavelet (each of its daughter wavelets \(h_{b,a}\) for a particular scale \(a\) and translation (shifting) \(b\) along the time axis of the signal) with the corresponding segment of the signal. The better the similarity, the larger the coefficient, and vice versa. The particular scale \(a\) (\(a>0\)), which is inversely related to frequency, ensures the change of the window width. By magnifying (stretching) the window function along the time axis, for \(a>1\), the obtained wavelet has a longer time duration than the mother wavelet and is appropriate for extracting the low-frequency information of the signal. By shrinking (contracting), for \(a<1\), the resulting wavelet has a shorter duration than the mother wavelet and is suitable for capturing the high-frequency signal components. The mother wavelet has \(a=1\) and \(b=0\). Signal energy is normalized by dividing the WT coefficients with \(\sqrt{a}\) for each scale. \(h(t)\) is a continuous function in the time domain (and in the frequency domain, too). With CWT, the 1D time series \(x(t)\) can be transformed into 2D time-scale wavelet coefficients (scalogram) and then into time-frequency images (spectrogram). The frequency range of the time-frequency images is related to the chosen scales \(a\).