## 2 Materials and Methods
### Signal Processing System  
The LabVIEW programming was used as the interface to display images and defect recognition results, while the main signal processing procedures were completed via the Matlab using the wavelet decomposition and BP neural network method based on expulsion indexes. The signal was decomposed by wavelet analysis method into a series of signals with certain frequency, then the target signal was chosen depending on the energy distribution proportion. In this paper, the Daubechies5 wavelet was selected to match the impact signal and the decomposition level was set at 7. After that, the peak-to-peak amplitude and kurtosis index of the target signal were calculated, which were input factors to classify defect types by BP neural networks. Figure 1: Dimensions of the sample. Figure 2: Signal acquisition system. The electrode force signal of resistance spot welding is a typical non-stationary signal, the distributed parameters change over time. Therefore, neither the traditional time domain analysis nor the frequency domain analysis could express the signal accurately. The wavelet decomposition is a kind of stable and fast time-frequency signal analysis method. The resolution of wavelet transform changes with the change of the scale. Therefore, low frequency band has low time resolution and high frequency resolution, while high frequency band has high time resolution and low frequency resolution, so this resolution of this change can reflect the characteristics of the signal better. Mallat algorithm is a fast approach method of wavelet transform [17]. The analyzed signal \(x(t)\) was decomposed on the scaling function set \(\left\{\varphi_{j,k}\right\}\) to get the approximation signal \(Px(t)\), and on the wavelet function set \(\left\{\Psi_{j,k}\right\}\) to get the detail signal \(Qx(t)\). The formula was as follows:  
\[x_{0}(t)=P_{1}x(t)+Q_{1}x(t). \tag{1}\]  
The process performed a multilevel one-dimensional wavelet analysis using specific wavelet decomposition filters, including the low-pass filter and the high-pass filter. Therefore, the approximation signal and the detail signal on level \(j\) are calculated as follows:  
\[P_{j}x(t)=\sum_{k}c_{k}^{j}\varphi_{j,k},c_{k}^{j}=\sum_{n=0}^{p-1}h(n)c_{2k+ n}^{j-1}, \tag{2}\]  
\[Q_{j}x(t)=\sum_{k}d_{k}^{j}\Psi_{j,k},d_{k}^{j}=\sum_{n=0}^{p-1}g(n)c_{2k+n}^{ j-1}, \tag{3}\]  
where \(x_{0}(t)=x(t)\), \(L\) is the layer of the decomposition, \(N\) is the length of the analyzed signal, \(j=1,2,\ldots,L\), \(k=0,1,\ldots,\frac{N}{2^{j}}-1\), \(p\) is the length of the weight coefficient, \(h(n)\) and \(g(n)\) are the weight coefficients of the low-pass filter and the high-pass filter, respectively. The approximate coefs and the detail coefs were obtained, as shown in Figure 3.  
\(x(t)\) was eventually represented as Equation (4) after \(L\) levels' iterations. \[x_{j-1}(t)=P_{j}x(t)+Q_{j}x(t)=\sum_{k}c_{k}^{j}\varphi_{j,k}+\sum_{k}d_{k}^{ j}\Psi_{j,k}. \tag{4}\]  
Finally, the energy of each detail signals \(Qx(t)\) were calculated and the highest one was selected as the target signal. The expulsion indexes of the target signal were calculated as the input parameters of the BP Neural Networks. The selection and influence of the expulsion indexes will be discussed in Section 3.2. Artificial Neural Network (ANN) is a computing system inspired by the biological neural network that constitute animal brains [18]. A large number of nonlinear parallel processors are used to simulate numbers of human brain neurons. The flexible connections among the processors are to simulate the synapse behavior of human brain neurons. The system will induce rules from the input data  
Figure 3: Flow chart of the coefs. automatically, and obtain the inherent law of these data. The different connecting mode between the neurons will obtain the neural network with different characteristics. Back propagation (BP) is a typical kind of simple forward network and is most widely used, which was proposed by [PERSON] and [PERSON] [19].