Newer
Older
masterarbeit / topoplot / plotOneSubjectOneDay.m
@Jan-Peter Hohloch Jan-Peter Hohloch on 17 Nov 2016 1 KB alpha and beta band for topoplot
function plotOneSubjectOneDay()
    pathToFile='/home/jph/Uni/masterarbeit/origData/';
    eloc_file='/home/jph/Uni/masterarbeit/topoplot/electrocaps_all.locs';
    maxFile=5;
    stepSize=1;

%     [subjects,numbers]=namesAndNumbers(pathToFile);
%     numbersMat=cell2mat(numbers);
%     subjectsForNumbers=cell(size(numbersMat,2),1);
%     j=1;
%     for i=1:size(subjects,2)
%         subject=subjects{i};
%         for number=numbers{i}
%             subjectsForNumbers{j}=subject;
%             j=j+1;
%         end
%     end
%     j=fix(rand()*size(numbersMat,2)+1);
%     number=numbersMat(j);
%     subject=subjectsForNumbers{j};
%     fprintf('%s%i',subject,number)
    
    subject='FS';
    number=3;
    
    maxFile=5;
    threshold=10000; %EMG is classified as movement
    EMGChannels={'AbdPolLo','Biceps','Triceps','FrontDelt','MidDelt','BackDelt'};
    noSynergies=3;
    noLFsamples=5;
    pause=false;
    pburgOrder=250;
    windowEMG=0.2;
    windowEEG=1;
    shiftEMG=0.05;
    shiftEEG=0.2;
    minEEGFreq=2;
    maxEEGFreq=49;

    
    savePath=readAll(pathToFile,subject,number,windowEMG,windowEEG,shiftEMG,shiftEEG,maxFile,...
    threshold,pburgOrder,minEEGFreq,maxEEGFreq,pause,noLFsamples,EMGChannels,noSynergies);

    load(savePath)
    clear trainingDataEMG;
    clear trainingDataEEGlf;
    clear classifiactionEMG;
    clear kinematics;
    clear synergies*;
    
    meanRest=squeeze(mean(trainingDataEEG(classificationEEG==0,:,minEEGFreq:maxEEGFreq),1));
    meanMove=squeeze(mean(trainingDataEEG(classificationEEG>0,:,minEEGFreq:maxEEGFreq),1));

    samplingFrequency=1;
    
    %alpha band
    meanRest=mean(meanRest(:,7:13),2);
    meanMove=mean(meanMove(:,7:13),2);
    
    %beta band
    meanRest=mean(meanRest(:,13:20),2);
    meanMove=mean(meanMove(:,13:20),2);
    
    
    topoplot_Wrapper((meanMove./meanRest - 1)',minEEGFreq:maxEEGFreq,eloc_file,stepSize,samplingFrequency)
end