使用来自Tiep H. Vu - FISTA的 FISTA 压缩感知算法,我创建了下面的 matlab 示例。
我创建了 2 个稀疏信号 x_signed 和 x_pos,后者仅包含正值。
我假设作为FISTAopts.pos = false
的输入,该算法也适用于带符号的输入信号。
可见,FISTA 算法能够完美地重建 x_pos,但不能重建 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');
如何使用 FISTA 算法重建有符号信号?
存在选项“pos”的原因是什么?它对性能有影响吗?