# Depth Evaluation of Tiny Defects on or near Surface Based on Convolutional Neural Network
## 2 Materials and Methods
### Signal Processing Methods  
The A--scan signals corresponding to defects at various depths were extracted from the raw data matrix. These signals were then transformed into frequency spectra using the fast Fourier transform (FFT). The frequency spectra were overlaid with the original time-domain signals, as depicted in Figure 4. In this figure, the black curve represents the time-domain signal, while the blue curve represents the frequency-domain signal. The superposition of defect echoes with the surface-direct wave signal results in a distortion of the surface wave signal in the time domain and a shift in the peak position. The impact of defect echoes becomes more pronounced as the defect depth decreases. In the frequency domain, the surface wave signal with a central frequency of 5 MHz is effectively suppressed by the defect signal with a central frequency of 2 MHz. Consequently, as the defect depth increases, the spectrum gradually shifts from being dominated by a 2 MHz signal to a dual-peak signal with 2 MHz and 5 MHz as the primary components. In summary, changes in defect depth have a noticeable impact on both the time and frequency domain characteristics of the signal. Therefore, a comprehensive analysis based on the signal's time-frequency features allows for a better assessment of defect depth. Figure 3: The laser ultrasonic data acquisition system: **(a)** schematic diagram, **(b)** scanning strategy, **(c)** 3D data storage. Wavelet transform is currently one of the prevailing signal processing methods for time-frequency analysis. It builds upon and extends the localization concept of the short-time Fourier transform (STFT). The continuous wavelet transform (CWT) is particularly noteworthy for its ability to adapt the size of the time-frequency window, which outperforms the STFT's constant window size. CWT has the capability to decompose signals of complex modes into fundamental forms, allowing for effective feature identification within the signal. It can also emphasize critical features of the signal and highlight variations in sensitive parameters. Within the realm of CWT, various wavelet basis functions are available, including the Coiflet, Cmor, Haar, and Morlet wavelets, among others. In this research, the Morlet wavelet was chosen as the basis function for CWT due to its superior capacity to capture the time-frequency characteristics of the wave signal. For a one-dimensional signal \(f(t)\), CWT can be expressed as follows, where \(\psi(t)\) represents the wavelet basis, and a and b denote the scale and translation factors, respectively:  
\[\left(\omega_{\psi}f\right)(a,b)=\frac{1}{\sqrt{a}}\int_{-\infty}^{+\infty}f( t)\overline{\psi}(\frac{t-b}{a})dt \tag{1}\]  
\[\psi_{a,b}(t)=\frac{1}{\sqrt{|a|}}\psi\left(\frac{t-b}{a}\right)\quad a,b\; \epsilon\;R.a\
eq 0 \tag{2}\]  
The original A--scan signals corresponding to different defects were subjected to continuous wavelet transform (CWT), and the results are shown as RGB images, as illustrated in Figure 5. This graphical representation allows for the simultaneous observation of both the time and frequency domain characteristics of the signal. The region outlined in red is the focal area of interest within the time-frequency plot. It displays crucial parameters such as the peak amplitude and time coordinates in the time domain, as well as variations in different frequency components in the spectrum. Figure 4: The ultrasonic A—scan signal and its spectra of different defect depths: (**a**) 0.1 mm, (**b**) 0.2 mm, (**c**) 0.3 mm, and (**d**) 0.5 mm. Figure 6a displays an ultrasound B--scan signal corresponding to a specific moment in time. The red box within the image outlines the location of the pre-embedded defect. Based on the signal amplitude, a traversal and a preliminary screening of the ultrasound data within the red box were conducted to obtain the central region of the defect (highlighted in the black box within the image).