Using the FISTA Algorithm for compressive sensing from Tiep H. Vu - FISTA, I created the matlab example below.
I created 2 sparse signals x_signed and x_pos, where the latter only contains positive values.
Using opts.pos = false
as input to the FISTA, I assume, that the algorithm also works for signed input signals.
As visible, the FISTA algorithm is able to perfectly reconstruct x_pos, but not x_signed.
s = rng(5);
close all;
nrbins = 5;
N = 120;
m = 24;
%create input signals
x_pos = [round(10*rand(nrbins,1));zeros(N-nrbins,1)];
x_signed = [10*randn(nrbins,1);zeros(N-nrbins,1)];
%random shuffle
x_signed = x_signed(randperm(size(x_signed,1)));
x_pos = x_pos(randperm(size(x_pos,1)));
%Compressive Measurements on positive signal
A = 0.5*(sign(randn(m,N))+ones(m,N));
y = A*x_pos;
opts.pos = true;
opts.lambda = 0.01;
opts.tol = 1e-14;
opts.max_iter = 1000;
xrec_pos = fista_lasso(y,A,[],opts);
%Compressive Measurements on signed signal
A = 0.5*(sign(randn(m,N))+ones(m,N));
ysigned = A*x_signed;
opts.pos = false;
opts.lambda = 0.01;
opts.tol = 1e-14;
opts.max_iter = 1000;
xrec_signed = fista_lasso(ysigned,A,[],opts);
%plot positive
figure;
scatter(1:size(x_pos,1),x_pos);
hold on;
plot(xrec_pos);
legend('x','xrec\_pos');
%plot signed
figure;
scatter(1:size(x_signed,1),x_signed);
hold on;
plot(xrec_signed);
legend('x','xrec\_signed');
How can I reconstruct a signed signal using the FISTA algorithm?
For what reason does the option "pos" exist? Does it have performance implications?