This commit is contained in:
Ksyer
2023-10-31 11:16:35 +08:00
parent 1855803227
commit 6cd6d8b52f
4 changed files with 56 additions and 0 deletions
+13
View File
@@ -0,0 +1,13 @@
This project is used to host the code that reproduces [this academic paper](https://ieeexplore.ieee.org/document/9497742)
Enviornment:
- [MATLAB 2023a](https://ww2.mathworks.cn/products.html?s_tid=gn_ps)
- [CVX: a Matlab-based convex modeling framework](http://cvxr.com/)
- [Parallel Computing Toolbox](https://ww2.mathworks.cn/products/parallel-computing.html)
Codes:
- `can_recovery.m`: Determine if the signal can be recovered.
- `get_recovery_prob.m`: Obtain the probability that the signal can be recovered under T experiments.
- `main.m`: Main function entry.
+25
View File
@@ -0,0 +1,25 @@
function flg = can_recovery(n, s)
d = 100;
eps = 1e-5;
theta = randn(n, d);
y = theta * x;
x = zeros(d, 1);
random_indices = randperm(d, s);
x(random_indices) = randn(s, 1);
x = sign(x);
cvx_begin
variable s1(d)
minimize(norm(s1, 1))
subject to
norm(y - theta * s1) <= eps
cvx_end
p = norm(x-s1, 2);
if p < eps
flg = 1;
else
flg = 0;
end
end
+7
View File
@@ -0,0 +1,7 @@
function x = get_recovery_prob(n, s, N)
x = 0;
for t = 1: N
x = x + can_recovery(n, s);
end
x = x / N;
end
+11
View File
@@ -0,0 +1,11 @@
N = 100;
M = 100;
T = 50;
prob = zeros(N, M);
parfor n = 1: N
for s = 1: M
prob(n, s) = get_recovery_prob(n, s, T);
end
end
heatmap(prob)