[go: up one dir, main page]

Menu

[17deec]: / gabor / proj_dual.m  Maximize  Restore  History

Download this file

92 lines (78 with data), 2.2 kB

 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
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
function [ sol ] = proj_dual( x,~, param )
%PROJ_DUAL projection onto the dual windows space
% Usage: sol=proj_proj(x, ~, param)
% [sol, infos]=proj_b2(x, ~, param)
%
% Input parameters:
% x : Input signal.
% param : Structure of optional parameters.
% Output parameters:
% sol : Solution.
% infos : Structure summarizing informations at convergence
%
% `proj_dual(x,~,param)` solves:
%
% .. sol = argmin_{z} ||x - z||_2^2 s.t. A z=y
%
% .. math:: sol = \min_z ||x - z||_2^2 \hspace{1cm} s.t. \hspace{1cm} A z= y
%
% param is a Matlab structure containing the following fields:
%
% * *param.y* : measurements (default: 0).
%
% * *param.A* : Matrix (default: Id).
%
% * *param.AAtinv* : $(A A^*)^(-1)$ Define this parameter to speed up computation.
%
% * *param.verbose* : 0 no log, 1 a summary at convergence, 2 print main
% steps (default: 1)
%
%
% infos is a Matlab structure containing the following fields:
%
% * *infos.algo* : Algorithm used
%
% * *infos.iter* : Number of iteration
%
% * *infos.time* : Time of execution of the function in sec.
%
% * *infos.final_eval* : Final evaluation of the function
%
% * *infos.crit* : Stopping critterion used
%
% * *infos.residue* : Final residue
%
%
% Rem: The input "~" is useless but needed for compatibility issue.
%
% See also: prox_l2 proj_b1
%
% References: fadili2009monotone
%
% Author: Nathanael Perraudin
% Date: Feb 20, 2013
%
% Start the time counter
t1 = tic;
% Optional input arguments
if ~isfield(param, 'y'), param.y = 0; end
if ~isfield(param, 'A'), param.A = eye(length(x)); end
if ~isfield(param, 'AAtinv'), param.AAtinv=pinv(A*At); end
if ~isfield(param, 'verbose'), param.verbose = 1; end
% Projection
sol = x - param.A'*param.AAtinv*(param.A*x-param.y);
crit = 'TOL_EPS'; iter = 0; u = NaN;
% Log after the projection onto the L2-ball
error=norm(param.y-param.A *sol );
if param.verbose >= 1
fprintf([' Proj. dual windows: ||y-Ax||_2 = %e,', ...
' %s, iter = %i\n'],error , crit, iter);
end
% Infos about algorithm
infos.algo=mfilename;
infos.iter=iter;
infos.final_eval=error;
infos.crit=crit;
infos.residue=u;
infos.time=toc(t1);
end