## 4 Results
### Tests with STFT  
For the sake of a comparison between scalograms and spectrograms, in this section, the STFT was applied to generate the spectrograms.  
With the STFT, data relating to the localized bearing defect, with and without the second fault condition due to LFTO, were fed into the network, separately or jointly, to have a direct comparison with the result obtained in Section 4.3. Only the data from the current signal were used, since only this signal had been measured in the case of LFTO.  
The spectrogram generation was obtained with the same data as presented in Section 4.3, but the data were mean-var normalized and decimated with a decimation factor of 20 or  
Figure 16: Scalogram images obtained with decimated data of the current signal: (**a**) single fault condition H6 and (**b**) double fault condition (H6 and LFTO).  
Figure 15: Confusion matrices (test set) obtained with decimated data: (**a**) single fault and (**b**) double fault.  
30, since this has given better classification results previously (tests from non-decimated spectrograms have been omitted due to their very low classification accuracy). The number of images generated for each class was kept to 60, the base sampling frequency was 120 kS/s, and the base input segment length was 100,000 samples, as in the previous tests presented.  
The input decimated frequency and input signal length with the parameters for the spectrograms' generation are shown in Table 6.  
The spectrogram was generated through the use of the MATLAB \"spectrogram\" function. The input parameters were the window length, the overlapping samples, the number of DFT points, and the (decimated) sampling frequency used; these parameters are shown in Table 6. With this setup, the Hamming function was used for the windowing of each 750-point window by default. This function returned a matrix representing the Power Spectral Density (PSD) of each segment.  
After generating the spectrograms, a conversion into dB values was performed; to convert into dB values, a small constant \"epsilon\" value was added to the matrix element values in order not to have problems with the logarithmic calculation of numbers very close to zero. Finally, the jpg images were generated using the \"imwrite\" function with the \"jet\" colormap and stored in dedicated folders. All the images were resized to dimensions of 224 \(\times\) 224 through the \"imresize\" MATLAB function, which uses bicubic interpolation of the data. In Figure 17, some spectrograms relevant to the current signal with the LFTO condition are shown.  
\begin{table}
\begin{tabular}{c c c c c c c} \hline \hline \multirow{2}{*}{**Decimation Factor Used**} & **Decimated Sampling Frequency** & **Number of Samples (Decimated)** & **Window Length** & **Overlapping Samples** & **Number of DFT Points** & **Dimension of the Spectrogram Generated** \\ \hline \multicolumn{8}{c}{**Input Segment**} & \multicolumn{8}{c}{**Parameters for the Spectrogram Generation**} \\ \hline
20 & 6 kHz & 5000 & 750 & 739 & 452 & 227 \(\times\) 387 \\
30 & 4 kHz & 3333 & 750 & 739 & 452 & 227 \(\times\) 235 \\ \hline \hline \end{tabular}
\end{table}
Table 6: Parameters chosen and size of the spectrogram images generated.  
Figure 17: Examples of spectrograms of the current signal with localized fault and with LFTO condition. The decimation factor used was 30.  
Tests were carried out with four classes per setup (the four localized faults without LFTO and the four localized faults with LFTO) and with a setup of eight classes in which all the cases considered were fed together into the network, as previously in Section 4.3.