网站最新上线:#www.hslogic.com/

MSE的MATLAB仿真

上一篇 / 下一篇  2018-10-06 12:13:46

%MSE
clear all;close all;clc;
c = 3e8;
N = 8;
SN = 2048;
n = 1:1:SN;
thetac = 0;
thetai = 20*pi/180;%干扰方向
f0 = 1e6;
%f0 = 3e9;
fc     = 3e9;
fi     = 2e9;
fs     = 2*fc;
lamdac = c/fc;
lamdai = c/fi;
lamdas = c/fs;
d = lamdac/2;
% L = [0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15]';
L=[0:N-1]';
xc = exp(j*2*pi*d*sin(thetac)*L/lamdac)*exp(j*2*pi*fc*n*(1/fs));%认为信号包络为1,一次快拍
xi = exp(j*2*pi*d*sin(thetai)*L/lamdai)*exp(j*2*pi*fi*n*(1/fs));%认为没有噪声下的噪声信号
x = xc+xi;
noise=1/sqrt(2)*(randn(N,SN)+j*randn(N,SN));
Rn=noise*noise'/SN;
Rx  = x*x'/64 + Rn;
rxd = x*(sin(2*pi*f0*n*(1/fs)).*exp(j*2*pi*fc*n*(1/fs)))';
Wopt = inv(Rx)*rxd;
m = 0;
for theta = -pi/2:.001:pi/2
    m      = m+1;
    atheta = exp(j*2*pi*d*sin(theta)*L/lamdac);
    p(m)   = abs(Wopt'*atheta);
end
figure
plot((-pi/2:.001:pi/2)*180/pi,20*log10(p/max(p))),hold on
plot(thetac,-70:2:0,'.'),hold on
plot(thetai*180/pi,-70:2:0,'.');grid on;
xlabel('deg');ylabel('dB');title('MSE');
gtext('信号0deg,干扰20deg');




%music method
% [V,D]=eig(Rx);
% plot(diag(D),'r-o');
% xlabel('序号');ylabel('特征值大小');
% title('数据协方差矩阵特征值分布-3个信号');

% Vn=V(:,1:14);
% theta=-pi/2:pi/1000:pi/2;
% for k=1:1:length(theta)
%     atheta=exp(j*2*pi*d*sin(theta(k))*L/lamdai);
%     Stheta(k)=1/abs(atheta'*(Vn*Vn')*atheta);
% end
% figure
% plot((-pi/2:pi/1000:pi/2)*180/pi,20*log10(Stheta/max(Stheta)));grid on;
% xlabel('方位/deg');ylabel('幅度/dB');
% title('Music测向');

TAG:

 

评分:0

我来说两句

显示全部

:loveliness: :handshake :victory: :funk: :time: :kiss: :call: :hug: :lol :'( :Q :L ;P :$ :P :o :@ :D :( :)

Open Toolbar