1 %extracting features from DEAP database
2 %path where the mat files are stored
3 %You need to go to http:
4 %You should download the mat files and the ratings and set the correct path
6 TEAP_path = fileparts(pwd);
8 eval([
'cd ' TEAP_path]);
10 eval([
'cd ' curr_path]);
11 %replace the following line by where your phsyio data is located
12 physio_path =
'DEAP/physio_data/';
13 %replcae the following path with your local path of the ratings
14 feedbacks = readtable(
'DEAP/metadata/participant_ratings.csv');
15 if ~exist([physio_path
'/s30_eeglab.mat'],
'file')
19 eeglab_file = sprintf('%ss%0.2d_eeglab.mat',physio_path,subject);
22 %exracting EMG feaures
23 %TODO extract by subject by epoch
25 [features(subject,epoch).EMG_feats, features(subject,epoch).EMG_feats_names] = ...
27 %extracting EEG features
28 [features(subject,epoch).EEG_feats, features(subject,epoch).EEG_feats_names] = ...
30 %extracting GSR features
31 [features(subject,epoch).GSR_feats, features(subject,epoch).GSR_feats_names] = ...
33 %extracting BVP features
34 [features(subject,epoch).BVP_feats, features(subject,epoch).BVP_feats_names] = ...
36 %extracting skin temperature features
37 % we skip this since there appear to be problems with the HST
38 % signal in the mat files - they are incorrect
39 %[features(subject,epoch).HST_feats, features(subject,epoch).HST_feats_names] = ...
41 %extracting respiration features
42 [features(subject,epoch).RES_feats, features(subject,epoch).RES_feats_names] = ...
44 feedback = feedbacks(feedbacks.Participant_id==subject & feedbacks.Experiment_id==epoch,:);
45 features(subject,epoch).feedback.felt_arousal = feedback.Arousal;
46 features(subject,epoch).feedback.felt_valence = feedback.Valence;
47 features(subject,epoch).feedback.felt_dominance = feedback.Dominance;
48 features(subject,epoch).feedback.felt_liking = feedback.Liking;
49 features(subject,epoch).feedback.felt_familiarity = feedback.Familiarity;
50 fprintf('extracted all the features for subject %d epoch %d\n',subject, epoch);
55 %we store the features in the same path where the signals were
56 save([physio_path 'deap_features.mat'],'features');
59 fprintf('Done! Successfully extracted the feaures\n');