0
$\begingroup$

I want to study the eigenvalues performance when I have two source signals one of the signals have theta=0, while the other one have theta that change from -45 to 45. I implemented the following code:

N_sig=2;
Theta1=[0]/180*pi; %%% first Source angle
Theta2=[-45:1:45]/180*pi; %% second Source angle
DOA=[Theta1 Theta2]/180*pi; %Direction of arrival
P=[0:9]; %% number of antennas
lambda = 1; %% wavelength
d=lambda/2;%Element spacing
snr=10;%SNR
sigma2 = 0.01; % Noise variance
s_var= [10]; %% signal variance
Snap=100; %% number of snapshots

% % generating noise
noise=(1/sqrt(2))*(randn(length(P),Snap)+j*randn(length(P),Snap));
noise_std=10^(-snr/20);
n=noise_std*noise;

% generated signal
F=randn(N_sig,Snap)*pi;
Signal=sqrt(s_var).*exp(j*2*F);

% generate Data matrix
A=zeros(N_sig,length(P)); %To create a matrix with N_sign row and P column
for kk=1:N_sig
A(kk, :)=exp(j*2*pi*d*P'*sin(doa(kk))/lambda); % steering matrix
end
A=A’;

x=A*Signal+n; % received signal

% % Data covariance matrix
R=x*x';
[V, D] = eig(R);
eigs_sorted = sort(diag(D),'descend');
DD=10*log10(eigs_sorted);

   Theta1=[0]/180*pi; %%% first Source angle
Theta2=[-45:1:45]/180*pi; %% second Source angle
DOA=[Theta1 Theta2]/180*pi; %Direction of arrival
P=[0:9]; %% number of antennas
lambda = 1; %% wavelength
d=lambda/2;%Element spacing
snr=10;%SNR
sigma2 = 0.01; % Noise variance
s_var= [10]; %% signal variance
Snap=100; %% number of snapshots

% % generating noise
noise=(1/sqrt(2))*(randn(length(P),Snap)+j*randn(length(P),Snap));
noise_std=10^(-snr/20);
n=noise_std*noise;

% generated signal
F=randn(N_sig,Snap)*pi;
Signal=sqrt(s_var).*exp(j*2*F);

% generate Data matrix
A=zeros(N_sig,length(P)); %To create a matrix with N_sign row and P column
for kk=1:N_sig
A(kk, :)=exp(j*2*pi*d*P'*sin(doa(kk))/lambda); % steering matrix
end
A=A’;

x=A*Signal+n; % received signal

% % Data covariance matrix
R=x*x';
[V, D] = eig(R);
eigs_sorted = sort(diag(D),'descend');
DD=10*log10(eigs_sorted);

I tried several way to get the results as shown in the figure, but It didn't work. Any help I really appreciate it. enter image description here

$\endgroup$
2
  • $\begingroup$ Hi! Sadly, your code is impossible to read. Use the "code formatting" button of the question editor to fix that, please! $\endgroup$
    – mmmm
    Jul 13 at 1:22
  • $\begingroup$ Also, what is "eigenvalue performance"? I've never heard of that, but it seems interesting! Maybe if I could read a definition of it, I could understand what the issue here is. Apropos issue: I think it would be a good idea to ask a precise question (which I think you forgot, but it's hard to tell between the code). $\endgroup$
    – mmmm
    Jul 13 at 1:24

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.