您好,欢迎访问三七文档
当前位置:首页 > 电子/通信 > 综合/其它 > 实训四-数字信号频带传输的仿真设计
实训四数字信号频带传输的仿真设计一、实验内容1、基带信号采用不归零矩形脉冲,生成2PSK信号的时域波形和功率谱密度。2、生成QPSK信号的时域波形和功率谱密度。3、QPSK接收信号的星座图。4、仿真QPSK系统的误码率。二、程序与仿真图1.clc;clearall;tm=1;fc=3;Nsample=100;Nnum=1000;dt=tm/Nsample;N=Nsample*Nnum;t=0:dt:Nnum*tm-dt;NFFT=2.^16;Nloop=50;st1=0;st2=0;%%%%fori=1:Nloop;d=2*randint(1,Nnum)-1;st_bb=rectpulse(d,Nsample);st_2psk=st_bb.*sin(2*pi*fc*t);window=boxcar(length(st_bb));[pxx1,f]=periodogram(st_bb,window,NFFT,1/dt);[pxx2,f]=periodogram(st_2psk,window,NFFT,1/dt);st1=st1+pxx1;st2=st2+pxx2;endst1=st1/Nloop;st2=st2/Nloop;%%%%%%%%%%%%%%figure(1);subplot(211);plot(t,st_bb);axis([010-1.51.5]);xlabel('t');ylabel('幅度');title('双极性基带信号的时域波形');subplot(212);plot(t,st_2psk);axis([010-1.51.5]);gridon;xlabel('t');ylabel('幅度');title('2PSK已调信号波形');figure(2);subplot(211);plot([-1*flipud(f);f],0.5*[flipud(st1);st1]);axis([-151501]);xlabel('f');ylabel('频谱');title('双极性基带信号的频谱');gridon;subplot(212);plot([-1*flipud(f);f],0.5*[flipud(st2);st2]);axis([-101000.5]);xlabel('f');ylabel('频谱');title('2PSK已调信号的频谱');gridon;2.clearall;N=10^6;d1=randint(1,N).*2-1;d2=randint(1,N).*2-1;d=d1+j*d2;Es=mean(abs(d).^2);Eb=Es./2;snr_db=-2:10;forsnr=-2:10;n0=Eb/(10^(snr/10));sigma=sqrt(n0/2);n=sigma*randn(size(d))+j*sigma*randn(size(d));rt=d+n;y1=sign(real(rt));y2=sign(imag(rt));ber(1,snr+3)=((length(find(y1~=d1)))+(length(find(y2~=d2))))/(2.*N);ber1(1,snr+3)=berawgn(snr,'qam',4);endsemilogy(snr_db,ber,'b-*');holdon;semilogy(snr_db,ber1,'r-');gridon;xlabel('Eb/N0');ylabel('wumalv');legend('ber','ber-theory');title('QPSK系统性能曲线');3.Qm=2;N_num=10^5;d1=sign(randn(1,N_num));d2=sign(randn(1,N_num));d=d1+d2*j;Es=mean(abs(d).^2);Eb=Es/Qm;EbN0_dB=10;ebn0=10.^(EbN0_dB/10);sigma=sqrt(Eb/ebn0/2);n=sigma*randn(size(d))+j*sigma*randn(size(d));rt=d+n;plot(rt,'.');axis([-2.52.5-22]);gridon;xlabel('I');ylabel('Q');title('信噪比为10dB的QPSK星座图');4.Qm=2;N_num=10^5;d1=sign(randn(1,N_num));d2=sign(randn(1,N_num));d=d1+d2*j;Es=mean(abs(d).^2);Eb=Es/Qm;EbN0_dB=5;ebn0=10.^(EbN0_dB/10);sigma=sqrt(Eb/ebn0/2);n=sigma*randn(size(d))+j*sigma*randn(size(d));rt=d+n;plot(rt,'.');axis([-33-33]);gridon;xlabel('I');ylabel('Q');title('信噪比为5dB的QPSK星座图');
本文标题:实训四-数字信号频带传输的仿真设计
链接地址:https://www.777doc.com/doc-2055314 .html