之间是不相关的amp1=200*randn(1);ampn=1;jam(:,ii)=amp1*exp(ima*2*pi*0.5*sin(theta1*pi/180)*[0:M-1]')+ampn*(randn(M,1)+ima*randn(M,1));%干扰+噪声s(ii)=amp0*exp(ima*2*pi*0.5*sin(theta0*pi/180))+amp1*exp(ima*2*pi*0.5*sin(theta1*pi/180))+ampn*(randn(1,1)+ima*randn(1,1));%接收信号(信号+干扰+噪声)s0(ii)=amp0*exp(ima*2*pi*0.5*sin(theta0*pi/180));endRx=1/L*jam*jam';%噪声自相关矩阵,相当于X(t)r_xd=1/L*jam*s';Wopt=pinv(Rx)*r_xd;delta=s0-(s-Wopt'*jam);delta1=abs(mean(delta.^2)-(mean(delta)).^2)%方差theta=linspace(-pi/2,pi/2,200);forjj=1:length(theta)a=exp(ima*2*pi*.5*sin(theta(jj))*[0:M-1]');f(jj)=Wopt'*a;endF=20*log10(abs(f)/(max(max(abs(f)))));figure(1)set(gcf,'color','w')plot(theta*180/pi,F),holdonplot(theta0,-50:0,'.')plot(theta1,-50:0,'.')xlabel('theta/o');ylabel('F/dB');title('MSE准则下的方向图')axis([-9090-500]);%可为x轴和y轴设置一个极限范围仿真图如下: