フィルターのクリア

Why does it give wrong answer?

1 回表示 (過去 30 日間)
Sadiq Akbar
Sadiq Akbar 2022 年 12 月 31 日
I took a code from the Mathworks site given below:
N = 10;
d = 0.5;
elementPos = (0:N-1)*d;
angles = [0 -25 30];
Nsig = 3;
R = sensorcov(elementPos,angles,db2pow(-5));
doa = rootmusicdoa(R,Nsig)
It works well. But when I change the 'elementPos' from linear to L-shaped array and change the angles vector to a 2 x M matrix so that to find both the angles (azimuth as well as the elevation), then it gives m the wrong answer. My modified code is as below:
clear al; clc
N = 10;
d = 0.5;
% elementPos = (0:N-1)*d;
elementPos = L1_Array(N-1);
elementPos=elementPos';
% angles = [0 -25 30];
angles = [-30 0 30; 10 20 40];
Nsig = 3;
R = sensorcov(elementPos,angles,db2pow(-5));
doa = rootmusicdoa(R,Nsig)
function r=L1_Array(N)
d = 0.5;%Inter-element spacing
rx = [(N-1)/2*d:-d:d,zeros(1,(N+1)/2)].';
ry = [zeros(1,(N+1)/2),d:d:(N-1)/2*d].';
r = [rx,ry,zeros(N,1)];
end
As can be seen, the azimuth angles are -30 0 and 30 while elevation angles are 10 20 and 40. But when I run this code, it gives me the following wrong answer:
doa =
-41.4097 -22.9068 -73.0831

回答 (0 件)

カテゴリ

Help Center および File ExchangeDirection of Arrival Estimation についてさらに検索

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by