-
Notifications
You must be signed in to change notification settings - Fork 0
/
ista_complex.m
40 lines (32 loc) · 973 Bytes
/
ista_complex.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
function x = ista_complex(A, b, lambda, max_iter)
% Iterative Shrinkage-Thresholding Algorithm (ISTA) for complex numbers
% A: matrix
% b: vector
% lambda: regularization parameter
% max_iter: maximum number of iterations
% Compute the Lipschitz constant of the gradient
L = norm(A, 2)^2;
% Calculate eta
eta = 1/L;
% Initialize the estimate of the solution vector
x = zeros(size(A, 2), 1);
% Iterate until convergence or maximum number of iterations reached
for iter = 1:max_iter
% Compute the gradient
r = b - A*x;
grad = A'*r; % h
% Update the estimate of the solution vector
x_new = x + eta*grad;
x = soft_threshold(x_new, lambda*eta);
% Check for convergence
if norm(x - x_new) < 1e-6
break
end
end
end
function y = soft_threshold(z, T)
% Soft thresholding function for complex numbers
% z: complex number
% T: threshold parameter
y = sign(z) .* max(abs(z) - T, 0);
end