revsymqam16.m

来自「正交频分复用系统(OFDM)的频率偏移误差抑制技术仿真程序」· M 代码 · 共 46 行

M
46
字号
function outlev=revsymQAM16(synconst)
%------------------------------------------------
%this function takes in a symbol from the
% 16 possible symbols in a 16 QAM Gray coded
% constellation and outputs a voltage level
%this is the reverse of
%function QAM16
%Author: 王博
%Filename: revsymQAM16.m
%----------------------------------------------

d=1;

if synconst==-1*d+-1*i*d;
outlev=-15;           %x==[0 0 0 0]
elseif  synconst==-1*d+-3*i*d;
outlev=-13;           %x==[0 0 0 1]
elseif  synconst==-3*d+-1*i*d;
outlev=-11;           %x==[0 0 1 0]
elseif  synconst==-3*d+-3*i*d;
outlev=-9;           %x==[0 0 1 1]
elseif  synconst==d+-1*i*d;
outlev=-7;           %x==[0 1 0 0]
elseif  synconst==d+-3*i*d;
outlev=-5;           %x==[0 1 0 1]
elseif  synconst==3*d+-1*i*d;
outlev=-3;           %x==[0 1 1 0]
elseif  synconst==3*d+-3*i*d;
outlev=-1;           %x==[0 1 1 1]
elseif  synconst==-1*d+i*d;
outlev=1;           %x==[10 0 0]
elseif  synconst==-1*d+3*i*d;
outlev=3;           %x==[1 0 0 1]
elseif  synconst==-3*d+i*d;
outlev=5;           %x==[1 0 1 0]
elseif  synconst==-3*d+3*i*d;
outlev=7;           %x==[1 0 1 1]
elseif  synconst==d+i*d;
outlev=9;           %x==[1 1 0 0]
elseif  synconst==3*d+i*d;
outlev=11;           %x==[1 1 0 1]
elseif  synconst==d+3*i*d;
outlev=13;           %x==[1 1 1 0]
else    outlev=15;           %x==[1 1 1 1]
end

⌨️ 快捷键说明

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