# Anomaly Detection Method in Railway Using Signal Processing and Deep Learning
## 3 Signal Processing to Improve Deep Learning Results  
### Pre-Processing of Train, Validation, and Test Data Using the Signal Processing Method  
Deep learning results of data with and without signal processing application were compared. In this study, two signal processing methods, order analysis and STFT were used. First, order analysis was used in the time domain. In this paper, order analysis is defined as the number of events occurring per unit rotation. Order analysis requires changing the signal to the angular domain before performing FFT of the time domain data [22]. For this reason, order analysis is used to prevent changes in frequency components in a rotating device with varying rotational speeds [23]. Since railway vehicles have various  
Figure 11: Schematic of the instrumentation setup for wheel flat measurements [21]. Figure 10: Acceleration signals of x, y, and z axis due to wheel flat impact against rail. speed changes while driving, it is more useful to convert from the time domain to the angular domain. The tachometer in railway vehicles is always attached to the axle box to measure the rotational speed of the wheelset, which has the advantage of eliminating the need for additional device configuration to convert to the angular domain. Figure 12. shows the conversion of the flat signal from the time domain to an angular domain. Second, STFT was used since the deep learning algorithm used in this paper is CNN, and CNN is an algorithm suitable for image and video processing, the spectrogram image obtained by STFT was used as learning data. STFT, along with FFT, is one of the most popular analysis methods in the field of noise and vibration analysis [24]. Although the FFT cannot make the frequency change information over time, the STFT can confirm the frequency change information over time by supplementing the disadvantage of the FFT. Figure 13 shows the difference between the STFT and the FFT, where the frequency components of \(10\) Hz, \(20\) Hz, and \(30\) Hz reprinted from ref. [17]. However, as described above, the frequency change according to time elapse could not be visualized through the FFT. This is the second reason for choosing STFT in this paper. Figure 12: Conversion of the flat signal from the time domain to an angular domain. Figure 13: Difference between (**a**): FFT and (**b**): STFT [17]. However, there are additional variables to be considered in order to prepare preprocess data that is suitable for deep learning in STFT analysis. First of all, we should consider that the result is different depending on the window function. The analysis results according to the window function were compared. Before comparison, only the frequency band due to wheel flats was set using the Y-Limit function in Matlab, as shown in Figure 14[25]. For the window function, both the Rectangular function and Hanning function were compared. At this time, the comparison was made using the data of one flat per wheel. The result is shown in Figure 15. This result shows that the Hanning window is more appropriate because of precise resolution. As a second consideration, it is shown that both the frequency and the time resolution vary according to the window length. For example, if the window length is increased, the frequency resolution is improved, but the time resolution degrades. Thus, it should be properly adjusted for the purpose of analysis. However, there is a way to adjust the overlap to alleviate these shortcomings using the concept of overlap shown in Figure 16[26]. It means that when windows are applied, the windows overlap each other. Figure 14: Frequency band due to wheel flats. Figure 15: Comparison of Rectangular function and Hanning function. In order to find the window length suitable for this study, the window length was incrementally changed and compared. The data of four wheel flats with window lengths of 128 and 64, respectively, were compared, and the results are shown in Figure 17. As a result of the analysis, it was judged that it was more appropriate to set the window length to 64.