资源简介
里面算法很全面,各种基本算法及个算法的优化都包含在里面,各个算法均可仿真,适合初学者及有需要的人士学习。虽然要6分,但你绝对不会吃亏的。我用我的菊花做担保。
代码片段和文件信息
clc;
clear all;
%********************************4 array************************************
M=4;%4 antenna
N=[0:M-1]‘;%line
ratio=0.5;
Fd=1;%bit rate
Fs=4;
Lx=2000;
delay=3;
r=0.5;
SNR=[103020];
SNR=sqrt(10.^(SNR/10))*sqrt(1/2);
theta=[0;
0.7;
-0.4]; %jam2_theta
rand(‘seed‘sum(1000*clock));
u=rand(1Lx);
v=rand(1Lx);
% 源信号
signal=sqrt(-2*log(1-u)).*cos(2*pi*v)*SNR(1);
% signal=signal(1:Lx);
u=rand(1Lx);
v=rand(1Lx);
% 干扰信号(高斯白噪声,方差为1均值为0)
jam_1=sqrt(-2*log(1-u)).*cos(2*pi*v)*SNR(2);
jam_2=sqrt(-2*log(1-v)).*sin(2*pi*u)*SNR(3);
% jam_1=sqrt(1/2)*SNR(1)*(randn+j*randn)*signal;
% jam_2=sqrt(1/2)*SNR(2)*(randn+j*randn)*signal;
rec_sig=[signal;jam_1;jam_2];
a_sig=exp(-j*2*pi*ratio*N*sin(theta(1)));
a_jam1=exp(-j*2*pi*ratio*N*sin(theta(2)));
a_jam2=exp(-j*2*pi*ratio*N*sin(theta(3)));
a=[a_siga_jam1a_jam2];
noise=crandn(4Lx);
ss=a*rec_sig+noise;
%******************************lms processing*****************
Tr_lx=1000;
mu=1e-5;
% d=awgn(signal_t20‘measured‘);
d=signal‘;
w=zeros(41);
w(11)=1;
en=[];
for i=1:Lx
en(i)=d(i)-w‘*ss(:i);
w=w+mu*ss(:i)*conj(en(i));
end
g2=w‘*a_g;
g_theta2=abs(g2);
g_theta2=g_theta2./max(g_theta2);
plot(k20*log10(g_theta2)‘g‘);
%******************************RLS processing*****************
M=4;
lamda=0.995;
delta=0.005;
P=delta^(-1)*eye(4);
C=zeros(M1);
g=zeros(M1);
% wopt5=zeros(M1);
% wopt5(11)=randn;
wopt5=[];
for j=1:M
wopt5(j1)=rand;
end
for i=1:Lx
u=ss(:i)‘*P*ss(:i);
g=P*ss(:i)./(lamda+u);
e_rls =d(i) - ss(:i)‘*wopt5;
wopt5=wopt5+e_rls.*g;
P=lamda^(-1)*(P-g*ss(:i)‘*P);
end
g3=wopt5‘*a_g;
g_theta3=abs(g3);
g_theta3=g_theta3./max(g_theta3);
plot(k20*log10(g_theta3)‘c‘);
hold
grid
legend(‘lms‘‘rls‘)
title(‘Beam Nulling arithmetic of three Arithmetic‘)
ylabel(‘Normalized Antenna Gain(db)‘)
axis([-22-600])
属性 大小 日期 时间 名称
----------- --------- ---------- ----- ----
文件 1984 2008-09-21 19:41 lms_4array.m
----------- --------- ---------- ----- ----
1984 1
评论
共有 条评论