-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathupdateSWMmseMatrix.m
30 lines (30 loc) · 1.13 KB
/
updateSWMmseMatrix.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
function [J, D] = updateSWMmseMatrix(K, Q, M, I, N, H, U, W)
J = zeros(K * Q * M, Q * M);
D = zeros(Q * M, K * I);
for k = 1 : K
m = zeros(Q * M, Q * M);
for l = 1 : K
for j = 1 : I
w = W((l - 1) * I + j);
rowOffset = (l - 1) * I * N + (j - 1) * N;
colOffset = (k - 1) * Q * M;
h = H(rowOffset + 1 : rowOffset + N, colOffset + 1 : colOffset + Q * M);
offset = (l - 1) * I * N + (j - 1) * N;
u = U(offset + 1 : offset + N, :);
hu = h' * u;
m = m + w * hu * hu';
end
end
offset = (k - 1) * Q * M;
J(offset + 1 : offset + Q * M, :) = m;
for i = 1 : I
w = W((k - 1) * I + i);
rowOffset = (k - 1) * I * N + (i - 1) * N;
colOffset = (k - 1) * Q * M;
h = H(rowOffset + 1 : rowOffset + N, colOffset + 1 : colOffset + Q * M);
offset = (k - 1) * I * N + (i - 1) * N;
u = U(offset + 1 : offset + N, :);
D(:, (k - 1) * I + i) = w * h' * u;
end
end
return