资源描述:
《RLS算法仿真程序源代码.doc》由会员上传分享,免费在线阅读,更多相关内容在工程资料-天天文库。
1、RLS算法仿真程序源代码:clc;clearall;M=2;%BPSK调制w_len=2;%前馈抽头个数Fd=10e6;%信息速率rolloff=1;%滚降系数up=4;%samplespersymboldelay=4;%升余弦滤波器的群延迟Fs=Fd*up;data_len=100;data=randint(1,data_len,M);m_data=pskmod(data,M);[NUM1,DEN1]=rcosine(Fd,Fs,'fir/sqrt',rolloff,delay);[t_data,tc]=rcosflt(m
2、_data,Fd,Fs,'filter',NUM1);%成形滤波t_data=t_data.';gain=[11];%%%%%%%%%%15msdelaychannel%%%%%%%%%%%%%%t_delay=ceil(1.5*up);r_signal(1,:)=gain(1)*t_data+gain(2)*[zeros(1,t_delay),t_data(t_delay+1:length(t_data))];%%%%%%%%%%25msdelaychannel%%%%%%%%%%%%%%t_delay=ceil(2.5*
3、up);r_signal(2,:)=gain(1)*t_data+gain(2)*[zeros(1,t_delay),t_data(t_delay+1:length(t_data))];snr=5;%信噪比r_signal(3,:)=gain(1)*t_data;r_signal(3,:)=awgn(r_signal(3,:),snr,'measured');fori=1:3[r_data,tr]=rcosflt(r_signal(i,:),Fd,Fs,'filter/Fs',NUM1);%匹配升余弦滤波器equlz_in=
4、r_data(delay*2*up+1:up:length(r_data)-delay*2*up);%抽取得到均衡输入数据a(1)=1;a(w_len)=0;%抽头系数初始化第一个抽头系数为1,其余为0a=zeros(w_len,1);Lambda=0.99;%SettheforgettingfactorDelta=10;%RinitializedtoDelta*IR=Delta*eye(w_len,w_len);%相关矩阵forn=w_len:data_lenu=equlz_in(n:-1:n-w_len+1);pi=u'
5、*R;%互相关矩阵K=pi'/(Lambda+pi*u);p(n)=a'*u;y(n)=pskdemod(p(n),M);rd(n)=pskmod(y(n),M);err(i,n)=rd(n)-p(n);R=(R-K*pi)/Lambda;a=a+K*conj(err(i,n));endendfigure;subplot(3,1,1);plot(abs(err(1,:)));xlabel('15msdelay');subplot(3,1,2);plot(abs(err(2,:)));xlabel('25msdelay');s
6、ubplot(3,1,3);plot(abs(err(3,:)));xlabel('whitenoise');