-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathrest_action_compare.m
More file actions
120 lines (97 loc) · 2.89 KB
/
Copy pathrest_action_compare.m
File metadata and controls
120 lines (97 loc) · 2.89 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
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
fileData1 = importdata('case1.txt');
fileData2 = importdata('case 2.txt');
fileData3 = importdata('case 3.txt');
header1 = fileData1.textdata;
header2 = fileData2.textdata;
header3 = fileData3.textdata;
eegData1 = fileData1.data;
eegData2 = fileData2.data;
eegData3 = fileData3.data;
start1 = 1.5 * fs + 1;
end1 = 5 * fs;
start2 = 5 * fs + 1;
end2 = 9 * fs;
channelC3 = 5;
channelC4 = 6;
signalC3_1_rest = eegData1(start1:end1, channelC3);
signalC3_1_action = eegData1(start2:end2, channelC3);
signalC4_1_rest = eegData1(start1:end1, channelC4);
signalC4_1_action = eegData1(start2:end2, channelC4);
signalC3_2_rest = eegData2(start1:end1, channelC3);
signalC3_2_action = eegData2(start2:end2, channelC3);
signalC4_2_rest = eegData2(start1:end1, channelC4);
signalC4_2_action = eegData2(start2:end2, channelC4);
signalC3_3_rest = eegData3(start1:end1, channelC3);
signalC3_3_action = eegData3(start2:end2, channelC3);
signalC4_3_rest = eegData3(start1:end1, channelC4);
signalC4_3_action = eegData3(start2:end2, channelC4);
time1_C3_rest = (0:length(signalC3_1_rest)-1) / fs;
time1_C3_action = (0:length(signalC3_1_action)-1) / fs;
time2_C3_rest = (0:length(signalC3_2_rest)-1) / fs;
time2_C3_action = (0:length(signalC3_2_action)-1) / fs;
time3_C3_rest = (0:length(signalC3_3_rest)-1) / fs;
time3_C3_action = (0:length(signalC3_3_action)-1) / fs;
time1_C4_rest = (0:length(signalC3_1_rest)-1) / fs;
time1_C4_action = (0:length(signalC3_1_action)-1) / fs;
time2_C4_rest = (0:length(signalC3_2_rest)-1) / fs;
time2_C4_action = (0:length(signalC3_2_action)-1) / fs;
time3_C4_rest = (0:length(signalC3_3_rest)-1) / fs;
time3_C4_action = (0:length(signalC3_3_action)-1) / fs;
figure;
subplot(3, 1, 1);
plot(time1_C3_rest, signalC3_1_rest);
hold on;
plot(time1_C3_action, signalC3_1_action);
hold off;
xlabel('Time (s)');
ylabel('Amplitude');
title('Case 1');
legend('rest', 'action');
subplot(3, 1, 2);
plot(time2_C3_rest, signalC3_2_rest);
hold on;
plot(time2_C3_action, signalC3_2_action);
hold off;
xlabel('Time (s)');
ylabel('Amplitude');
title('Case 2');
legend('rest', 'action');
subplot(3, 1, 3);
plot(time3_C3_rest, signalC3_3_rest);
hold on;
plot(time3_C3_action, signalC3_3_action);
hold off;
xlabel('Time (s)');
ylabel('Amplitude');
title('Case 3');
legend('rest', 'action');
sgtitle('C3 Channel');
figure;
subplot(3, 1, 1);
plot(time1_C4_rest, signalC4_1_rest);
hold on;
plot(time1_C4_action, signalC4_1_action);
hold off;
xlabel('Time (s)');
ylabel('Amplitude');
title('Case 1');
legend('rest', 'action');
subplot(3, 1, 2);
plot(time2_C4_rest, signalC4_2_rest);
hold on;
plot(time2_C4_action, signalC4_2_action);
hold off;
xlabel('Time (s)');
ylabel('Amplitude');
title('Case 2');
legend('rest', 'action');
subplot(3, 1, 3);
plot(time3_C4_rest, signalC4_3_rest);
hold on;
plot(time3_C4_action, signalC4_3_action);
hold off;
xlabel('Time (s)');
ylabel('Amplitude');
title('Case 3');
legend('rest', 'action');
sgtitle('C4 Channel');