资源描述:
《实训三 数字信号基带传输的仿真设计.doc》由会员上传分享,免费在线阅读,更多相关内容在应用文档-天天文库。
1、实训三数字信号基带传输的仿真设计一、实验内容1、基带信号采用不归零矩形脉冲或升余弦滚降波形,基带信号的功率谱密度分析。2、误码率的计算:A/σ和误码率之间的性能曲线3、眼图的生成4、匹配滤波器二、程序与仿真图1.%二进制不归零矩形脉冲clc;closeall;clearall;N_sample=100;N_num=1000;t=0/N_sample:1/N_sample:N_num-1/N_sample;st=0;fori=1:20d=(randint(1,N_num)*2-1);st_bb=rectpulse(d,N_sample);%将矩阵连接windo
2、w=boxcar(length(st_bb));%矩形加窗函数[pxx,f]=periodogram(st_bb,window,2^16,N_sample);%计算功率谱密度函数,st_bb为待求函数,window是所使用的窗口,长度必须和待求函数一致%2*16是采样点数N_sample,采样频率st=st+pxx;endst=st/20;figure(1);subplot(2,1,1);plot(t,st_bb);title('基带信号波形');axis([015-1.51.5]);gridon;subplot(2,1,2);plot([-1*flipud
3、(f);f],0.5*[flipud(st);st]);title('基带信号功率谱');%dlipud实现矩阵上下翻转axis([-8802]);gridon;%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%二进制滚降系数为1st_rc=rcosflt(d,1,80,'fir',1,1);figure(2);subplot(2,1,1);plot(0:1/50:35-1/50,st_rc(1:35*50));axis([015-22]);gridon;title('基带信号波形(滚降系数为1)');st1
4、=0;fori=1:5d=(randint(1,N_num)*2-1);st_re=rcosflt(d,1,40,'fir',1,1);window=boxcar(length(st_rc));[px1,f]=periodogram(st_rc,window,2^16,N_sample);st1=st1+px1;endst1=st1/5;subplot(212);plot([-1*flipud(f);f],0.5*[flipud(st);st]);title('基带信号功率谱(滚降系数为1)');axis([-5501.5]);gridon;%%%%%%%%
5、%%%%%%%%%%%%%%%n=10^6;snr_db=0:12;ber=zeros(1,length(snr_db));%生成0矩阵fori=1:length(snr_db)d=(randint(1,n)*2-1);dwn=awgn(d,snr_db(i));%加性高斯白噪声d_r=sign(dwn);%置位-1或1ber(i)=length(find(d~=d_r))/n;%%%%endpe=0.5*erfc(sqrt(10.^(snr_db/10)/2));figure(3);semilogy(snr_db,ber,'k*');holdon;grid
6、on;semilogy(snr_db,pe,'r-');xlabel('A/&');ylabel('ber');legend('ber','ber_Theory');2.clcclearall;closeall;figure;ht=rcosflt(1,1,200,'fir/sqrt',1,3);subplot(2,2,1)plot(ht);axis([01200-0.030.10]);gridon;ht=rcosflt(1,1,200,'fir/sqrt',0.75,3);subplot(2,2,2)plot(ht);axis([01200-0.030.10
7、]);gridon;ht=rcosflt(1,1,200,'fir/sqrt',0.5,3);subplot(2,2,3)plot(ht);axis([01200-0.030.10]);gridon;ht=rcosflt(1,1,200,'fir/sqrt',0.25,3);subplot(2,2,4)plot(ht);axis([01200-0.030.10]);gridon;3.clearall;N=1000;x=sign(randn(1,N));Ts=1;alpha=1;y=rcosflt(x,1/Ts,100,'fir',alpha,5);figur
8、e(3);plot(y);title('多个滚降信号