资源简介

本程序为matlab编写。主要是写了64QAM调制的软判决译码。并且译码输出可直接输入到 turbo译码器 。另外也附加了64QAM的编码和硬判决。

资源截图

代码片段和文件信息

function y = De_64QAM(input)
%实现64QAM解调 

I_length=length(input);
input_modu=input*sqrt(42);

QAM_input_I = real(input_modu);
QAM_input_Q = imag(input_modu);
output_frame = zeros(1length(input)*6);

%实部解调判决映射部分
for l1=1:I_length
    if(abs(QAM_input_I(l1))>6)
        if((QAM_input_I(l1)<0))
            QAM_input_I(l1)=-7;
            output_frame(6*(l1-1)+1:2:6*(l1-1)+5)=[111];
        else
            QAM_input_I(l1)=7;
            output_frame(6*(l1-1)+1:2:6*(l1-1)+5)=[011];
        end;
        
    else
        if(abs(QAM_input_I(l1))>4 && abs(QAM_input_I(l1))<=6)
            if((QAM_input_I(l1)<0))
                QAM_input_I(l1)=-5;
                output_frame(6*(l1-1)+1:2:6*(l1-1)+5)=[110];
            else
                QAM_input_I(l1)=5;
                output_frame(6*(l1-1)+1:2:6*(l1-1)+5)=[010];
            end;
            
        else
            if(abs(QAM_input_I(l1))>2 && abs(QAM_input_I(l1))<=4)
                if((QAM_input_I(l1)<0))
                    QAM_input_I(l1)=-3;
                    output_frame(6*(l1-1)+1:2:6*(l1-1)+5)=[100];
                else
                    QAM_input_I(l1)=3;
                    output_frame(6*(l1-1)+1:2:6*(l1-1)+5)=[000];
                end;
            else
                if((QAM_input_I(l1)<0))
                    QAM_input_I(l1)=-1;
                    output_frame(6*(l1-1)+1:2:6*(l1-1)+5)=[101];
                else
                    QAM_input_I(l1)=1;
                    output_frame(6*(l1-1)+1:2:6*(l1-1)+5)=[001];
                end;
            end;
        end;
    end;
end;
%虚部解调判决映射部分 
for l1=1:I_length
    if(abs(QAM_input_Q(l1))>6)
        if((QAM_input_Q(l1)<0))
            QAM_input_Q(l1)=-7;
            output_frame(6*(l1-1)+2:2:6*(l1-1)+6)=[111];
        else
            QAM_input_Q(l1)=7;
            output_frame(6*(l1-1)+2:2:6*(l1-1)+6)=[011];
        end;
        
    else
        if(abs(QAM_input_Q(l1))>4 && abs(QAM_input_Q(l1))<=6)
            if((QAM_input_Q(l1)<0))
                QAM_input_Q(l1)=-5;
                output_frame(6*(l1-1)+2:2:6*(l1-1)+6)=[110];
            else
                QAM_input_Q(l1)=5;
                output_frame(6*(l1-1)+2:2:6*(l1-1)+6)=[010];
            end;
            
        else
            if(abs(QAM_input_Q(l1))>2 && abs(QAM_input_Q(l1))<=4)
                if((QAM_input_Q(l1)<0))
                    QAM_input_Q(l1)=-3;
                    output_frame(6*(l1-1)+2:2:6*(l1-1)+6)=[100];
                else
                    QAM_input_Q(l1)=3;
                    output_frame(6*(l1-1)+2:2:6*(l1-1)+6)=[000];
                end;
            else
                if((QAM_input_Q(l1)<0))
                    QAM_input_Q(l1)=-1;
                    output_frame(6*(l1-1)+2:2:6*(l1-1)+6)=[101];
                else
                    QAM_input_Q(l1)=1;
                    output_frame(6*(l1-1)+2:2:6*(l1-1)+6)=[00

 属性            大小     日期    时间   名称
----------- ---------  ---------- -----  ----

     文件       3124  2010-05-05 09:57  De_64QAM_hard.m

     文件       2929  2010-05-05 09:56  De_64QAM_Soft.m

     文件        691  2010-05-05 09:56  modulate_64QAM.m

----------- ---------  ---------- -----  ----

                 6744                    3


评论

共有 条评论