1 %we assume the pre-processed physilogical signals in mat file from DEAP data is being used
2 %
this script loads the MAHNOB data and converts it to the EEGLAB format that
4 %I assume the data is in MAHNOB_path
5 %I added minimally required fields to the structure
6 %Mohammad Soleymani June 2015 mohammad.soleymani@unige.ch
7 %Takes the path physio_files_path and writes the mat files in eeglab format
9 %
for ECG we take the ECG2-ECG3 as the lead
13 %replace thee following line by the location where you saved the mat files
14 MAHNOB_path =
'MAHNOB-HCI/teapformat/';
16 files_physio = dir([MAHNOB_path
'*_eeglab.mat']);
17 %there is only one epoch
19 for i = 1:length(files_physio)
20 fprintf(
'loading file %s\n',files_physio(i).name);
21 s = strsplit(files_physio(i).name ,
'_');
24 eeglab_file = sprintf(
'%s%s',MAHNOB_path,files_physio(i).name);
28 feedback_file = strrep(eeglab_file,
'eeglab',
'feedback');
30 features(subj_id,trial_id).feedback = feedback;
31 %extracting ECG features
32 [features(subj_id,trial_id).ECG_feats, features(subj_id,trial_id).ECG_feats_names] = ...
34 %extracting EEG features
35 %average re-referencing
37 [features(subj_id,trial_id).EEG_feats, features(subj_id,trial_id).EEG_feats_names] = ...
39 %extracting GSR features
40 [features(subj_id,trial_id).GSR_feats, features(subj_id,trial_id).GSR_feats_names] = ...
42 %extracting skin temperature features
43 [features(subj_id,trial_id).HST_feats, features(subj_id,trial_id).HST_feats_names] = ...
45 %extracting respiration features
46 [features(subj_id,trial_id).RES_feats, features(subj_id,trial_id).RES_feats_names] = ...
48 fprintf(
'extracted all the features for subject %d trial %d\n',subj_id, trial_id);
51 %correct the following path to where you want your features to be saved
52 save(
'mahnob_features.mat',
'features');
55 fprintf(
'Done! Successfully extracted the feaures\n');