16qamdemod.asv

来自「自己编写的简单易懂的OFDM通信系统仿真程序」· ASV 代码 · 共 82 行

ASV
82
字号
%16-QAM解调
function [demodata]=16qamdemod(ich,qch,para);
 d=1/sqrt(10);
 
 for ii=1:para
     if ich>=0
         if qch>=0
             if ich>=2*d
                 if qch>=2*d
                     temp(ii,4)=0;
                     temp(ii,3)=0;
                     temp(ii,2)=0;
                     temp(ii,1)=0;
                 else
                      temp(ii,4)=0;
                     temp(ii,3)=1;
                     temp(ii,2)=0;
                     temp(ii,1)=0;
                 end
             else
                 if qch>=2*d
                     temp(ii,4)=0;
                     temp(ii,3)=0;
                     temp(ii,2)=0;
                     temp(ii,1)=1;
                 else
                     
                     temp(ii,4)=0;
                     temp(ii,3)=1;
                     temp(ii,2)=0;
                     temp(ii,1)=1;
                 end
             end
         else
             if ich>=2*d
                 if qch>=-2*d
                     temp(ii,4)=1;
                     temp(ii,3)=1;
                     temp(ii,2)=0;
                     temp(ii,1)=0;
                 else
                     temp(ii,4)=1;
                     temp(ii,3)=0;
                     temp(ii,2)=0;
                     temp(ii,1)=0;
                 end
             else
                 if qch>=-2*d
                      temp(ii,4)=1;
                     temp(ii,3)=1;
                     temp(ii,2)=0;
                     temp(ii,1)=1;
                 else
                      temp(ii,4)=1;
                     temp(ii,3)=0;
                     temp(ii,2)=0;
                     temp(ii,1)=1;
                 end
             end
         end
     else
         if qch>=0
             if ich<=-2*d
                 if qch>=2*d
                     temp(ii,4)=0;
                     temp(ii,3)=0;
                     temp(ii,2)=1;
                     temp(ii,1)=1;
                 else
                     temp(ii,4)=0;
                     temp(ii,3)=1;
                     temp(ii,2)=1;
                     temp(ii,1)=1;
                 end
             else
                 if qch>=2*d
                     
                
                     
                     
                     
                     

⌨️ 快捷键说明

复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?