-
Notifications
You must be signed in to change notification settings - Fork 0
/
moving_window_off_comp_matrix.m
66 lines (51 loc) · 1.56 KB
/
moving_window_off_comp_matrix.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
bin_size = 25;
step_size = 10;
m1 = tone_scale_tone_response;
m2 = tone_scale_hc_response;
% normalised rate
norm_windows_start = 1:step_size:700-bin_size;
m1_norm = cell(11, 1);
for re=1:11
current_rate = m1{1,re}(:, 301:1000);
norm_rate = zeros(size(current_rate,1), length(norm_windows_start));
% bin
for u=1:size(current_rate,1)
for n=1:length(norm_windows_start)
t_start = norm_windows_start(n);
t_end = t_start + bin_size - 1;
norm_rate(u,n) = mean(current_rate(u,t_start:t_end));
end % end of n
end % end of u
% divide by max to norm
for u=1:size(norm_rate,1)
norm_rate(u,:) = norm_rate(u,:)./max( norm_rate(u,:) );
end % t
m1_norm{re,1} = norm_rate;
end %re
m2_norm = cell(11, 1);
for re=1:11
current_rate = m2{1,re}(:, 301:1000);
norm_rate = zeros(size(current_rate,1), length(norm_windows_start));
% bin
for u=1:size(current_rate,1)
for n=length(norm_windows_start)
t_start = norm_windows_start(n) ;
t_end = t_start + bin_size - 1;
norm_rate(u,n) = mean(current_rate(u,t_start:t_end));
end % end of n
end % end of u
% divide by max to norm
for u=1:size(norm_rate,1)
norm_rate(u,:) = norm_rate(u,:)./max( norm_rate(u,:) );
end % t
m2_norm{re,1} = norm_rate;
end %re
% h matrix
h_matrix = zeros(11, length(26:68));
for re=1:11
r1 = m1_norm{re,1};
r2 = m2_norm{re,1};
for t=26:68
h_matrix(re, t-25) = ttest2(r1(:, t), r2(:, t));
end
end