forked from jessicanada/GLM-CFC
-
Notifications
You must be signed in to change notification settings - Fork 8
/
ExampleCode.m
executable file
·90 lines (79 loc) · 3.46 KB
/
ExampleCode.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
% Note: the following simulations use a GLM-based method to simulate V_low
% and V_high, and the p-values are the empirical bootstrapped p-values from the
% manuscript
%% Signal with neither PAC nor AAC
[XX] = simfun(0,0,'pink','none','none','none',.05);
d = 5;
XX.ampAXIS = XX.ampAXIS(1:d:end);
XX.phi0 = XX.phi0(1:d:end);
XX.PAC = XX.Phi_low(1:d:end,1:d:end); XX.AAC = XX.A_low(1:d:end,1:d:end); XX.CFC = XX.Phi_low_A_low(1:d:end,1:d:end);
surf(XX.ampAXIS,XX.phi0,XX.PAC,'FaceAlpha',.8,'FaceColor',[35, 106, 185]/255);
hold on;
surf(XX.ampAXIS,XX.phi0,XX.AAC,'FaceAlpha',.8,'FaceColor',[214, 26, 70]/255);
surf(XX.ampAXIS,XX.phi0,XX.CFC,'FaceAlpha',.9,'FaceColor',[253, 220, 34]/255);
xlim([min(XX.ampAXIS),max(XX.ampAXIS)]); ylim([min(XX.phi0),max(XX.phi0)])
xlabel('A_{low}'); ylabel('\Phi_{low}'); zlabel('A_{high}')
legend('\phi_{low}','A_{low}','\phi_{low},A_{low}')
set(gca,'FontSize',13)
set(gca,'YTick',-pi:pi:pi)
set(gca,'YTickLabel',{'-\pi','0','\pi'})
set(gca,'Ydir','reverse')
grid off
zlim([.002,.02])
%% Signal with PAC
[XX] = simfun(1,0,'pink','none','none','none',.05);
d = 5;
XX.ampAXIS = XX.ampAXIS(1:d:end);
XX.phi0 = XX.phi0(1:d:end);
XX.PAC = XX.Phi_low(1:d:end,1:d:end); XX.AAC = XX.A_low(1:d:end,1:d:end); XX.CFC = XX.Phi_low_A_low(1:d:end,1:d:end);
surf(XX.ampAXIS,XX.phi0,XX.PAC,'FaceAlpha',.8,'FaceColor',[35, 106, 185]/255);
hold on;
surf(XX.ampAXIS,XX.phi0,XX.AAC,'FaceAlpha',.8,'FaceColor',[214, 26, 70]/255);
surf(XX.ampAXIS,XX.phi0,XX.CFC,'FaceAlpha',.9,'FaceColor',[253, 220, 34]/255);
xlim([min(XX.ampAXIS),max(XX.ampAXIS)]); ylim([min(XX.phi0),max(XX.phi0)])
xlabel('A_{low}'); ylabel('\Phi_{low}'); zlabel('A_{high}')
legend('\phi_{low}','A_{low}','\phi_{low},A_{low}')
set(gca,'FontSize',13)
set(gca,'YTick',-pi:pi:pi)
set(gca,'YTickLabel',{'-\pi','0','\pi'})
set(gca,'Ydir','reverse')
grid off
zlim([.002,.01])
%% Signal with AAC
[XX] = simfun(0,1,'pink','none','none','none',.05);
d = 5;
XX.ampAXIS = XX.ampAXIS(1:d:end);
XX.phi0 = XX.phi0(1:d:end);
XX.PAC = XX.Phi_low(1:d:end,1:d:end); XX.AAC = XX.A_low(1:d:end,1:d:end); XX.CFC = XX.Phi_low_A_low(1:d:end,1:d:end);
surf(XX.ampAXIS,XX.phi0,XX.PAC,'FaceAlpha',.8,'FaceColor',[35, 106, 185]/255);
hold on;
surf(XX.ampAXIS,XX.phi0,XX.AAC,'FaceAlpha',.8,'FaceColor',[214, 26, 70]/255);
surf(XX.ampAXIS,XX.phi0,XX.CFC,'FaceAlpha',.9,'FaceColor',[253, 220, 34]/255);
xlim([min(XX.ampAXIS),max(XX.ampAXIS)]); ylim([min(XX.phi0),max(XX.phi0)])
xlabel('A_{low}'); ylabel('\Phi_{low}'); zlabel('A_{high}')
legend('\phi_{low}','A_{low}','\phi_{low},A_{low}')
set(gca,'FontSize',13)
set(gca,'YTick',-pi:pi:pi)
set(gca,'YTickLabel',{'-\pi','0','\pi'})
set(gca,'Ydir','reverse')
grid off
zlim([.002,.01])
%% Signal with PAC and AAC
[XX] = simfun(1,1,'pink','none','none','none',.05);
d = 5;
XX.ampAXIS = XX.ampAXIS(1:d:end);
XX.phi0 = XX.phi0(1:d:end);
XX.PAC = XX.Phi_low(1:d:end,1:d:end); XX.AAC = XX.A_low(1:d:end,1:d:end); XX.CFC = XX.Phi_low_A_low(1:d:end,1:d:end);
surf(XX.ampAXIS,XX.phi0,XX.PAC,'FaceAlpha',.8,'FaceColor',[35, 106, 185]/255);
hold on;
surf(XX.ampAXIS,XX.phi0,XX.AAC,'FaceAlpha',.8,'FaceColor',[214, 26, 70]/255);
surf(XX.ampAXIS,XX.phi0,XX.CFC,'FaceAlpha',.9,'FaceColor',[253, 220, 34]/255);
xlim([min(XX.ampAXIS),max(XX.ampAXIS)]); ylim([min(XX.phi0),max(XX.phi0)])
xlabel('A_{low}'); ylabel('\Phi_{low}'); zlabel('A_{high}')
legend('\phi_{low}','A_{low}','\phi_{low},A_{low}')
set(gca,'FontSize',13)
set(gca,'YTick',-pi:pi:pi)
set(gca,'YTickLabel',{'-\pi','0','\pi'})
set(gca,'Ydir','reverse')
grid off
zlim([.002,.013])