QPSK的matlab仿真.rar

• 张哲哲
了解作者
• matlab
开发工具
• 1KB
文件大小
• rar
文件格式
• 0
收藏次数
• 1 积分
下载积分
• 13
下载次数
• 2018-04-11 18:43
上传日期

QPSK的matlab仿真.rar
• QPSKStim.m
4KB

%QPSK调制解调仿真 %Author：张宗卫 %date：2018.3.10 clc clear all fc=30; fs=1000; % fcu=200; t=1/fs:1/fs:0.8; L=length(t); %四元符号产生 code4=zeros(1,L); for i=1:L/8 code4(i)=0; end for i=L/8+1:L/8*2 code4(i)=3; end for i=L/8*2+1:L/8*3 code4(i)=1; end for i=L/8*3+1:L/8*4 code4(i)=2; end for i=L/8*4+1:L/8*5 code4(i)=1; end for i=L/8*5+1:L/8*6 code4(i)=0; end for i=L/8*6+1:L/8*7 code4(i)=2; end for i=L/8*7+1:L code4(i)=3; end figure(1) plot(t,code4) title('4进制码元') %串并转换 比特对 bIn=zeros(1,L); bQn=zeros(1,L); for i=1:L switch code4(i) case 0 bIn(i)=0; bQn(i)=0; case 1 bIn(i)=0; bQn(i)=1; case 2 bIn(i)=1; bQn(i)=1; case 3 bIn(i)=1; bQn(i)=0; end end figure(2) subplot(211),plot(t,bIn),title('正交支路bIn') subplot(212),plot(t,bQn),title('同相支路bQn') %比特对双极性形成 aIn=zeros(1,L); aQn=zeros(1,L); for i=1:L if bIn(i)==0 aIn(i)=-1; else aIn(i)=1; end if bQn(i)==0 aQn(i)=-1; else aQn(i)=1; end end figure(3) subplot(211),plot(t,aIn),title('双极性正交支路aIn') subplot(212),plot(t,aQn),title('双极性同相支路aQn') %QPSK信号调制 ISC=cos(2*pi*fc*t); QSC=sin(2*pi*fc*t); QPSK=aIn.*ISC+aQn.*QSC; figure(4) subplot(311),plot(t,ISC),title('正交支路2PSK') subplot(312),plot(t,QSC),title('同相支路2PSK') subplot(313),plot(t,QPSK),title('QPSK信号') %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% %QPSK解调 ILo=cos(2*pi*fc*t); QLo=sin(2*pi*fc*t); %step1 混频 RecQt=QPSK.*QLo; RecIt=QPSK.*ILo; figure(5) subplot(211) plot(t,RecQt),title('接收同相支路混频') subplot(212) plot(t,RecIt),title('接收正交支路混频') %step2 过LPF b=[0.00226675464588304,0.00136504505246622,0.00175878104612964,0.00221153432901494,0.00272748466037607,0.00330780022766749,0.00395363565442280,0.00466597851131189,0.00544450028376728,0.00628773584107796,0.00719347499703571,0.00815843398510817,0.00917825631157910,0.0102478237985242,0.0113612748511266,0.0125115706154483,0.0136904482156869,0.0148889062085348,0.0160976629650599,0.0173071380635749,0.0185071499666179,0.0196867585367558,0.0208345741081722,0.0219395410846265,0.0229913842469065,0.0239801230256774,0.0248953112618121,0.0257266964838253,0.0264657446472916,0.0271057988938512,0.0276400460627811,0.0280609918741315,0.0283640711472088,0.0285498939514168,0.0286089914329785,0.0285498939514168,0.0283640711472088,0.0280609918741315,0.0276400460627811,0.0271057988938512,0.0264657446472916,0.0257266964838253,0.0248953112618121,0.0239801230256774,0.0229913842469065,0.0219395410846265,0.0208345741081722,0.0196867585367558,0.0185071499666179,0.0173071380635749,0.0160976629650599,0.0148889062085348,0.0136904482156869,0.0125115706154483,0.0113612748511266,0.0102478237985242,0.00917825631157910,0.00815843398510817,0.00719347499703571,0.00628773584107796,0.00544450028376728,0.00466597851131189,0.00395363565442280,0.00330780022766749,0.00272748466037607,0.00221153432901494,0.00175878104612964,0.00136504505246622,0.00226675464588304]; a=1; RecQtPassLPF=filter(b,a,RecQt); RecItPassLPF=filter(b,a,RecIt); RecQtPassLPF=round(2*RecQtPassLPF); RecItPassLPF=round(2*RecItPassLPF); figure(6) subplot(211) plot(t,RecQtPassLPF);title('接收同相支路混频过LPF') subplot(212) plot(t,RecItPassLPF);title('正交同相支路混频过LPF') %step3 采样判决 RecbIn=zeros(1,L); RecbQn=zeros(1,L); for i=1:L if RecQtPassLPF(i) ==1 RecbQn(i)=1; else RecbQn(i)=0; end if RecItPassLPF(i) ==1 RecbIn(i)=1; else RecbIn(i)=0; end end %step4 串转并 RecCode4=zeros(1,L); for i=1:L if RecbIn(i)==0 && RecbQn(i)==0 RecCode4(i)=0; elseif RecbIn(i)==0 && RecbQn(i)==1 RecCode4(i)=1; elseif RecbIn(i)==1 && RecbQn(i)==1 RecCode4(i)=2; else RecCode4(i)=3; end end figure(7) subplot(211) plot(t,RecCode4);title('解调后的4元符号序列') subplot(212) plot(t,code4);title('调制前的4元符号序列')

相关推荐
• USB-COM(HL340).rar
usb转串口，找了很久才找到，现在别的地方很难下到，要不用不了，我这个可以用 HL340D 的
• NAND FLASH的读写程序.rar
Nand flash 读写程序 C语言代码，可以给U盘开发者参考 可以读写三星各种型号的Nand flash芯片
• USB_2.0.rar
USB2.0开发例程，基于51单片机，包括pc端程序
• 串口温度数据采集并实时显示.rar
串口温度数据采集并实时显示 读串口数据的原理是,只要当有数据向串口发数据来时,计算机就会自动将其数据写到一个特定的缓冲区,我们只要写程序去读那个特定的缓冲区就可以了. 有数据向串口发过来时,程序可以将数据接收到,接收的数据是字符型的,那么将数据转化为数字型的,再将这个数据的大小作为画图的某一个点的纵坐标,横坐标为数据的序号.将这些点用线连起来就是一个曲线图了,这个就是图形显示基本原理. 查看原来的数据的原理也是这样的,不同的地方就是,数据是从文件中来,同样的也是将多个数据分成一个一个的,然后这一个数据的大小就是画图的某一个点的纵坐标,横坐标同样为数据的序号,再将这些点用线连起来就是曲线图. 图形能移动的原理,是我们首先改变的只是数据,图形并没有变,但图形的形式是由这些数据来确定的,当数据发生变化后,我们通过刷新显示区来变化的.
• gps.rar
GPS应用程序设计，内含GPS卫星原理、方法及详细源代码
• MSCOMM32.OCX.rar
串口编程控件MSCOMM32.OCX mscomm32.ocx是微软提供的串口通讯开发控件。支持串口通讯的软件大部分都是使用这个控件来实现串口通讯功能的。 安装方法:请您把它复制到系统目录下,对于windows9x系列(win95、win98、winme)是x:\windows\system\,对于 windowsNT、windows2000、windowsXP系列是x:\winnt\system32\。然后打开一个命令行提示符窗口(MSDOS方式窗口), 用"cd x:\windows\system\"命令或者"cd x:\winnt\system32\"切换到系统目录下,再执行"regsvr32 mscomm32.ocx"这个命令。
• VSer.rar
虚拟串口的完整源代码，包括注释和开发日志。据说市值5万人民币！
• USB-shujucaiji.rar
USB数据采集系统论文-自己的毕业设计论文，花了很长时间做的，内容十分详细，包括核心代码和开发环境的设置。
• wmserial.zip
基于消息的Windows串口通讯例子
• TX-1C-usbdriver.rar
郭天祥TX-1C的USB开发板原码，内有驱动文件，固件程序