二维极坐标天线方向图在直角坐标系已经画出来了,但是不知道用极坐标在matlab中怎么画?程序如下:%%LMSclear,clcm=8; %sensorsn=2; %sourcestheta=[0 -45]; %in angled=1/2; %1/2lambadaN=500; %samplesL=100; %resolution in[
来源:学生作业帮助网 编辑:六六作业网 时间:2025/01/31 20:26:48
二维极坐标天线方向图在直角坐标系已经画出来了,但是不知道用极坐标在matlab中怎么画?程序如下:%%LMSclear,clcm=8; %sensorsn=2; %sourcestheta=[0 -45]; %in angled=1/2; %1/2lambadaN=500; %samplesL=100; %resolution in[
二维极坐标天线方向图在直角坐标系已经画出来了,但是不知道用极坐标在matlab中怎么画?
程序如下:
%%LMS
clear,clc
m=8; %sensors
n=2; %sources
theta=[0 -45]; %in angle
d=1/2; %1/2lambada
N=500; %samples
L=100; %resolution in[-90’ 90’]
c=0.0001; %是为了防止过小而引起步长过大,从而导致算法的发散
%generate the source signals
%s=2*round(rand(n,N))-1;
s=round(rand(n,N));
%generate the A matrix
A=exp(-j*2*pi*d*[0:m-1].'*sin(theta*pi/180));
%generate the noise component
e=0.1*(randn(m,N));
%generate the ULA data
Y=A*s+e;
h=cov(Y.');
mu=1/(20*trace(h)); %设定步长因子
%initialize weight matrix and associated Parameters for LMS predictor
de=s(1,:);
w=zeros(m,1);
for k=1:N
%Predict next sample and error
y(k)=w'*Y(:,k);
e(k)=de(k)-y(k);
%adapt weight matrix and step size
w=w+mu*Y(:,k)*conj(e(k));
end
% beamforming using the LMS method
beam=zeros(1,L);
for i=1:L
a=exp(-j*2*pi*d*[0:m-1].'*sin(-pi/2+pi*(i-1)/L));
beam(i)=20*log10(abs(w'*a));
end
%Plotting command followed
figure
angle=-90:180/L:(90-180/L);
plot(angle,beam);
grid on
xlabel('angle');
ylabel('幅度响应/dB');
title('LMS算法波束成形');
figure
for k=1:N
en(k)=abs(e(k)^2);
end
plot(en);
grid on
xlabel('angle');
ylabel('幅度响应/dB');
title('LMS算法稳态误差');
二维极坐标天线方向图在直角坐标系已经画出来了,但是不知道用极坐标在matlab中怎么画?程序如下:%%LMSclear,clcm=8; %sensorsn=2; %sourcestheta=[0 -45]; %in angled=1/2; %1/2lambadaN=500; %samplesL=100; %resolution in[
极坐标画图,在matlab里用polar(theta,rho)
theta是幅角,rho是径失