diff --git a/usedMcode/callAll.m b/usedMcode/callAll.m index 47b40b8..f8ba0a5 100644 --- a/usedMcode/callAll.m +++ b/usedMcode/callAll.m @@ -56,7 +56,7 @@ parfor j=1:size(numbersMat,2) number=numbersMat(j); subject=subjectsForNumbers{j}; - savePath=readEEG(pathToFile,subject,number,windowEMG,windowEEG,shift,maxFile,threshold,pburgOrder,minEEGFreq,maxEEGFreq,pause,noLFsamples); + savePath=readAll(pathToFile,subject,number,windowEMG,windowEEG,shift,maxFile,threshold,pburgOrder,minEEGFreq,maxEEGFreq,pause,noLFsamples); [meanAccurancysEMG(j),maxCEMG(j,:),cmScaledEMG(j,:,:)]=svmEciton(savePath,'EMG',k,maxExpC,maxPerClass); [meanAccurancysEEG(j),maxCEEG(j,:),cmScaledEEG(j,:,:)]=svmEciton(savePath,'EEG',k,maxExpC,maxPerClass); [meanAccurancysLF(j),maxCLF(j,:),cmScaledLF(j,:,:)]=svmEciton(savePath,'LF',k,maxExpC,maxPerClass); diff --git a/usedMcode/callAllPos.m b/usedMcode/callAllPos.m index 8277331..2573dea 100644 --- a/usedMcode/callAllPos.m +++ b/usedMcode/callAllPos.m @@ -49,7 +49,7 @@ parfor j=1:size(numbersMat,2) number=numbersMat(j); subject=subjectsForNumbers{j}; - savePath=readEEGPos(pathToFile,subject,number,windowEMG,windowEEG,shift,maxFile,threshold,pburgOrder,minEEGFreq,maxEEGFreq,pause); + savePath=readAllPos(pathToFile,subject,number,windowEMG,windowEEG,shift,maxFile,threshold,pburgOrder,minEEGFreq,maxEEGFreq,pause); % [meanAccurancysEMG(j),maxCEMG(j,:),cmScaledEMG(j,:,:)]=svmEciton(savePath,~EEG,k,maxExpC,maxPerClass); % [meanAccurancysEEG(j),maxCEEG(j,:),cmScaledEEG(j,:,:)]=svmEciton(savePath,EEG,k,maxExpC,maxPerClass); [correlationEMG(j,:),maxRidgeParamIndex(j,:,:)]=ridgeCV(savePath,false,k,ridgeParams); diff --git a/usedMcode/generateTrainingData.m b/usedMcode/generateTrainingData.m index e675727..95c2807 100644 --- a/usedMcode/generateTrainingData.m +++ b/usedMcode/generateTrainingData.m @@ -25,8 +25,8 @@ usedChannels={'AbdPolLo','Biceps','Triceps','FrontDelt','MidDelt','BackDelt'}; emgchannels=find(ismember(params.ChannelNames.Value,usedChannels)); - parfor i=1:6; - tempEMG(i,:)=waveformLength(filtfilt(double(E),double(F),filtfilt(double(C),double(D),filtfilt(double(A),double(B),double(signal(:,emgchannels(i)))))),bci_sf,windowEMG,shift); + parfor i=1:6 + tempEMG(i,:)=waveformLengthAll(filtfilt(double(E),double(F),filtfilt(double(C),double(D),filtfilt(double(A),double(B),double(signal(:,emgchannels(i)))))),bci_sf,windowEMG,shift); end trainingDataEMG=permute(tempEMG,[2 1 3]); diff --git a/usedMcode/readAll.m b/usedMcode/readAll.m index 78f28fe..6f8824b 100644 --- a/usedMcode/readAll.m +++ b/usedMcode/readAll.m @@ -1,4 +1,4 @@ -function [savePath]=readEEG(pathToFile, subject,number,windowEMG,windowEEG,shift,maxFile,threshold,pburgOrder,minEEGFreq,maxEEGFreq,pause,noLFsamples) +function [savePath]=readAll(pathToFile, subject,number,windowEMG,windowEEG,shift,maxFile,threshold,pburgOrder,minEEGFreq,maxEEGFreq,pause,noLFsamples) %fprintf('start read %s%i %s\n',subject,number,datestr(datetime('now'))); savePath=strcat(pathToFile,sprintf('../matlabData/%s%i%imsWindowEMG%isWindowEEG%imsShiftFreq%ito%iPause%ipBurg%i.mat',subject,number,windowEMG*1000,windowEEG,shift*1000,minEEGFreq,maxEEGFreq,pause,pburgOrder)); diff --git a/usedMcode/readAllPos.m b/usedMcode/readAllPos.m index dd6f85b..6ecb160 100644 --- a/usedMcode/readAllPos.m +++ b/usedMcode/readAllPos.m @@ -1,4 +1,4 @@ -function [savePath]=readEEGPos(pathToFile, subject,number,windowEMG,windowEEG,shift,maxFile,threshold,pburgOrder,minEEGFreq,maxEEGFreq,pause) +function [savePath]=readAllPos(pathToFile, subject,number,windowEMG,windowEEG,shift,maxFile,threshold,pburgOrder,minEEGFreq,maxEEGFreq,pause) %fprintf('start read %s%i %s\n',subject,number,datestr(datetime('now'))); savePath=strcat(pathToFile,sprintf('../matlabData/%s%i%imsWindowEMG%isWindowEEG%imsShiftFreq%ito%iPause%ipBurg%iPos.mat',subject,number,windowEMG*1000,windowEEG,shift*1000,minEEGFreq,maxEEGFreq,pause,pburgOrder));