# Continuous Wavelet Transform and CNN for Fault Detection in a Helical Gearbox
## 2 Continuous Wavelet Transform (CWT) for Fault Diagnosis
### CWT Filter Bank  
For the discrete version of Formula (1), the signal \(x(t)\) is sampled with the frequency \(F_{s}\) and the associated sampling interval \(T_{s}=1/F_{s}\). The CWT at the time step (translation) \(b\) = \(kT_{s}\) is given by the approximated sum defined in Formula (3). \[CWT(a,kT_{s})\approx\frac{T_{s}}{\sqrt{a}}{\sum_{n}x(nT_{s})\ h^{*}\bigg{(} \frac{(n-k)T_{s}}{a}\bigg{)}} \tag{3}\]  
Extra computational effort arises from each scaling factor \(a\), which causes a resampling of the wavelet at the sampling interval \(T_{s}/a\)[24]. The wavelet transform in the frequency domain is less difficult to calculate by using rapid algorithms for direct and inverse FFT and is followed by multiplication operations as shown in Formula (4) [23; 25]:  
\[CWT(a,b)=\sqrt{a}\ F^{-1}\{X(f)H^{*}(a\ f)\}, \tag{4}\]  
where \(X(f)\) and \(H(f)\) are the Fourier transforms of the signal \(x(t)\) and the wavelet \(h(t)\), respectively, and \(F^{-1}\) is the inverse Fourier transform. Complex wavelets (like the case of complex Morlet) do not have negative frequency components after the Fourier transform, as opposed to real wavelets that have negative components in the spectrum. Through CWT, the vibration signal is decomposed into different time-frequency scales, known as scalograms. WT represents lower frequency components with finer frequency resolution and coarser time resolution. For higher frequencies, in contrast, the frequency resolution is coarser and the time resolution is finer [5]. The mother wavelet \(h(t)\) is centered in time at \(t\) = 0. The Fourier transform of \(h(H(f))\) is centered at \(\eta\) on the frequency axis. After the \(t\) variable changes to \((t-b)/a,h_{b,a}\) is centered at \(t=b\) and the Fourier transform \(F(h_{b,a})\) dilates \(H(f)\) with \(1/a\), so its center frequency becomes \(\eta/a\) on the frequency axis [26]. Hence, for a decreased scale \(a\), the time span is reduced, and the frequency spread increases, covering a shifted interval towards high frequencies. In [PERSON] et al. [27], a priority is used to select the frequency range of important components without experts to augment CWT for fault diagnosis since the frequency resolution is limited. To obtain the importance score of the frequencies used to select the frequency range for data preprocessing for bearing fault detection, an integrated gradient-based continuous wave transform (IG-CWT) method was applied. For the continuous wavelet analysis (CWA), one can have more than one wavelet per octave (often between eight and sixteen), and the shift between wavelets on the time axis (time shift) is one sample. For CWA, the frequency content of a signal, often described by a filter bank, is captured more finely than with discrete wavelet techniques. On the other hand, one gets the same time resolution as the original data for each frequency band. Filter bank is an array of band-pass filters that divides the analyzed signal \(x(t)\) into multiple components. Each component carries a single frequency sub-band of \(x(t)\). For CWA, the common spacing between adjacent filters is calculated according to Equation (5). \[f_{i+1}/f_{i}=2^{1/NV}, \tag{5}\]  
where \(NV\) is the number of filters or voices per octave, and \(i\) is the index of any filter. The spacing used exclusively in discrete wavelet analysis is given by two raised to integer power. As the number of voices per octave increases, the scale resolution becomes finer and the amount of computation required also increases (CWT must be computed for every scale). Figure 1, generated with MATLAB, shows the frequency responses of the CWT filter bank for the current application. Two central frequencies are marked in Figure 1. The first frequency (2297.67 Hz) corresponds to the second larger bandpass filter after the 2 kHz filter. The second frequency (3732.17 Hz) is associated with the filter before the last filter of interest (4 kHz). The central frequencies are calculated with Formula (6), where the index of \(f\) is the central frequency value [Hz] of the corresponding filter.