## 2 Methodology
### Feature Extraction by Wavelet Packet Decomposition  
In the robot operation, the signals acquired from the motor are nonstationary. In this case, approaches based on the time-frequency domain such as the wavelet transform are more appropriate than those on the frequency domain such as the fast Fourier transform. In this study, wavelet packet decomposition (WPD) is employed for the purpose of feature extraction, which is briefly described as follows:  
Wavelet packet consists of a set of linearly combined wavelet functions, which are generated using the following recursive relationship [16; 17]:  
\[\left\{\begin{aligned} & u_{2n}(t)=\sqrt{2}{\sum\limits_{k}}{h(k)u_{n}(2t-k)}\\ & u_{2n+1}(t)=\sqrt{2}{\sum\limits_{k}}{g(k)u_{n}(2t-k)}\end{aligned}\right. \tag{1}\]  
where \(u_{0}(t)=\phi(t)\) is the scaling function, \(u_{1}(t)=\psi(t)\) is the wavelet function, and \(n\) is an integer from 0 to \((2^{j}-1)\). Functions \(h(k)\) and \(g(k)\) represent coefficients of low-pass and high-pass filter of Quadrature mirror filters (QMF) which are related to each other by \(g(k)={(-1)}^{k}h(1-k)\). For each step of the decomposition, the input signal \(c(t)\) is decomposed into approximation in low frequency and detail in high frequency, which is expressed recursively as:  
\[\left\{\begin{aligned} & c_{j+1,2n}(t)={\sum\limits_{m}}{h(m-2k)c_{j,n}(t)}\\ & c_{j+1,2n+1}(t)={\sum\limits_{m}}{g(m-2k)c_{j,n}(t)}\end{aligned}\right. \tag{2}\]where \(c_{j,n}\) denotes the wavelet coefficients at the \(j\)-th level, \(n\)-th sub-frequency band. As a result, the original signal \(x(t)\) can be expressed as the sum of the coefficients as follows:  
\[x(t)=\sum\limits_{n=0}^{2^{j}-1}c_{j,n}(t) \tag{3}\]  
An example of a 3-level decomposition of the signal \(x(t)\) using the WPD is shown in Figure 2.  
Given the decomposed coefficients, wavelet energy (WE) is extracted as a feature for each frequency band, which is defined as below.  
\[E_{j}^{n}=\sum\limits_{t=1}^{N}(c_{j,n}(t))^{2} \tag{4}\]  
Also, 13 statistical time-domain features commonly used in the fault diagnosis are extracted for each band, as shown in Table 1[18; 19; 20].  
\begin{table}
\begin{tabular}{c c c c} \hline \hline
**Feature Name** & **Formula** & **Feature Name** & **Formula** \\ \hline Mean & \(\frac{\sum X}{N}\) & Impulse factor (IF) & \(\frac{\max[X]}{\frac{N}{N}\sum[X]}\) \\ Standard deviation (STD) & \(\sqrt{\frac{\sum(X-\overline{X})^{2}}{N-1}}\) & Margin factor (MF) & \(\frac{\max[X]}{\left(\frac{1}{N}\sum\sqrt{|X|}\right)^{2}}\) \\ Root mean square (RMS) & \(\sqrt{\frac{\sum X^{2}}{N}}\) & Peak & \(\max[X]\) \\ Skewness (SK) & \(\frac{\frac{N}{N}\sum(X-\overline{X})^{3}}{\frac{\sum X}{STD}}\) & Peak to peak (P2P) & \(\max(X)-\min(X)\) \\ Kurtosis (KUR) & \(\frac{\frac{N}{N}\sum(X-\overline{X})^{4}}{\frac{\sum X}{STD}}\) & Shannon entropy (SE) & \(-\underset{i}{\sum}s_{i}^{2}\log(s_{i}^{2})\) \\ Shape factor (SF) & \(\frac{RMS}{N}\sum|X|\) & Log energy entropy (LEE) & \(\underset{i}{\sum}\log(s_{i}^{2})\) \\ Crest factor (CF) & \(\frac{\max[X]}{RMS}\) & & \\ \hline \hline \end{tabular}
\end{table}
Table 1: Statistical features.  
Figure 2: Tree of wavelet packet decomposition.