## 2 Materials and Methods
### Pre-Processing of ECGs  
The ECG sensor used in the ScientISST MOVE dataset amplifies cardiac signals with a gain of 1100 and operates at 3.3 V, enabling a \(\pm\)1.5 mV measurement range, making it sensitive to subtle cardiac changes. Its input impedance of 100 G\(\Omega\) minimizes signal loading, and a 110 dB Common-Mode Rejection Ratio contributes to low noise and interference. The pre-processing of the ECG signal involved several key steps (Figure 2). First, the ECG data, measured in millivolts (mV), were extracted from an.edf file using the pyedflib.EdfReader library in Python. If the signal polarity was reversed, it was corrected through multiplication by \(-1\). Following extraction, the signals, originally sampled at 500 Hz, were downsampled to 100 Hz. This step reduced both the data size and computational complexity, enhancing the efficiency of the algorithm and making it more practical for real-world applications. After downsampling, the biosppy.signals.ecg.ecg function ([[https://github.com/scientist/BioSPPy/blob/main/biosppy/signals/ecg.py](https://github.com/scientist/BioSPPy/blob/main/biosppy/signals/ecg.py)]([https://github.com/scientist/BioSPPy/blob/main/biosppy/signals/ecg.py](https://github.com/scientist/BioSPPy/blob/main/biosppy/signals/ecg.py)) (accessed on 20 November 2024)) from the BioSPPy library [19] was applied to the signal. This function processed the ECG by applying a bandpass Finite Impulse Response (FIR) filter between 0.67 Hz and 45 Hz, removing baseline wander, high-frequency noise, and motion artifacts. It also eliminated the DC offset by subtracting the mean of the filtered signal, ensuring signal stability. The function output the filtered ECG signal, which was then used for further processing and model training. Figure 1: ECG signal examples for different ScientISST MOVE dataset activities [12], such as at baseline, lifting, greetings, gesticulating, jumping, walking, and running. Figure 2: Block diagram of the ECG signal pre-processing steps. Finally, normalization was performed by scaling the signal based on the range between its maximum and minimum values and subtracting the minimum value within a 10 s segment. These pre-processing steps guaranteed that the ECG signal was clean and prepared for further analysis, such as feature extraction. To train the supervised ML model, the ground truth for ECG signals, denoted as 0 (unacceptable) or 1 (acceptable), depicted in Figure 3, was determined through a two-step process:  
1. Data Analysis (Assessment Criteria) [11]: * Acceptable (1): * The ECG rhythm is clear; each QRS waveform can be distinguished with the naked eyes. * Low-intensity high-frequency noise; the R waves in the signal can be recognized accurately. * No more than 2 high-frequency impulse noises occur in the observation window. * Unacceptable (0): * Full of noise. * More than 2 R-peaks in the observation window cannot be distinguished. 2. Application of the BioSPPy Library: In order to obtain the ground truth, the existing function--called ecg.ecg--from the BioSPPy library was used to change the signal before proceeding with the description of the various cardiac features. The main purpose of using this function was to guarantee that the signal would be deemed of sufficiently high quality for the robust calculation of the cardiac features. In cases of poor signal quality, the corresponding features would be replaced by standard established values. * If the function ecg from the BioSPPy library returned the error \"Not enough beats to compute heart rate\" for an ECG segment, this indicated that the signal did not have sufficient recognizable QRS complexes to compute the heart rate. In such cases, the ECG segment was automatically marked as unacceptable (0). * If this error did not occur, it indicated that the signal was sufficiently clean for cardiac feature extraction. In this scenario, the ECG signal was categorized into the appropriate quality level based on the predefined assessment criteria.