Distributed digital subarray analysis
clc; clear all; close all;
f = 3e8;
Nx = 10; % number of antennas in subarray
Ns1 = 5;% number of sub array
h = 8; % number of virtual array between subarray
c = 3e8;
lambda = c / f;
dx = 0.42*lambda;
beta = 2 * pi / lambda;
theta = [20];
K = length(theta);
L = round(Nx / 3);
Ri = ones(1,K);
A = 1000;
SNR1 =20;
%% sub array
for Ns = 1 : Ns1
for SNR = 1: SNR1
for l = 1 :A
for m = 1: Ns
for p = 1 : Nx
pos = (m-1)*Nx+p;
P_mp(pos) = (p-(Ns*Nx+(Ns-1)*h+1)/2+(m-1)*(Nx+h));
P_mp1(m,p) = (p-(Ns*Nx+(Ns-1)*h+1)/2+(m-1)*(Nx+h));
end
end
% P_mp1 = P_mp1 + 2*(0.5-rand(Ns,Nx))*pos_var_amp;
A_mp = [];
A_mp_a = [];
E_mp_a = [];
for i = 1:Ns
E_mp(:,:,i) = exp(-1j*beta*P_mp1(i,:)’*dx*sind(theta)); % pole 값
A_mp(:,:,i) = Ri.*E_mp(:,:,i); % 측정 값
A_mp = awgn(A_mp, SNR, ‘measured’); % noise 추가
A_mp1 = sum(A_mp,2);
A_mc(:,:,i) = A_mp1(1:Nx – L + 1,:,i);
A_mr(:,:,i) = A_mp1(Nx – L + 1:Nx,:,i);
A_mk(:,:,i) = hankel(A_mc(:,:,i), A_mr(:,:,i)); % Create Hankel matrix with A_c as the first column and A_r as the last row
E_mp_a = [E_mp_a; E_mp(:,:,i)];
A_mp_a = [A_mp_a ;A_mp1(:,:,i)];
end
%% Hankel stack
Y_ss = A_mk(:,:,1);
if Ns> 1
for z = 2:Ns
Y_ss = [Y_ss ; A_mk(:,:,z)];
end
else
Y_ss = A_mk(:,:,1);
end
[U, S, V] = svd(Y_ss);
V0 = V(:, 1:K);
V1 = V0(1:end-1, :);
V2 = V0(2:end, :);
z_k = eig(pinv(V1) * V2);
find_theta_realarray_MPM(l,:)= asind((imag(log(z_k))*lambda)/(2*pi*dx))’;
rmse_real_mpm(l,:) = sort(theta) – sort(find_theta_realarray_MPM(l,:));
end
rmse_real_MPM_sum = sum(sum(abs(rmse_real_mpm).^2,1),2);
rmse_real_MPM_sum = sqrt(rmse_real_MPM_sum/(A*K));
rmse_real_MPM_sum1(SNR,Ns)= rmse_real_MPM_sum(rmse_real_MPM_sum ~= 0);
end
end
plot(1:SNR1 , rmse_real_MPM_sum1,’-d’,’LineWidth’,1.4)
legend(‘1-subarray’,’2-subarray’,’3-subarray’,’4-subarray’,’5-subarray’)
I think the RMSE should be lower as the subarray increases, but why is the RMSE reversed when the SNR is low?
plz help me…..clc; clear all; close all;
f = 3e8;
Nx = 10; % number of antennas in subarray
Ns1 = 5;% number of sub array
h = 8; % number of virtual array between subarray
c = 3e8;
lambda = c / f;
dx = 0.42*lambda;
beta = 2 * pi / lambda;
theta = [20];
K = length(theta);
L = round(Nx / 3);
Ri = ones(1,K);
A = 1000;
SNR1 =20;
%% sub array
for Ns = 1 : Ns1
for SNR = 1: SNR1
for l = 1 :A
for m = 1: Ns
for p = 1 : Nx
pos = (m-1)*Nx+p;
P_mp(pos) = (p-(Ns*Nx+(Ns-1)*h+1)/2+(m-1)*(Nx+h));
P_mp1(m,p) = (p-(Ns*Nx+(Ns-1)*h+1)/2+(m-1)*(Nx+h));
end
end
% P_mp1 = P_mp1 + 2*(0.5-rand(Ns,Nx))*pos_var_amp;
A_mp = [];
A_mp_a = [];
E_mp_a = [];
for i = 1:Ns
E_mp(:,:,i) = exp(-1j*beta*P_mp1(i,:)’*dx*sind(theta)); % pole 값
A_mp(:,:,i) = Ri.*E_mp(:,:,i); % 측정 값
A_mp = awgn(A_mp, SNR, ‘measured’); % noise 추가
A_mp1 = sum(A_mp,2);
A_mc(:,:,i) = A_mp1(1:Nx – L + 1,:,i);
A_mr(:,:,i) = A_mp1(Nx – L + 1:Nx,:,i);
A_mk(:,:,i) = hankel(A_mc(:,:,i), A_mr(:,:,i)); % Create Hankel matrix with A_c as the first column and A_r as the last row
E_mp_a = [E_mp_a; E_mp(:,:,i)];
A_mp_a = [A_mp_a ;A_mp1(:,:,i)];
end
%% Hankel stack
Y_ss = A_mk(:,:,1);
if Ns> 1
for z = 2:Ns
Y_ss = [Y_ss ; A_mk(:,:,z)];
end
else
Y_ss = A_mk(:,:,1);
end
[U, S, V] = svd(Y_ss);
V0 = V(:, 1:K);
V1 = V0(1:end-1, :);
V2 = V0(2:end, :);
z_k = eig(pinv(V1) * V2);
find_theta_realarray_MPM(l,:)= asind((imag(log(z_k))*lambda)/(2*pi*dx))’;
rmse_real_mpm(l,:) = sort(theta) – sort(find_theta_realarray_MPM(l,:));
end
rmse_real_MPM_sum = sum(sum(abs(rmse_real_mpm).^2,1),2);
rmse_real_MPM_sum = sqrt(rmse_real_MPM_sum/(A*K));
rmse_real_MPM_sum1(SNR,Ns)= rmse_real_MPM_sum(rmse_real_MPM_sum ~= 0);
end
end
plot(1:SNR1 , rmse_real_MPM_sum1,’-d’,’LineWidth’,1.4)
legend(‘1-subarray’,’2-subarray’,’3-subarray’,’4-subarray’,’5-subarray’)
I think the RMSE should be lower as the subarray increases, but why is the RMSE reversed when the SNR is low?
plz help me….. clc; clear all; close all;
f = 3e8;
Nx = 10; % number of antennas in subarray
Ns1 = 5;% number of sub array
h = 8; % number of virtual array between subarray
c = 3e8;
lambda = c / f;
dx = 0.42*lambda;
beta = 2 * pi / lambda;
theta = [20];
K = length(theta);
L = round(Nx / 3);
Ri = ones(1,K);
A = 1000;
SNR1 =20;
%% sub array
for Ns = 1 : Ns1
for SNR = 1: SNR1
for l = 1 :A
for m = 1: Ns
for p = 1 : Nx
pos = (m-1)*Nx+p;
P_mp(pos) = (p-(Ns*Nx+(Ns-1)*h+1)/2+(m-1)*(Nx+h));
P_mp1(m,p) = (p-(Ns*Nx+(Ns-1)*h+1)/2+(m-1)*(Nx+h));
end
end
% P_mp1 = P_mp1 + 2*(0.5-rand(Ns,Nx))*pos_var_amp;
A_mp = [];
A_mp_a = [];
E_mp_a = [];
for i = 1:Ns
E_mp(:,:,i) = exp(-1j*beta*P_mp1(i,:)’*dx*sind(theta)); % pole 값
A_mp(:,:,i) = Ri.*E_mp(:,:,i); % 측정 값
A_mp = awgn(A_mp, SNR, ‘measured’); % noise 추가
A_mp1 = sum(A_mp,2);
A_mc(:,:,i) = A_mp1(1:Nx – L + 1,:,i);
A_mr(:,:,i) = A_mp1(Nx – L + 1:Nx,:,i);
A_mk(:,:,i) = hankel(A_mc(:,:,i), A_mr(:,:,i)); % Create Hankel matrix with A_c as the first column and A_r as the last row
E_mp_a = [E_mp_a; E_mp(:,:,i)];
A_mp_a = [A_mp_a ;A_mp1(:,:,i)];
end
%% Hankel stack
Y_ss = A_mk(:,:,1);
if Ns> 1
for z = 2:Ns
Y_ss = [Y_ss ; A_mk(:,:,z)];
end
else
Y_ss = A_mk(:,:,1);
end
[U, S, V] = svd(Y_ss);
V0 = V(:, 1:K);
V1 = V0(1:end-1, :);
V2 = V0(2:end, :);
z_k = eig(pinv(V1) * V2);
find_theta_realarray_MPM(l,:)= asind((imag(log(z_k))*lambda)/(2*pi*dx))’;
rmse_real_mpm(l,:) = sort(theta) – sort(find_theta_realarray_MPM(l,:));
end
rmse_real_MPM_sum = sum(sum(abs(rmse_real_mpm).^2,1),2);
rmse_real_MPM_sum = sqrt(rmse_real_MPM_sum/(A*K));
rmse_real_MPM_sum1(SNR,Ns)= rmse_real_MPM_sum(rmse_real_MPM_sum ~= 0);
end
end
plot(1:SNR1 , rmse_real_MPM_sum1,’-d’,’LineWidth’,1.4)
legend(‘1-subarray’,’2-subarray’,’3-subarray’,’4-subarray’,’5-subarray’)
I think the RMSE should be lower as the subarray increases, but why is the RMSE reversed when the SNR is low?
plz help me….. ddsa, doa, hankel, svd, snr MATLAB Answers — New Questions