From a2cb6d18259b479c87eeac78959a3e1bfdefb95f Mon Sep 17 00:00:00 2001 From: Ksyer <> Date: Mon, 11 Nov 2024 16:32:33 +0800 Subject: [PATCH] Delete useless code --- Macroscopic Analysis of VAMP in a MMS/cVAMP.m | 77 ------------------- Macroscopic Analysis of VAMP in a MMS/demo1.m | 46 ----------- Random PRI/Main.m | 41 ---------- Random PRI/narrow_signal_model.m | 25 ------ Random PRI/parameters.m | 59 -------------- .../test.m | 17 ---- 6 files changed, 265 deletions(-) delete mode 100644 Macroscopic Analysis of VAMP in a MMS/cVAMP.m delete mode 100644 Macroscopic Analysis of VAMP in a MMS/demo1.m delete mode 100644 Random PRI/Main.m delete mode 100644 Random PRI/narrow_signal_model.m delete mode 100644 Random PRI/parameters.m delete mode 100644 Randomized Stepped FR Exploiting BS of ET/test.m diff --git a/Macroscopic Analysis of VAMP in a MMS/cVAMP.m b/Macroscopic Analysis of VAMP in a MMS/cVAMP.m deleted file mode 100644 index 89a1d64..0000000 --- a/Macroscopic Analysis of VAMP in a MMS/cVAMP.m +++ /dev/null @@ -1,77 +0,0 @@ -% Input:y,A,lambda,tau,Kit -% Output:x_hat_wl,x_hat_d - -function [x_hat_wl, x_hat_d] = cVAMP(y, A, lambda, tau, Kit) - % Initialization - gamma = 768 ./ 1024; - k = 0; - p = ctranspose(A) * y; - h_1 = p; - Q_1 = gamma; - tau_d = 1; - - % while - while (k < Kit) && (tau_d > tau) - % Factorized Part - x_1 = ST(h_1, lambda, Q_1); % \hat{x}_1^{(k)} - chi_1 = F1(x_1, lambda, Q_1); % \chi_1^{(k)} - % Message Passing - h_2 = x_1 ./ chi_1 - h_1; % h_2^{(k)} - Q_2 = 1 ./ chi_1 - Q_1; % \hat{Q}_2^{(k)} - % Gaussian Part - t1 = (p + h_2) ./ Q_2; - t2 = ctranspose(A) * (A * (p + h_2)) / ((Q_2 + 1) * Q_2); - x_2 = t1 + t2; % \hat{x}_2^{(k)} - chi_2 = gamma ./ (Q_2 + 1) + (1 - gamma) ./ Q_2; - % Message Passing - h_1_next = x_2 ./ chi_2 - h_2; - Q_1_next = 1 ./ chi_2 - Q_2; - tau_d = norm(h_1_next - h_1) ./ norm(h_1_next); - k = k + 1; - % output - x_hat_wl = x_1; - x_hat_d = h_1_next ./ Q_1_next; - % next - h_1 = h_1_next; - Q_1 = Q_1_next; - end - -end - -% SoftThreshold function -function x = ST(h_1, lambda, Q_1) - [N, M] = size(h_1); - x = zeros(N, M); - - for i = 1:N - % sign = h_1(i) ./ abs(h_1(i)); - diff = abs(h_1(i)) - lambda(i); - x(i) = sign(h_1(i)) .* (diff ./ Q_1) .* SF(diff); - end - -end - -% Heaviside's step function -function v = SF(a) - % if a > 0 - % v = 1; - % elseif a == 0 - % v = 0; % at zero points - % else - % v = 0; - % end - v = heaviside(a); -end - -% SoftThreshold function -function v = F1(x_1, lambda, Q_1) - [N, M] = size(x_1); - count = 0; - - for i = 1:N - temp = Q_1 .* abs(x_1(i)) + lambda(i); - count = count + (2 - lambda(i) ./ temp) .* SF(abs(x_1(i))); - end - - v = count ./ (2 .* N .* Q_1); -end diff --git a/Macroscopic Analysis of VAMP in a MMS/demo1.m b/Macroscopic Analysis of VAMP in a MMS/demo1.m deleted file mode 100644 index b4d8656..0000000 --- a/Macroscopic Analysis of VAMP in a MMS/demo1.m +++ /dev/null @@ -1,46 +0,0 @@ -% Input:y,A,lambda,tau,Kit -% Output:x_hat_wl,x_hat_d -clear; -clc; -% rng(1); % 随机种子 - -%% test_稀疏向量 -% 设定稀疏度 -k = 100; % 设定稀疏度 - -% 构造感知矩阵D -m = 768; % 感知矩阵行数 -n = 1024; % 感知矩阵列数 (n>>m) - -% D = randn(m,n); % 生成满足高斯分布的感知矩阵 64*256 - -F = dftmtx(n); -row_indices = randperm(n, m); -D = F(row_indices, :); - -% 构造稀疏信号X——共n个元素,其中k个元素不为0 -X = zeros(n, 1); -index = randperm(n, k); -val = randn(1, k); -X(index) = val; - -% 得到观测矩阵(压缩后) -A = D * X; - -%% -% % 通过cVMAP算法完成恢复X,得到恢复后信号 -lambda = ones(n, 1) ./ 10; -[x_hat_wl, x_hat_d] = cVAMP(A, D, lambda, 1e-4, 200); - -%% -% 显示结果 -figure; -subplot(3, 1, 1) -stem(X); -title('origin signal') -subplot(3, 1, 2) -stem(x_hat_wl); -title('restored signal') -subplot(3, 1, 3) -stem(X - x_hat_wl); -title('differ') diff --git a/Random PRI/Main.m b/Random PRI/Main.m deleted file mode 100644 index 7280702..0000000 --- a/Random PRI/Main.m +++ /dev/null @@ -1,41 +0,0 @@ -clc; clear; close all; - -parameters; - -global trail_times; - -[s_T_narrow, A] = narrow_signal_model(t, 1); - -A = A / 10; - -AH = A'; - -H0 = []; -for T = 1: trail_times - x = zeros(10, 1); - % x(4) = 0.8; - y = A * x; - y_noise = awgn(y, 15); - - x_hat = AH * y_noise; - - H0 = [H0 x_hat']; -end - -H1 = []; -for T = 1: trail_times - x = zeros(10, 1); - x(4) = 0.8; - y = A * x; - y_noise = awgn(y, 15); - - x_hat = AH * y_noise; - - H1 = [H1 x_hat(4)]; -end - -% figure; histfit(real(H0)); -% figure; histfit(real(H1)); - -figure; -plot() diff --git a/Random PRI/narrow_signal_model.m b/Random PRI/narrow_signal_model.m deleted file mode 100644 index 4169139..0000000 --- a/Random PRI/narrow_signal_model.m +++ /dev/null @@ -1,25 +0,0 @@ -function [s_T_narrow, A_narrow] = narrow_signal_model(t, betas_narrow) - global f_c N_narrow N FIGURE N_wide numP f_s K_chirp T_r; - - tt = 0: 1/f_s: numP * T_r - 1/f_s; - - % 浣跨敤绛夋晥鏁e皠绯绘暟鐢熸垚绐勫甫鎯呭喌淇″彿妯″瀷 - s_T_narrow = zeros(1, N * numP); - for j = 1: numP - idx = ((j-1) * N + (1:N_narrow)); - tp = idx / f_s; - s_T_narrow(1, idx) = exp(1j * 2 * pi * (f_c * tp + 0.5 * K_chirp * tp .^ 2)); - end - - % s_T_narrow = exp(1j .* 2 .* pi .* f_c .* t); - s_R_narrows = zeros(N_narrow, N * numP); - for i = 1: N_narrow - p = i * (N_wide / N_narrow); - s_R_narrows(i, :) = betas_narrow * [zeros(1, p), s_T_narrow(1: end-p)]; - end - - A_narrow = s_R_narrows'; - if FIGURE - subplot(2, 1, 1); plot(tt, real(s_T_narrow)); - subplot(2, 1, 2); plot(tt, real(s_R_narrows(1, :))); - end \ No newline at end of file diff --git a/Random PRI/parameters.m b/Random PRI/parameters.m deleted file mode 100644 index 0f1d817..0000000 --- a/Random PRI/parameters.m +++ /dev/null @@ -1,59 +0,0 @@ -global bandwidth T_p f_s T_s K_chirp f_c PRF T_r numP t tP c N M R_0... - delta_R_wide delta_R_narrow N_wide N_narrow ranges_wide... - ranges_narrow betas_wide FIGURE K_wide K_narrow trail_times... - method N_high TEST lambda tau iter_max noise_sigma FAR_N FAR_M noise_sigma_2 DEBUG_LEVEL... -; - -f_c = 10e9; % X wave -bandwidth = 100e6; -T_p = 1e-5; -f_s = 2 * bandwidth; -T_s = 1 / f_s; -K_chirp = bandwidth / T_p; -T_r = T_p * 10; -PRF = 1 / T_r; - -numP = 10; - -t = 0: 1 / f_s: T_r - 1 / f_s; -tP = 0: 1 / f_s: T_r * numP - 1 / f_s; - -c = 3e8; % 鍏夐�� - -N = length(t); -N_high = T_p * f_s; -M = round(T_p * bandwidth); -R_0 = 0; -delta_R_wide = c ./ 2 ./ bandwidth; -delta_R_narrow = T_p .* c ./ 2; -N_wide = 100; -N_narrow = round(N_wide / M); - -% alert(N > N_narrow); - -ranges_wide = R_0 + (0:N_wide) * delta_R_wide; % [1000, 4000] -ranges_narrow = R_0 + (0:N_narrow) * delta_R_narrow; % [1000, 4000] -betas_wide = linspace(1, 0.1, N_wide) + 1j * linspace(0.1, 1, N_wide); - -K_wide = round(N_wide / 10); -K_narrow = round(K_wide / 10); - -FIGURE = false; -trail_times = 5000; -% method = "debiased_LASSO"; -% method = "LASSO"; -% method = "BP"; -method = "cVAMPro"; -TEST = false; - -lambda = 0.01; -tau = 1e-6; -iter_max = 1000; - -noise_sigma = 0.1; -noise_sigma_2 = 0.1; - -FAR_N = 480; -FAR_M = 10; - -DEBUG_LEVEL = 1; diff --git a/Randomized Stepped FR Exploiting BS of ET/test.m b/Randomized Stepped FR Exploiting BS of ET/test.m deleted file mode 100644 index 6c541c1..0000000 --- a/Randomized Stepped FR Exploiting BS of ET/test.m +++ /dev/null @@ -1,17 +0,0 @@ -N = 32e9; -M = 3; -eps = 1e-4; - -delta_1 = 24 * sqrt((M-1)/N) * log(M*N) * (2*sqrt(log(M * N) - log(eps)) + 1); -delta_2 = 3/2 * sqrt((M-1)/N) * (2*sqrt(log(M * 2) - log(eps)) + 1); - -K = N * (1/8 - delta_1 - delta_2)^2 / (81 * M * log(M * N) * (1 + 2/3 * delta_2)); - -x = 0:25; -Ns = N * (1+randn(size(x))); -delta_1 = 24 * sqrt((M-1)./N) * log(M.*N) * (2*sqrt(log(M .* N) - log(eps)) + 1); -delta_2 = 3/2 * sqrt((M-1)./N) * (2*sqrt(log(M * 2) - log(eps)) + 1); -Ks = Ns * (1/8 - delta_1 - delta_2)^2 / (81 * M * log(M .* Ns) * (1 + 2/3 * delta_2)); - -rate = K .* M .* log(M .* Ns) ./ Ns; -plot(x, rate)