forked from cortex-lab/KiloSort
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathinitialize_waves0.m
69 lines (52 loc) · 1.6 KB
/
initialize_waves0.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
clear W
tps = [1 5 10 25 40 50 61];
vs = [0 0 0 -2 1 0 0];
fs= interp1(tps, vs, 1:nt0, 'linear', 'extrap');
W(:,1,1) = my_conv(fs, 2);
tps = [1 5 10 25 40 50 61];
vs = [0 0 0 -2 1 0 0];
fs= interp1(tps, vs, 1:nt0, 'linear', 'extrap');
W(:,1,2) = my_conv(fs, 2);
tps = [1 5 10 15 25 50 61];
vs = [0 0 0 -2 1 0 0];
fs= interp1(tps, vs, 1:nt0, 'linear', 'extrap');
W(:,1,3) = my_conv(fs, 2);
tps = [1 5 10 20 30 50 61];
vs = [0 0 0 -2 1 0 0];
fs= interp1(tps, vs, 1:nt0, 'linear', 'extrap');
W(:,1,4) = my_conv(fs, 2);
tps = [1 5 10 25 40 50 61];
vs = [0 0 0 -2 0 0 0];
fs= interp1(tps, vs, 1:nt0, 'linear', 'extrap');
W(:,1,5) = my_conv(fs, 2);
tps = [1 5 10 25 40 50 61];
vs = [0 0 0 -2 0 0 0];
fs= interp1(tps, vs, 1:nt0, 'linear', 'extrap');
W(:,1,6) = my_conv(fs, 2);
tps = [1 5 10 15 25 50 61];
vs = [0 0 0 -2 0 0 0];
fs= interp1(tps, vs, 1:nt0, 'linear', 'extrap');
W(:,1,7) = my_conv(fs, 2);
tps = [1 5 10 20 30 50 61];
vs = [0 0 0 -2 0 0 0];
fs= interp1(tps, vs, 1:nt0, 'linear', 'extrap');
W(:,1,8) = my_conv(fs, 2);
W = (single(W));
W = squeeze(W);
W = W(:, repmat([1 2 3 4 1 2 3 4], ceil(Nfilt/8), 1)) + .1 * my_conv(randn(nt0, 8*ceil(Nfilt/8), 'single')', 5)';
U = repmat(eye(Nchan, Nchan), 1, ceil(Nfilt/Nchan));
U = U(:, 1:Nfilt);
U = my_conv(single(U)', 2)';
U = U .* (1 + .05 * randn(size(U)));
U(abs(U)<.01) = 0;
U = single(U);
if 1<0
W = randn(nt0, Nfilt, 'single');
U = randn(Nchan, Nfilt, 'single');
W = single(my_conv(W', 10)');
U = single(my_conv(U', 10)');
W = normc(W);
U = normc(U);
end
Uinit = normc(U);
Winit = normc(W);