I am trying to estimate both azimuth and elevation angle, for which I simulated a URA, whose code is given below.
SNR_dB_vec = -20:5:10; % SNR levels
Max_a = 180;
Max_e = 90;
grid_res = 5;
sVar = 1;
p = 100; % Number of time snapshots
fs = 10^7; % Sampling frequency
fc = 10^6; % Center frequency of narrowband sources
Mx = 12; % Number of array elements on x axis
My = 8; % Number of array elements on y axis
cSpeed = 3*10^8 ; % Speed of light
dist = 180; % Sensors (i.e., antennas) spacing in meters in both x and
%y axes
SOURCE_K = 4; % no.of sources*2 (for source 1 col1 and col3 are for
%azimuth and for source 2 col2 and col4 are elevation)
% The training sets
azimuth_grid = -Max_a:grid_res:Max_a;
elevation_grid = -Max_e:grid_res:Max_e;
[Az, El] = meshgrid(azimuth_grid, elevation_grid);
% Number of training samples
num_samples = 2500;
% Initialize doa matrix to store the results
doa = zeros(num_samples, 4);
for i = 1:num_samples
% Randomly pick values for each column
while true
az1 = azimuth_grid(randi(numel(azimuth_grid)));
el1 = elevation_grid(randi(numel(elevation_grid)));
az2 = azimuth_grid(randi(numel(azimuth_grid)));
el2 = elevation_grid(randi(numel(elevation_grid)));
% Check if all values in the row are unique
if numel(unique([az1, el1, az2, el2])) == 4
doa(i, :) = [az1, el1, az2, el2];
break;
end
end
end
G = size(doa,1);
S = length(SNR_dB_vec); % number of the SNR levels
N = 64; %total number of antenna elements
R_ECM = zeros(Mx, Mx,2,G,S); % Expected covariance matrix (ECM)
R_SCM = zeros(Mx, Mx,2,G,S); % Sampled covariance matrix (SCM)
for i=1:S
SNR_dB = SNR_dB_vec(i);
noise_power = 10^(-SNR_dB/10);
r_the = zeros(Mx, Mx,2,G); % Temporary expected covariance variable at a SNR level
r_sam = zeros(Mx, Mx ,2,G); % Temporary Sampled covariance variable at a SNR level
for ii=1:G
SOURCE_angles = doa(ii,:);
Ax = zeros(Mx, SOURCE_K);
Ay = zeros(My - 1, SOURCE_K);
for k = 1:2:SOURCE_K
Ax(:, k) = exp(-1i*2*pi*fc*dist*(1/cSpeed)*(0:Mx-1)' ...
*cosd(SOURCE_angles(k))*sind(SOURCE_angles(k+1)));
Ay(:, k) = exp(-1i*2*pi*fc*dist*(1/cSpeed)*(1:My-1)' ...
*sind(SOURCE_angles(k))*sind(SOURCE_angles(k+1)));
end
A = [Ax; Ay]; % Steering matrix of all sensors
% The Expected covariance matrix for a angle-pair
Ry_the = A*diag(ones(SOURCE_K,1))*A' + noise_power*eye(Mx+My-1);
RMx_the = Ry_the(1:Mx, 1:Mx);
RMy_the = Ry_the(Mx+1:Mx+My-1, Mx+1:Mx+My-1); % Original sensor is omitted
RMy_the = [Ry_the(Mx+1:Mx+My-1, 1), RMy_the];
RMy_the = [[Ry_the(1, 1), Ry_the(1, Mx+1:Mx+My-1)]; RMy_the]; % (My x My)
% The Sampled covariance matrix for a angle-pair
S = sqrt(sVar)*randn(SOURCE_K, p).*exp(1i*(2*pi*fc*repmat((1:p)/fs, SOURCE_K, 1)));
X = A*S;
noiseCoeff = 1;
Eta = sqrt(noiseCoeff)*randn(Mx + My - 1, p);
Y = X + Eta;
Ry_sam = Y*Y'/p;
RMx_sam = Ry_sam(1:Mx, 1:Mx); % covariance matrix of signals received by ULA on X-axis
RMy_sam = Ry_sam(Mx+1:Mx+My-1, Mx+1:Mx+My-1); % Original sensor is omitted
RMy_sam = [Ry_sam(Mx+1:Mx+My-1, 1), RMy_sam];
RMy_sam = [[Ry_sam(1, 1), Ry_sam(1, Mx+1:Mx+My-1)]; RMy_sam]; % (My x My)
% Real and Imaginary part for the ECM
r_the(:,:,1,ii) = real(RMx_the); %%% when I am only trying to estimate the azimuth angles
r_the(:,:,2,ii) = imag(RMx_the);
% Real and Imaginary part for the SCM
r_sam(:,:,1,ii) = real(RMx_sam); %%% when I am only trying to estimate the azimuth angles
r_sam(:,:,2,ii) = imag(RMx_sam);
end
disp(['Processing SNR level:', num2str(i)]);
R_ECM(:,:,:,:,i) = r_the;
R_SCM(:,:,:,:,i) = r_sam;
end
% The angles Ground Truth
angles = doa(:,1:2:4); %%% when I am only trying to estimate the azimuth angles
% Save the DATA
h5create(filename_ECM,'/angles',size(angles));
h5write(filename_ECM, '/angles', angles);
h5create(filename_ECM,'/ECM',size(R_ECM));
h5write(filename_ECM, '/ECM', R_ECM);
h5disp(filename_ECM);
h5create(filename_SCM,'/angles',size(angles));
h5write(filename_SCM, '/angles', angles);
h5create(filename_SCM,'/SCM',size(R_SCM));
h5write(filename_SCM, '/SCM', R_SCM);
h5disp(filename_SCM);
I am using the deep learning model from the paper "Robust DOA Estimation Using Deep ComplexValued Convolutional Networks with Sparse Prior". In the paper they have used a ULA for predicting only one angle.
Firstly I tried to use the same model, and instead of different source angles at different columns, I used the azimuth angle in col1 and elevation in col2 for a single source system.
Similarly if we have 2 sources then col1 and col2 corresponds to the azimuth and elevation for source 1 and col3 and col4 corresponds to the azimuth and elevation for col2.
But this method is not providing accurate estimation, so I was thinking of using 2 separate models, one for estimating azimuth and another for elevation.
But in that case, I am not sure if I can use the expected and sample covariance matrix as inputs, because the covariance matrix is formed by the combination of both azimuth and elevation.
So, can anyone suggest what input features can I use, if I want to train 2 separate models ?