forked from grinsted/wavelet-coherence
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Mod_Global_Sig.m
47 lines (34 loc) · 970 Bytes
/
Mod_Global_Sig.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
function signif = Mod_Global_Sig(power)
% The average power of every scale
powerAvg = 0;
% The 95% significant level of every scale
signi = zeros (size (power, 1),1);
powers = zeros (size(power));
zeroValues = 0;
Values = 0;
% Loop over the scales
for s = 1 : size (power, 1)
% Calculate the average power of every scale
powerAvg = (sum(power(s, :))/size (power, 2));
for t=1:size (power, 2)
if power(s,t)> powerAvg
powers(s, t) = power(s, t);
Values = Values + 1;
else
powers(s, t) = 0;
zeroValues = zeroValues +1;
end
end
signifi= round(Values * 0.8);
powers (s, :) = sort (powers(s,:));
for tt=1:size (power, 2)
if(powers(s,tt)~=0)
signi(s) = powers(s, tt + signifi);
break;
end
end
% signi (s) = powers(s, end - signifi);
Values = 0;
zeroValues = 0;
end
signif = signi;