## 4 Experimental Methodology
### Data Preparation
#### 4.2.2 Feature Extraction  
Feature extraction is a crucial step in the machine learning process because it transforms the raw data into a set of relevant and meaningful attributes that better represent the underlying patterns necessary for analysis. By isolating these key features, feature extraction helps to reduce the dimensionality of the data, making it more manageable and computationally efficient for machine learning algorithms to process. In addition, effective feature extraction helps reduce the risk of overfitting when the model might otherwise tend to merely over-replicate erroneous patterns. There are many techniques to extract features. In particular, the frequently used ones are [43]:  
* Time-Domain Features--signal amplitude, zero-crossing rate, sum of squared amplitudes (signal energy), signal entropy. * Frequency-Domain Features--Fourier Transform, Power Spectral Density (PSD), Spectral Centroid, Spectral Bandwidth. * Time-Frequency Features--Wavelet Transform, Short-Time Fourier Transform (STFT). * Statistical Features--Statistical measures that describe the distribution and shape of the signal data (mean, variance, skewness, kurtosis, etc. ), autocorrelation. * Other the application-specific techniques. To extract signal features, we used the Diagnostic Feature Designer tool from Matlab software. It allows rapid feature extraction of signals using selected techniques and the subsequent selection of the most relevant features using multiple evaluation algorithms that use specific criteria to determine which features are the most effective. As mentioned previously, a large number of criteria are defined for rotating machines and components such as gearboxes, bearings, and rotors of electric motors [5]. However, for sequential mechanisms, there is a lack of research in the relevant field. For this reason, it is difficult to predict what signal characteristics will best indicate the state of the device. At the same time, the dataset contains nine parameters, so calculating all possible properties that the software offers for all signals and their subsequent analysis would be time-consuming and computationally intensive. Therefore, we decided to use only statistical features, and  
Figure 5: Examples of normal and anomaly sequences. for the first attempt, feature extraction was performed for one sensor (using data from all three axes). For the sensor located at the front of the robot's base (see Figure 3), the basic statistical features of the signal were computed. These properties can be applied to any kind of signal, including the time-synchronized average (TSA) vibration signal. Any changes in these features can indicate changes in the state of the system. The calculated features are:  
* clearance factor,
* crest factor,
* impulse factor,
* kurtosis,
* mean,
* RMS,
* skewness,
* std. Next, selecting the features that most accurately represent the predicted variable is necessary. From an initial point of view, a feature can be effective if it separates data groups with different state labels (normal and anomaly) with sufficient clarity. For an initial evaluation of the effectiveness of the feature, histograms were plotted (Figure 6) to show the separation of data between the group of normal and anomalous sequences. Figure 6 shows histograms representing the distribution of various statistical properties of the dataset. The width of one column in each case is chosen individually depending on the range of change in the value of a given property for a better graphical representation. From the analysis of these bar charts, it is possible to observe that even though none of the metrics show a perfect distribution of normal and abnormal sequences, it is possible to observe the following dependencies:  
* ClearanceFactor, PeakFactor, Mean, Std, RMS, and PeakValue properties have the lowest overlap (shown in brown in Figure 6) between them, and a slight rightward  
Figure 6: Feature histograms for normal and anomaly data.