sub = 1;
load subject1.mat
% veldat(hand): samples, joints, reps, tasks,sub
% oridat(eeg): samples, chs, reps, tasks
% 8 bandwidths
njoint = 10;
ntask = 6;
nrep = 30;
nch = 32;
nban = 8;
veldat = EEGdat;
oridat = gdat;
%%%%%%%%%%%%%%%%%%%%%%%%% EEG data %%%%%%%%%%%%%%%%%%%%%%%%%
%%%%%%% averaged bandpower features within segments %%%%%%%
N = size(oridat,1); % number of samples
n = (1-1/4)*N/(N/4/4)+1;
sg = round(size(oridat,1)/4); % total 2s, pick 0.5s segment
ll = round((size(oridat,1)/4)/4); % 75% overlap
for task = 1:ntask
for rep = 1:nrep
for ch = 1:nch
edat = zscore(oridat(:,ch,rep,task)); % standardization
for i = 1:n
sg1 = (i-1)*ll+1;
sg2 = (i-1)*ll+sg;
segE(i,ch,rep,task) = bandpower(edat(sg1:sg2));
end
end
end
end