mmse.m

来自「algorithm to calculate the MMSE algorith」· M 代码 · 共 45 行

M
45
字号
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 + =
减小字号Ctrl + -
显示快捷键?