tc = franalasso(F,f,lambda) tc = franalasso(F,f,lambda,C,tol,maxit) [tc,relres,iter,frec,cd] = franalasso(...)
F | Frame definition |
f | Input signal |
lambda | Regularisation parameter, controls sparsity of the solution |
C | Step size of the algorithm. |
tol | Reative error tolerance. |
maxit | Maximum number of iterations. |
tc | Thresholded coefficients |
relres | Vector of residuals. |
iter | Number of iterations done. |
frec | Reconstructed signal |
cd | The min ||c||_2 solution using the canonical dual frame. |
franalasso(F,f,lambda) solves the LASSO (or basis pursuit denoising) regression problem for a general frame: minimize a functional of the synthesis coefficients defined as the sum of half the \(l^2\) norm of the approximation error and the \(l^1\) norm of the coefficient sequence, with a penalization coefficient lambda such that
The solution is obtained via an iterative procedure, called Landweber iteration, involving iterative soft thresholdings.
The following flags determining an algorithm to be used are recognized at the end of the argument list:
The basic (Iterative Soft Thresholding) algorithm given F and f and parameters C\(>0\), lambda \(>0\) acts as follows:
Initialize c repeat until stopping criterion is met c <- soft(c + F*(f - Fc)/C,lambda/C) end
The fast version of the previous. This is the default option.
Initialize c(0),z,tau(0)=1,n=1 repeat until stopping criterion is met c(n) <- soft(z + F*(f - Fz)/C,lambda/C) tau(n) <- (1+sqrt(1+4*tau(n-1)^2))/2 z <- c(n) + (c(n)-c(n-1))(tau(n-1)-1)/tau(n) n <- n + 1 end
[tc,relres,iter] = franalasso(...) returns the residuals relres in a vector and the number of iteration steps done iter.
[tc,relres,iter,frec,cd] = franalasso(...) returns the reconstructed signal from the coefficients, frec and coefficients cd obtained by analysing using the canonical dual system. Note that this requires additional computations.
The relationship between the output coefficients and frec is given by
frec = frsyn(F,tc);
The function takes the following optional parameters at the end of the line of input arguments:
The parameters C, itermax and tol may also be specified on the command line in that order: franalasso(F,x,lambda,C,tol,maxit).
Note: If you do not specify C, it will be obtained as the upper framebound. Depending on the structure of the frame, this can be an expensive operation.
The following example shows how franalasso produces a sparse representation of a test signal greasy:
f = greasy; % Gabor frame with redundancy 8 F = frame('dgtreal','gauss',64,512); % Choosing lambda (weight of the sparse regularization param.) lambda = 0.1; % Solve the basis pursuit problem [c1,~,~,frec1,cd] = franalasso(F,f,lambda); % Solve again with debiasing enabled [c2,~,~,frec2,cd] = franalasso(F,f,lambda,'debias'); % Plot sparse coefficients figure(1); plotframe(F,c1,'dynrange',50); % Plot debiased coefficients figure(2); plotframe(F,c2,'dynrange',50); % Plot coefficients obtained by applying an analysis operator of a % dual Gabor system to f figure(3); plotframe(F,cd,'dynrange',50); % Normalized MSE of the approximation % frec is obtained by applying the synthesis operator of frame F % to sparse coefficients c. fprintf('Normalized MSE: %.2f dB\n',20*log10(norm(f-frec1)/norm(f))); fprintf('Normalized MSE (with debiasing): %.2f dB\n',20*log10(norm(f-frec2)/norm(f))); % Compare decay of coefficients sorted by absolute values % (compressibility of coefficients) figure(3); semilogx([sort(abs(c1),'descend')/max(abs(c1)),... sort(abs(c2),'descend')/max(abs(c2)),... sort(abs(cd),'descend')/max(abs(cd))]); legend({'sparsified coefficients','with debiasing','dual system coefficients'});