## 3 Diagnosis Using Simulation Data
### Discrete Signal Separation (Lines 8-22)  
The first step is the discrete signal separation that removes the signals from the other sources such as gears and shafts, which we call the discrete (deterministic) signal. The discrete signal can be obtained by the autoregressive (AR) model, which is to estimate the current value of time series data via weighted sum of the past values. Then, the residual signal is obtained by subtracting the AR model, i.e., the discrete part, from the raw signal, as shown in Figure 6.  
Figure 5: Procedure for bearing fault diagnosis. Let us consider a time series \(x(n)\) with \(n=1\), \(N\), which is the raw vibration signal acquired with sampRate per seconds. The AR model is then constructed to predict the next value in a time series by using a series of previous observations, which is described by the following equation [22] (line 15):  
\[x_{p}(n)\ =\ -\sum_{k\ =\ 1}^{p}a(k)x(n-k)\ \text{or in a matrix form}\ x_{p}\ =\ -\mathbf{X}\mathbf{a} \tag{7}\]  
where \(x_{p}(n)\) is the predicted value at \(n\)th time step as a weighted sum of its \(p\) previous values in the sequence, \(p\) is the order of the model, \(a(k)\) is the weighting coefficients, and \(x(n\)-\(k)\) is \(n\)-\(k\)th data. The matrix \(\mathbf{X}\) is an \(N\times p\) matrix consisting of the past series values of \(x\) (line 13-14). The coefficient \(a(k)\) can be obtained by solving the Yule-Walker equation [14,22] (line 12):  
\[\left[ \begin{array}{cccc}r_{xx}(0)&r_{xx}(-1)&\cdots&r_{xx}(-p+1)\\ r_{xx}(1)&r_{xx}(0)&\cdots&r_{xx}(-p+2)\\ \vdots&\vdots&\ddots&\vdots\\ r_{xx}(p-1)&r_{xx}(p-2)&\cdots&r_{xx}(0)\end{array} \right]\ =\ -\left[ \begin{array}{c}r_{xx}(1)\\ r_{xx}(2)\\ \vdots\\ a(p)\end{array} \right] \tag{8}\]  
where \(r_{xx}(k)\) is the autocorrelation function of x(n), which is defined by  
\[r_{xx}(k)\ =\ \frac{1}{N}\sum_{n\ =\ 1}^{N}x(n)x(n-k),\ k\ =\ 0,\ldots,p-1 \tag{9}\]  
In order to illustrate the process, an example is given when \(p=2\). Then, Equation (8) becomes  
\[\left[ \begin{array}{cc}r_{xx}(0)&r_{xx}(-1)\\ r_{xx}(1)&r_{xx}(0)\end{array} \right]\ \left[ \begin{array}{c}a(1)\\ a(2)\end{array} \right]\ =\ -\left[ \begin{array}{c}r_{xx}(1)\\ r_{xx}(2)\end{array} \right] \tag{10}\]  
where  
\[r_{xx}(0)\ =\ [x(1)x(1)+x(2)x(2)+\cdots+x(N)x(N)]/N\]  
\[r_{xx}(1)\ =\ [x(1)x(0)+x(2)x(1)+x(3)x(2)\ldots+x(N)x(N-1)]/N\]  
\[r_{xx}(-1)\ =\ [x(1)x(2)+x(2)x(3)+\cdots+x(N-1)x(N)+x(N)x(N+1)]/N\]  
\[r_{xxOnce the deterministic signal \(x_{p}\) is obtained from the AR model, the residual signal is obtained by subtracting the prediction from this (line 16). Since the order \(p\) affects the prediction performance, it should be determined to make the residual signal represent the fault as best as it can. Depending on its uses, there are several different criteria to determine the order \(p\), such as Akaike information criteria (AIC) [25; 26; 27; 28], Bayesian information criterion (BIC) [29], Minimum description length (MDL) [30], and Partial Autocorrelation Function (PACF) [31]. In the bearing fault diagnosis, the order \(p\) is usually determined such that the kurtosis of the residual signal is maximized, as are addressed in many literatures (e.g., [23]). The latter is used here because it is simpler to calculate and the kurtosis is the impulsiveness indicator of fault signal. For this objective, the kurtosis is calculated by increasing the order \(p\) from 1 to \(\texttt{maxP}=\texttt{300}\) (lines 10-18). The result is in Figure 7a, where the maximum is at \(p=82\), hence, is used for optP (line 19). Then, the AR model is constructed again using this, which is to repeat lines 12-15. In this case, however, it is implemented by the MATLAB function filter, which does the same but in more simple way (line 21). Residual signal thus obtained can be plotted by entering plot(rawData.t (optP+1:end),e) in the MATLAB command window, and is shown in Figure 7b along with its kurtosis value. Additionally, the raw signal and its kurtosis are given in Figure 7c for comparison.