4.1.2. EDA Feature Extraction Methods

After the artifact removal phase, features were extracted from the EDA signal. This signal has two components phasic and tonic; features from both components were extracted (see Table 2). The cvxEDA tool [42] was used for the decomposition of the signal into these components. This tool uses convex optimization to estimate the Autonomic Nervous System (ANS) activity that is based on Bayesian statistics.

Tonic Component Features

The tonic component in the EDA signal represents the long-term slow changes. This component is also known as the skin conductance level. It could be regarded as the indicator of general psychophysiological activation [43].


**Table 2.** EDA features and their definitions.

Phasic Component Features

The phasic component represents faster (event-related ) differences in the SC signal. The Peaks of phasic SC component as a reaction to a stimulus is also called Skin Conductance Response [43]. After we decompose the phasic component from the EDA signal, peak related features were extracted.

4.1.3. Heart Activity Preprocessing (Artifact Detection and Removal) and Feature Extraction Methods

Heart activity (or, more specifically, HRV) reacts to changes in the autonomic nervous system (ANS) caused by stress [44] and it is, therefore, one of the most commonly used physiological signal for stress detection [40]. However, vigorous movement of subjects and improperly worn devices may contaminate the HRV signal collected from smartwatches and smart bands. In order to address this issue, we developed an artifact handling tool in MATLAB programming language [45] that has batch processing capability. First, the data were divided into 2 min long segments with 50% overlapping. Two-minute segments were selected because it is reported that the time interval for stress stimulation and recovery processes is around a few minutes [46]. The artifact detection percentage rule (also employed in Kubios [47]) was applied after the segmentation phase. In this rule, each data point was compared with the local average around it. When the difference was more than a predetermined threshold percentage, (20% is commonly selected in the literature [48]), the data point was labeled as an artifact. In our system, we deleted the inter-beat intervals detected as the artifacts and interpolated these points with the cubic spline interpolation technique which was used in the Kubios software [47]. The time-domain features of HRV are calculated. In order to calculate the frequency domain features, we interpolated the RR intervals to 4 Hz. Then, we applied the Fast Fourier Transform (FFT). These time and frequency domain features (see Table 3) were selected because these are the most discriminative ones in the literature [30,49,50].


**Table 3.** HRV features and their definitions [32].
