% %============================================================================% % % Duke University % % % K. P. Trofatter % % % kpt2@duke.edu % % %============================================================================% % zlsq() - construct an invertible linear system with a solution that solves the % complex least squares problem with L2 regularization for any linear system. % Use a seperate program to solve the resulting system. % % USAGE: % [A_lsq, b_lsq] = zlsq(A, A_adj, b, gamma) % % INPUT: % [1,1] function | A | function for multiplication by [m,n] complex A % [1,1] function | A_adj | function for adjoint (conjugate transpose) of A % [m,1] complex | b | data vector % [1,1] double | gamma | regularization weighting factor % % OUTPUT: % [1,1] function | A_lsq | complex least squares linear operator % [n,1] complex | b_lsq | complex least squares data vector % % NOTES: % the copmlex least squares cost function to be minimized is: % zlsq cost function : f(x) = || b - A x ||^2 + gamma || x ||^2 % the gradient of the cost function is % grad f = -A' [b - A x] - gamma x % therefore the system to solve is % A_lsq x_lsq = b_lsq % A_lsq = A' A + gamma I % b_lsq = A' b function [A_lsq, b_lsq] = zlsq(A, A_adj, b, gamma) % build least squares equation A_lsq = @(x) A_adj(A(x)) + gamma * x; b_lsq = A_adj(b); end %==============================================================================% % % % % % % %==============================================================================%