## 2 Materials and Method
### Vibration Signal Capturing and Processing for TWCM System
#### 2.1.2 Advanced Vibration Signal Processing  
Due to the nature of the machining operation, and the obstructive nature of the operation, the vibration signal needs to be processed for the proposed machine learning algorithm to achieve a great result. A graphical plot of the vibration data from the tool classes against the time interval is presented in Figure 3, for which the cutting tools were replaced at different intervals to capture the varying vibration signals being transmitted by different cutting tool classes. The plot illustrates the different vibration signals of each class of cutting tool used for the machining operation. The vibration signal can be observed on the graph. The excitation is firstly due to the alignment of the accelerometer (vibration sensor) to the gravitational field and, secondly, because of the power generated due to the reaction between the cutting tool and the workpiece during the turning operation. The vibration signals may vary as the tool gradually moves from one phase of the condition to another; therefore, to be able to discriminate the signals propagated as the tool condition changes, a new signal that can be differentiated based on the shape of oscillation and how quickly the signal varies over time was created from the vibration signals. Figure 2: Image Showing the Server for Vibration Signal Capturing. The major characteristics of the vibration signals captured during the machining operation are the non-linearity and non-stationary natures of the signals. Non-stationary continuous signals are composed of sinusoidal waves with a distinct change in frequency. Therefore, a signal processing method capable of analyzing these signal characteristics must be adopted. Since the fast Fourier transform (FFT) is ideal for linear and stationary signals due to its uniform trigonometric function, wavelet transform was introduced as an alternative to extracting time-frequency resolutions of a signal. However, the EMD method is a better approach for analyzing non-linear and non-stationary signals. This is because the EMD method is based on the data, in contrast to most other methods. The EMD method decomposes signals into components to provide insight into inherent features. The signal is decomposed into a finite number of IMFs (real part) and the residual (imaginary part), as indicated in Equation (1):  
\[f(t)=\sum_{i}imf_{i}+\textit{res} \tag{1}\]  
where \(imf_{f}\) represents the intrinsic mode functions and the residual. The EMD function evaluates the local extrema of the signal and fits the maxima (\(E_{up}(t)\)) and the minima (\(E_{low}(t)\)) to an individual envelope. The mean of the upper and lower envelope is determined as indicated in Equation (2):  
\[E_{mean}(t)=\frac{\left(E_{up}(t)+E_{low}(t)\right)}{2} \tag{2}\]  
The residual component of the signal is determined as indicated in Equation (3):  
\[\textit{res}(t)=f(t)-E_{mean}(t) \tag{3}\]  
Figure 3: Graph of Vibration by Color Against Time. Since the process is finite, the stopping criterion is determined by Equation (4):  
\[\sum t=\frac{\left(\mathit{res}(t)-f(t)\right)^{2}}{f(t)^{2}}<< \tag{4}\]  
Therefore, the decomposition stops when the residual approaches a monotonic function. The signal is decomposed into IMFs and residuals, as indicated in Figure 4.  
To determine the instantaneous properties from the decomposed IMFs and residuals, the Hilbert-Huang transform (HHT) was applied. HHT was applied to compute the instantaneous energy and instantaneous frequency of each IMF mode. For each IMF, \(\boldsymbol{x}_{i}\), the HHT function computes the components as indicated in Equation (5):  
\[\boldsymbol{x}_{i}=f(i)+iH\{f(t)\}=A(t)e^{i\varphi(t)} \tag{5}\]  
where \(H\boldsymbol{x}_{i}\boldsymbol{f}\) is the Hilbert transform of \(\boldsymbol{x}_{i}\boldsymbol{f}\) is amplitude, and \(\boldsymbol{\varphi}\) is instantaneous phase.