-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathcv_alg.m
64 lines (48 loc) · 1.76 KB
/
cv_alg.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
function [x, SDR] = cv_alg(y1, y2, param, in)
% CV_ALG is the Condat-Vu algorithm solving parallel conversion dequantization
%
% Vojtěch Kovanda
% Brno University of Technology, 2024
lam = param.lam(param.w2 - 3); % setting threshold for clipping
% definition of clip function (result of the Fenchel-Rockafellar conjugate of soft thresholding)
clip = @(x) (sign(x).*min(abs(x), lam));
%% initial values
i = 0; % number of iteration
x = zeros(param.L, 1);
u1 = frana(param.F, y2);
u1 = zeros(size(u1));
u2 = zeros(floor(param.L1/param.k), 1);
u3 = zeros(param.L, 1);
SDR = zeros(param.maxit-1, 1);
%% algorithm
while i < param.maxit
i = i + 1;
waitbar(i/param.maxit);
% getting Lm* um
U1 = frsyn(param.F, u1);
U1 = U1(1:param.L);
U3 = u3;
p = zeros(param.L1,1);
for n = 1:param.k:param.k*length(u2)
p(n) = u2((n+param.k-1)/param.k);
end
U2 = conv(p,param.Bt);
U2 = U2(length(param.Bt):end-length(param.Bt)+1);
x_tild = x - param.tau * (U3+U2+U1);
x = param.rho * x_tild + (1 - param.rho) * x;
bL = 2*x_tild-x;
p1 = u1 + param.sig * frana(param.F, bL);
u1_tild = clip(p1);
u1 = param.rho * u1_tild + (1 - param.rho) * u1;
p3 = u3 + param.sig * bL;
u3_tild = p3 - param.sig * projection(p3/param.sig, y2, param.w2);
u3 = param.rho * u3_tild + (1 - param.rho) * u3;
bL = conv(bL, param.B);
aL = bL(1:param.k:end);
aL = aL(1:floor(param.L1/param.k));
p2 = u2 + param.sig * aL;
u2_tild = p2 - param.sig * projection(p2/param.sig, y1, param.w1);
u2 = param.rho * u2_tild + (1 - param.rho) * u2;
% SDR through iterations
SDR(i) = 20*log10(norm(in,2)./norm(in-x, 2));
end