-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathEMG_comparing_thresholds_git.m
More file actions
28 lines (26 loc) · 1.12 KB
/
EMG_comparing_thresholds_git.m
File metadata and controls
28 lines (26 loc) · 1.12 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
function [idealthreshEMG,idealKEMG] = EMG_comparing_thresholds_git(thresholdEMG,threshold_outputEMG,EMGave,manual_output)
decreased = thresholdEMG-.001;
threshold_trialsTD = thresholdEMG-decreased;
bottom = threshold_trialsTD;
idealthreshEMG = [];
idealKEMG = [];
for q = 0.001:0.001:(decreased*2)
threshold_trialsTD = bottom+q;
threshold_output_trials = zeros(size(threshold_outputEMG,1),1);
for z = 1:size(EMGave,1)
if EMGave(z,1) < threshold_trialsTD
threshold_output_trials(z,1) = 1;
else
threshold_output_trials(z,1) = 0;
end
end
[verification_ratioTD, KTD] = state_verification(manual_output,threshold_output_trials);
idealthreshEMG = [idealthreshEMG;verification_ratioTD];
idealKEMG = [idealKEMG;KTD];
end
figure; plot([bottom+0.001:0.001:bottom+(decreased*2)],idealthreshEMG);
line([thresholdEMG thresholdEMG],get(gca,'Ylim'),'Color','red');
title('EMG agreement over varied threshold values');
figure; plot([bottom+0.001:0.001:bottom+(decreased*2)],idealKEMG);
line([thresholdEMG thresholdEMG],get(gca,'Ylim'),'Color','red');
title('EMG Cohens K over varied threshold values');