实验四 码间串扰仿真实验 一、 实验目的:
1、 掌握无码间串扰的传输条件;
2、 掌握升余弦滚降系统的MATLAB仿真; 3、 能够用MATLAB画出接收信号的眼图。 二、 实验内容:
1、 画出a=0.5时,升余弦滚降系统的频谱,并画出对应的时域波形。
Ts=1; N_sample=17; dt=Ts/N_sample; df=1.0/(20.0*Ts);
t=-10*Ts:dt:10*Ts; f=-2/Ts:df:2/Ts; a=[0,0.5,1]; for n=1:length(a)
for k=1:length(f)
if abs(f(k))>0.5*(1+a(n))/Ts Xf(n,k)=0;
elseif abs(f(k))<0.5*(1-a(n))/Ts Xf(n,k)=Ts; else
Xf(n,k)=0.5*Ts*(1+cos(pi*Ts/(a(n)+eps)*(abs(f(k))-0.5*(1-a(n))/Ts))); end; end;
xt(n,:)=sinc(t/Ts).*(cos(a(n)*pi*t/Ts))./(1-4*a(n)^2*t.^2/Ts^2+eps); end figure(1) plot(f,Xf);
axis([-1 1 0 1.2]);
xlabel('f/Ts');ylabel('升余弦滚降频谱'); figure(2); plot(t,xt);
axis([-10 10 -0.5 1.1]);
xlabel('t');ylabel('升余弦滚降波形');
2、 例5-9,分别画出通过低通滤波器后的眼图。
N=1000; N_sample=8;
Ts=1;
dt=Ts/N_sample;
t=0:dt:(N*N_sample-1)*dt;
gt=ones(1,N_sample); d=sign(randn(1,N));
a=sigexpand(d,N_sample); st=conv(a,gt);
ht1=5*sinc(5*t/Ts); rt1=conv(st,ht1); ht2=2*sinc(2*t/Ts); rt2=conv(st,ht2);
eyediagram(rt1+j*rt2,40,5);
function[out]=sigexpand(d,M)% N=length(d); out=zeros(M,N); out(1,:)=d;
out=reshape(out,1,M*N);