matlab编程pi4-DQPSK的仿真程序,GUI界面,可以计算误码率源码程序 - matlab通信信号 - 谷速源码
下载频道> 资源分类> matlab源码> 通信信号> matlab编程pi4-DQPSK的仿真程序,GUI界面,可以计算误码率源码程序

标题:matlab编程pi4-DQPSK的仿真程序,GUI界面,可以计算误码率源码程序
分享到:

所属分类: 通信信号 资源类型:程序源码 文件大小: 86.99 KB 上传时间: 2019-06-14 01:15:07 下载次数: 2 资源积分:1分 提 供 者: admin gusucode
内容:
matlab编程pi4-DQPSK的仿真程序,GUI界面,可以计算误码率源码程序
param.NumSig=100;
param.srState=12345;
param.dpt=3;
param.State=71;
 
x=randint(1,param.NumSig,[0 1],param.srState);
 
xCoded_Block=[];
xCoded_Cyclic=[];
xCoded_Interleaver=[];
 
tt=mod(param.NumSig,4);
if tt
    x=[x zeros(1,4-tt)];
end
% Linear coding.
xCode=zeros(1,4);
for k=1:4:param.NumSig
    xCode(1)=x(k);
    xCode(2)=x(k+1);
    xCode(3)=x(k+2);
    xCode(4)=x(k+3);
    
    BlockGen=[1 0 0 0 1 1 1;0 1 0 0 1 1 0;0 0 1 0 1 0 1; 0 0 0 1 0 1 1];
    xCoded_Block=[xCoded_Block rem(xCode*BlockGen,2)];
end
 
% xCoded_Block must be the mutiple of 4
tt=mod(length(xCoded_Block),4);
if tt
    xCoded_Block=[xCoded_Block zeros(1,4-tt)];
end
 
% Cyclic coding
i=1;
for k=1:4:length(xCoded_Block)
    xCode(1)=xCoded_Block(k);
    xCode(2)=xCoded_Block(k+1);
    xCode(3)=xCoded_Block(k+2);
    xCode(4)=xCoded_Block(k+3);
    
    %CyclicPoly=[1 0 1 1];
    CyclicGen=[1 0 1 1 0 0 0;1 1 1 0 1 0 0;1 1 0 0 0 1 0;0 1 1 0 0 0 1];
    %xCoded_Cyclic=[xCoded_Cyclic rem(tx*CyclicGen,2)];
    xCoded_Cyclic(i,:)=rem(xCode*CyclicGen,2);
    i=i+1;
end
 
 
tt=mod(i-1,param.dpt);
if tt
    xCoded_Cyclic=[xCoded_Cyclic;zeros(param.dpt-tt,7)];
end
 
% Interleaver coding
[n,m]=size(xCoded_Cyclic);
for k=1:param.dpt:n
    for cln=1:7
       for j=0:param.dpt-1
           xCoded_Interleaver=[xCoded_Interleaver xCoded_Cyclic(k+j,cln)];
       end
    end
end
 
% convert to 1-D column vector
xCoded_Interleaver=xCoded_Interleaver(:);
 
tt=mod(length(xCoded_Interleaver),2);
odd_check=0;
if tt
    xCoded_Interleaver=[xCoded_Interleaver;0];
    odd_check=1;
end
 
% convert to  2-D column vector
for k=1:2:length(xCoded_Interleaver)
    bit_txSig((k+1)/2,1)=xCoded_Interleaver(k);
    bit_txSig((k+1)/2,2)=xCoded_Interleaver(k+1);
end
 
[n,m]=size(bit_txSig);
for i=1:n
    int_txSig(i,1)=bit_txSig(i,1)*2+bit_txSig(i,2);
end
 
 
 
 
[n,m]=size(int_txSig);
% convert to n x 2 dimension bit vector
for i=1:n
    switch int_txSig(i)
        case 0
            rxSigBit(i,1)=0;
            rxSigBit(i,2)=0;
        case 1
            rxSigBit(i,1)=0;
            rxSigBit(i,2)=1;
        case 2
            rxSigBit(i,1)=1;
            rxSigBit(i,2)=0;
        case 3
            rxSigBit(i,1)=1;
            rxSigBit(i,2)=1;
        otherwise
    end
end
 
% convert to N x 1 bit vector
for i=1:n
    rxSig_cln(2*i-1,1)=rxSigBit(i,1);
    rxSig_cln(2*i,1)=rxSigBit(i,2);
end
 
[n,m]=size(rxSig_cln);
if odd_check
    rxSig_cln=rxSig_cln(1:n-1);
end
 
[n,m]=size(rxSig_cln);
if mod(n,param.dpt)
    error('find some error ');
end
 
%
k=1;
for i=1:param.dpt:n
    rxSig_dpt(k,:)=[rxSig_cln(i) rxSig_cln(i+1) rxSig_cln(i+2)];
    k=k+1;
end
 
[n,m]=size(rxSig_dpt);
rxdecoded_Interleaver=[];
for i=1:7:n
    for j=1:m
        for k=0:6
            rxdecoded_Interleaver=[rxdecoded_Interleaver rxSig_dpt(i+k,j)];
        end
    end
end
 
 
rxdecoded_Cyclic=decode(rxdecoded_Interleaver,7,4,'cyclic',[1 0 1 1]);
 
[n,m]=size(rxdecoded_Cyclic);
tt=mod(n,7);
if tt
    rxdecoded_Cyclic=[rxdecoded_Cyclic;zeros(7-tt,1)];
end
 
%assignin('base','sddd',rxdecoded_Cyclic);
 
% 
rxdecoded_Linear=decode(rxdecoded_Cyclic,7,4,'linear',BlockGen);
 
xx=x(1:param.NumSig).';
 
%
[bitNum,bitRatio]=biterr(xx,rxdecoded_Linear(1:param.NumSig));

文件列表(点击上边下载按钮,如果是垃圾文件请在下面评价差评或者投诉):

gusucode/
gusucode/Data/
gusucode/parameters/
gusucode/4BtnCData.mat
gusucode/Data/DefaultData.mat
gusucode/Data/sim1.mat
gusucode/Data/tt.mat
gusucode/ParamSet.asv
gusucode/ParamSet.fig
gusucode/ParamSet.m
gusucode/btnexit.gif
gusucode/com_process.asv
gusucode/com_process.fig
gusucode/com_process.m
gusucode/parameters/DefaultData.mat
gusucode/start.m
gusucode/test111.asv
gusucode/test111.m
gusucode/test_fig.asv

关键词: matlab编程 pi4-DQPSK GUI界面 误码率 源码程序

Top_arrow
回到顶部
联系方式| 版权声明| 招聘信息| 广告服务| 银行汇款| 法律顾问| 兼职技术| 付款方式| 关于我们|
网站客服网站客服 程序员兼职招聘 程序员兼职招聘
沪ICP备19040327号-3
公安备案号:沪公网安备 31011802003874号
库纳格流体控制系统(上海)有限公司 版权所有
Copyright © 1999-2014, GUSUCODE.COM, All Rights Reserved