資源簡介
本程序是基于MATLAB平臺的,仿真MUSIC算法,進行AOA估計

代碼片段和文件信息
%?Performance?Analysis?of?NUSIC?DOA?Estimation?Algorithms
d=0.5;
M=5;
%N=11;
D=3;
sig2=0.1;
SNR=20;
th1=-5*pi/180;
th2=10*pi/180;
th3=25*pi/180;
a1=[1];
a2=[1];
a3=[1];
for?i=1:M-1
????a1=[a1?exp(-1j*i*pi*sin(th1))];
????a2=[a2?exp(-1j*i*pi*sin(th2))];
????a3=[a3?exp(-1j*i*pi*sin(th3))];
end
A=[a1.‘?a2.‘?a3.‘];
%b1=[1];
%b2=[1];
%b3=[1];
%for?ii=1:((N-1)/2-1)
?%???b1=[b1?exp(-1j*ii*pi*sin(th1))];
??%??b2=[b2?exp(-1j*ii*pi*sin(th2))];
???%?b3=[b3?exp(-1j*ii*pi*sin(th3))];
%end
%B=[b1.‘?b2.‘?b3.‘];
K=100;?%the?length?of?time?samples
N=10;
s=sign(randn(3K));
s1=sign(randn(3N));
Rss=s*s‘/K;
n=sqrt(sig2)*randn(5K);
Rnn=(n*n‘)/K;?????????%?calculate?the?noise?correlation?matrix?(which?is?no?longer?diagonal)
Rns=(n*s‘)/K;???????????%?calculate?the?noise/signal?correlation?matrix
Rsn=(s*n‘)/K;???????????%??calculate?the?signal/noise?correlation?matrix
Rxx=A*Rss*A‘+A*Rsn+Rns*A‘+Rnn;????????%?combine?all?to?get?the?array?correlation?matrix
Rss1=s1*s1‘/N;
n1=sqrt(sig2)*randn(5N);
Rnn1=(n1*n1‘)/N;
Rns1=(n1*s1‘)/N;
Rsn1=(s1*n1‘)/N;
Ryy=A*Rss1*A‘+A*Rsn1+Rns1*A‘+Rnn1;
[EDia]=eig(Rxx);
[YIndex]=sort(diag(Dia));???%?sorts?the?eigenvalues?from?least?to?greatest
VN=E(:Index(1:M-D));??????%?calculate?the?noise?subspace?matrix?of?eigenvectors
???????????????????????????%?using?the?sorting?done?in?the?previous?line??
?
?[EDia1]=eig(Ryy);
?[Y1Index]=sort(diag(Dia1));
?VN1=E(:Index(1:M-D))
?
?for?k=1:180;
???th(k)=-pi/6+pi*k/(3*180);
???clear?a
???a=[1];
????for?jj=1:M-1
??????a?=?[a?exp(-1j*jj*pi*sin(th(k)))];
????end
???a=a.‘;
???P1(k)=1/abs(a‘*VN*VN‘*a);?
?end
?
?
?for?k=1:180;
???th(k)=-pi/6+pi*k/(3*180);
???clear?a
???a=[1];
????for?jj=1:M-1
??????a?=?[a?exp(-1j*jj*pi*sin(th(k)))];
????end
???a=a.‘;
???P2(k)=1/abs(a‘*VN1*VN1‘*a);?
?end
?
figure;
plot(th*180/pi10*log10(P1/max(P1))‘-b‘)
grid?on
hold?on
plot(th*180/pi10*log10(P2/max(P2))‘-r‘)
grid?on
legend(‘K=100‘‘K=10‘);
xlabel(‘AOA?Degrees‘)
ylabel(‘|P(\theta)|‘)
axis([-30?40?-30?10])??????????????????????????
?屬性????????????大小?????日期????時間???名稱
-----------?---------??----------?-----??----
?????文件???????2103??2018-03-31?15:08??music程序\MUSIC.m
?????目錄??????????0??2018-05-13?21:35??music程序
-----------?---------??----------?-----??----
?????????????????2103????????????????????2
- 上一篇:情感語音識別代碼matlab
- 下一篇:基于MATLAB 的三項橋式全控整流電路仿真
評論
共有 條評論