*4.2. Data Pre-Processing*

We calculate the magnitude of a tri-axis accelerometer to remove the orientation constraints in WD and SC tasks except for the evaluation of orientation.

$$d = \|A\mathfrak{cc}\| = \sqrt{x^2 + y^2 + z^2} \tag{3}$$

For WD, the raw data of the sensor are first filtered by a low-pass filter with a cut-off frequency of 15 Hz and then segmented into frames of 3 s with 0.5 s overlap. For the evaluation of window size, overlap is always one-sixth of the window size. We record the start time and end time of each activity and then label the data. The activity recognition is performed based on these frames and the labels.

For SC, contexts such as subjects, placements, movement intensities and speeds would cause the deviation of the amplitude, variance, maximum and minimum of the raw sensor data; thus, normalization is necessary. We normalize the raw data by variance since it outperforms other normalization methods such as maximum, minimum and amplitude.
