?? mmse.m
字號:
function [ ]=MMSE(M,d,angle1,angle2,angle3)
sig=0.001;
theta=-pi/2:.01:pi/2;
ang=theta*180/pi;
th0=angle1*pi/180;
th1=angle2*pi/180;
th2=angle3*pi/180;
n=1:M;
disp(('The Distorted angle for the source is:'));
% calculating the steering vectors associated with %
% each source direction %
a0=exp(1j*2*pi*d*(n-1)*sin(th0)).';
a1=exp(1j*2*pi*d*(n-1)*sin(th1)).';
a2=exp(1j*2*pi*d*(n-1)*sin(th2)).';
A=[a1 a2];
Rss=a0*a0';
Rnn=sig*eye(M);
Rii=A*A';
% calculating the noise matrix %
Ruu=Rii+Rnn;
Rxx=Ruu+Rss;
w=inv(Rxx)*a0;
for n1=1:length(theta)
th=theta(n1);
% calculation of steering vectors associated with each direction %
aa=exp(1j*2*pi*d*(n-1)*sin(th)).';
y(n1)=w'*aa;
end
% Calculation of the directional coefficient %
Y=abs(y)/max(abs(y));
figure(2);
plot(ang,Y); % plotting the result in a graphical form %
xlabel('Theta');
ylabel('AF theta');
title('Minimum MSE Pattern');
axis([-90 90 0 1]);
end
?? 快捷鍵說明
復制代碼
Ctrl + C
搜索代碼
Ctrl + F
全屏模式
F11
切換主題
Ctrl + Shift + D
顯示快捷鍵
?
增大字號
Ctrl + =
減小字號
Ctrl + -