4.6. ECG Preprocessing and Feature Extraction

This section outlines the preprocessing and feature extraction methods applied to ECG signals from the DREAMER dataset. This process is illustrated in the following Figure 8.

Figure 8: ECG Signal Processing and Feature Extraction Workflow

4.6.1. ECG Preprocessing

The preprocessing stage begins with loading ECG data from the DREAMER dataset for each participant and video. Using NeuroKit2’s ecg_process function, the data goes through a series of steps including signal cleaning, R-peak detection, heart rate calculation, and QRS complex delineation. Baseline and stimuli data are processed separately for both left and right ECG channels.

4.6.2. ECG Feature Extraction

After preprocessing, features are extracted from both baseline and stimuli signals. The ecg_intervalrelated function in NeuroKit2 calculates key Heart Rate Variability (HRV) metrics, such as mean heart rate and other time-domain features, which provide insights into autonomic nervous system activity. To normalize, stimuli features are divided by baseline features, helping to account for individual variability. The extracted features are then averaged across left and right channels, combined into a single DataFrame.

Last updated