-
Notifications
You must be signed in to change notification settings - Fork 2
/
PDC_kram.m
129 lines (112 loc) · 2.24 KB
/
PDC_kram.m
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
121
122
123
124
125
126
127
128
129
%%
files = ffind('mPDC*.mat');
%%
% remove tu sup and tics
files(7:8) = [];
%%
clear gc cg scg sgc
for a = 1:length(files);
load(files{a},'mPDC');
cg(a,:) = mPDC.CMPf_GPi.mpdc;
scg(a,:) = mPDC.CMPf_GPi.mse;
gc(a,:) = mPDC.GPi_CMPf.mpdc;
sgc(a,:) = mPDC.GPi_CMPf.mse;
end
%%
f = mPDC.f;
mgc = mean(gc,1);
msgc = mean(sgc,1);
mcg = mean(cg,1);
mscg = mean(scg,1);
%%
figure;
myline(f,mgc);
myfont(gca);
hold on;
myline(f,mcg,'color',[0.5 0.5 0.5]);
l=legend('GPi to CMPf','CMPf to GPi');
set(l,'EdgeColor','w')
xlabel('Frequency [Hz]');
ylabel('Partial directed coherence');
xlim([2 40]);
ylim([0 0.2])
%%
p = pairPermTest(5000,gc,cg);
plot(p)
%% tu files
clear
tufiles = ffind('*tu*.mat');
%% rest
load(tufiles{1});
cg = mPDC.CMPf_GPi.pdc;
scg = mPDC.CMPf_GPi.se;
gc = mPDC.GPi_CMPf.pdc;
sgc = mPDC.GPi_CMPf.se;
mcg = mPDC.CMPf_GPi.mpdc;
mgc = mPDC.GPi_CMPf.mpdc;
smcg = mPDC.CMPf_GPi.mse;
smgc = mPDC.GPi_CMPf.mse;
f = mPDC.f;
%
figure;
%%
% subplot(1,3,1);
% myline(f,mgc);
% myfont(gca);
% set(gca,'FontSize',16,'FontAngle','italic');
% hold on;
% myline(f,mcg,'color',[0.5 0.5 0.5]);
% l=legend('GPi to CMPf','CMPf to GPi');
% set(l,'EdgeColor','w')
% ylabel('PDC');
% xlim([2 40]);
% ylim([0 0.2])
% title('rest')
% hold off;
%% Tics
load(tufiles{3});
cg = mPDC.CMPf_GPi.pdc;
scg = mPDC.CMPf_GPi.se;
gc = mPDC.GPi_CMPf.pdc;
sgc = mPDC.GPi_CMPf.se;
mcg = mPDC.CMPf_GPi.mpdc;
mgc = mPDC.GPi_CMPf.mpdc;
smcg = mPDC.CMPf_GPi.mse;
smgc = mPDC.GPi_CMPf.mse;
subplot(1,2,1);
myline(f,mgc);
myfont(gca);
set(gca,'FontSize',16,'FontAngle','italic');
hold on;
myline(f,mcg,'color',[0.5 0.5 0.5]);
l=legend('GPi to CMPf','CMPf to GPi');
set(l,'EdgeColor','w')
ylabel('PDC');
xlim([2 40]);
ylim([0 0.2])
title('tics')
hold off;
%% suppression
load(tufiles{2});
cg = mPDC.CMPf_GPi.pdc;
scg = mPDC.CMPf_GPi.se;
gc = mPDC.GPi_CMPf.pdc;
sgc = mPDC.GPi_CMPf.se;
mcg = mPDC.CMPf_GPi.mpdc;
mgc = mPDC.GPi_CMPf.mpdc;
smcg = mPDC.CMPf_GPi.mse;
smgc = mPDC.GPi_CMPf.mse;
subplot(1,2,2);
myline(f,mgc);
myfont(gca);
set(gca,'FontSize',16,'FontAngle','italic');
hold on;
myline(f,mcg,'color',[0.5 0.5 0.5]);
l=legend('GPi to CMPf','CMPf to GPi');
set(l,'EdgeColor','w')
ylabel('PDC');
xlim([2 40]);
ylim([0 0.2])
title('tic suppression')
xlabel('Frequency [Hz]');
hold off;