From 4f5877a3fd1fa4ab45fe5b8a8021f76ace2ded0e Mon Sep 17 00:00:00 2001 From: Ksyer Date: Sat, 27 Jan 2024 20:57:17 +0800 Subject: [PATCH] Add Expr3 in Phase Transitions in FAR using CS --- Phase Transitions in FAR using CS/Expr3.m | 6 +++--- Phase Transitions in FAR using CS/Expr3.mat | Bin 201 -> 306 bytes .../Expr3_can_recovery.m | 12 ++++++++---- 3 files changed, 11 insertions(+), 7 deletions(-) diff --git a/Phase Transitions in FAR using CS/Expr3.m b/Phase Transitions in FAR using CS/Expr3.m index 83f6371..0e33d50 100644 --- a/Phase Transitions in FAR using CS/Expr3.m +++ b/Phase Transitions in FAR using CS/Expr3.m @@ -1,4 +1,4 @@ -% Expr2.m to draw Fig 3(a) +% Expr3.m to draw Fig 3(a) clc; clear; @@ -8,7 +8,7 @@ epi = 0.02; % \Delta f / f_c = 0.02 beta = 1; max_n = 125; -max_k = 25; +max_k = 3; trials_time = 5; eps = 1e-5; @@ -33,7 +33,7 @@ end for n = 1:max_n - parfor k = 1:max_k + for k = 1:max_k s = beta * k * M; x = 0; diff --git a/Phase Transitions in FAR using CS/Expr3.mat b/Phase Transitions in FAR using CS/Expr3.mat index b9e7934285e4a3adcc3ba77cb2fce6ac1a89f55b..868ac87b384d584f23359661835bbb2daafa2b52 100644 GIT binary patch delta 216 zcmV;}04M*+0kQ&+GZC?E~M$}x04Dve(5A<9Se zau7TJB@TU<z>% zc%1FWu?>JQ6a&!%0iuZLGe{PqqDw^2?tDc0EO1Y+eq22YI QW0!;^Ns=TDy>f>GH7FG;k^lez diff --git a/Phase Transitions in FAR using CS/Expr3_can_recovery.m b/Phase Transitions in FAR using CS/Expr3_can_recovery.m index 53ee087..b99c0af 100644 --- a/Phase Transitions in FAR using CS/Expr3_can_recovery.m +++ b/Phase Transitions in FAR using CS/Expr3_can_recovery.m @@ -13,13 +13,17 @@ function flg = Expr3_can_recovery(Phi_far, N, M, n, s, eps) y = Phi * sparse_signal(:); cvx_begin quiet - variable x(M * N) complex - minimize(norm(x, 1)) + variable x(M, N) complex + norm21 = 0; + for i = 1:N + norm21 = norm21 + norm(x(:, i)); + end + minimize(norm21) subject to - Phi * x == y + Phi * x(:) == y cvx_end - p = norm(x - sparse_signal(:), 2); + p = norm(x(:) - sparse_signal(:), 2); if p < eps flg = 1;