1 %we assume the pre-processed physilogical signals in mat file from DEAP data is being used
2 %
this script loads the DEAP data and converts it to the EEGLAB format that
4 %I added minimally required fields to the structure
5 %Mohammad Soleymani June 2015 mohammad.soleymani@unige.ch
7 %Takes the path physio_files_path and writes the mat files in eeglab format
10 electrode_labels = {
'Fp1',
'AF3',
'F3',
'F7',
'FC5',
'FC1',
'C3',
'T7',
'CP5', ...
11 'CP1',
'P3',
'P7',
'PO3',
'O1',
'Oz',
'Pz',
'Fp2',
'AF4', ...
12 'Fz',
'F4',
'F8',
'FC6',
'FC2',
'Cz',
'C4',
'T8',
'CP6', ...
13 'CP2',
'P4',
'P8',
'PO4',
'O2',
'hEOG',
'vEOG',
'zEMG',
'tEMG',
'GSR',
'RESP',
'BVP',
'HST'};
18 phys_data.srate = 128;
19 phys_data.ref=
'common';
20 phys_data.trials = 40;
21 phys_data.nbchan=41; %added one since ground is added
22 phys_data.epoch = 1:40;
24 phys_data.chanlocs(i).labels = electrode_labels{i};
26 phys_data.chanlocs(41).labels =
'GND'; %ground channel
28 fprintf(
'loading and converting subject %0.2d\n',subject);
30 mat_file = sprintf(
'%s/s%0.2d.mat',physio_files_path,subject);
32 ratings{subject} = labels;
33 % we add a zero channel to be used as the second lead
for the EMG
35 phys_data.data = zeros(size(data,2)+1,size(data,3),size(data,1));
38 phys_data.data(chan,:,epoch) = squeeze(data(epoch, chan, :));
41 eeglab_file = sprintf(
'%s/s%0.2d_eeglab.mat',physio_files_path,subject);
42 save(eeglab_file,
'phys_data');
45 fprintf(
'Done! Successfully converted the mat files\n',subject);