|
楼主 |
发表于 2007-4-29 08:43
|
显示全部楼层
%RLS,forgeting facter==1
%RLS,forgeting facter==1
clear all;
close all;
clc;
f1=0;
f2=0;
f3=2;
f4=130;
global f0;
f0=100e6;
d1=60*pi/180;
d2=-60*pi/180;
d3=-40*pi/180;
d4=20*pi/180;
SP=2000;%采样点数
N=16;%阵元数
A=[conj(exp(j*(0:N-1)*pi*sin(d1)));conj(exp(j*(0:N-1)*pi*sin(d2)));conj(exp(j*(0:N-1)*pi*sin(d3)));conj(exp(j*(0:N-1)*pi*sin(d4)))]';%A为阵列
Ts=1/(300e3);%采样率300kHz
y1=500*Ts;
y2=100*Ts;
y3=120*Ts;
y4=200*Ts;
t=linspace(Ts,SP*Ts,SP);
Ps1=0;
K=200;
%w=zeros(N,K);
for n=1:SP
S1(1,n)=s(t(1,n)-y1)*exp(-j*2*pi*f1*t(1,n));%目标反射
S2(1,n)=s(t(1,n)-y2)*exp(-j*2*pi*f2*t(1,n));%地反射
S3(1,n)=s(t(1,n)-y3)*exp(-j*2*pi*f3*t(1,n));%地物反射
S4(1,n)=s(t(1,n)-y4)*exp(-j*2*pi*f4*t(1,n));% 直达波
Ps1=Ps1+(abs(S1(1,n)))^2;
end
Ps=N^2*Ps1/SP;
S=[S1;S2;S3;S4];
M=[1e5 1e4 1e4 1];%幅度
M=diag(M);
SNR=2;
Pn=Ps/(10^(N*SNR/10));%噪声功率
S1=1e5*S1;
for i=1:200
noise=wgn(N,SP,10*log10(Pn),'complex');
X=A*M*S+noise;
I=eye(N);
p=(1/0.004)*I;
w1=zeros(N,1);
e=zeros(1,SP);
e(1,1)=S1(1,1);
for n=2:SP
kg=p*X(:,n)/(1+X(:,n)'*p*X(:,n));
e(n)=conj(S1(1,n))-X(:,n)'*w1;
Wc(:,i)=w1+kg*(e(n));
p=p-kg*X(:,n)'*p;
w1=Wc(:,i);
end
end
Wc=sum(Wc,2)/200;%求均值
Y=Wc'*X;
cc=0;
for d=-pi/2:0.01:pi/2
cc=cc+1;
A1(:,cc)=[exp(j*(0:N-1)*pi*sin(d))].';
y_d(1,cc)=Wc'*A1(:,cc);
end
d=-pi/2:0.01:pi/2;
d=d*180/pi;
subplot(121);
plot(d,10*log10(abs(y_d).^2));grid on;
title('阵列输出功率增益方向图');
xlabel('到达角(deg)');
ylabel('阵列输出功率增益(dB)');
subplot(122);
plot(d,abs(y_d));grid on;
title('阵列输出幅度增益方向图');
xlabel('到达角(deg)');
ylabel('阵列输出幅度增益(dB)'); |
|