📄 qam16demod.m
字号:
%16-QAM解调
function [demodata]=qam16demod(ich,qch,para);
d=1/sqrt(10);
for ii=1:para
if ich(ii)>=0
if qch(ii)>=0
if ich(ii)>=2*d
if qch(ii)>=2*d
temp(ii,1)=0;
temp(ii,2)=0;
temp(ii,3)=0;
temp(ii,4)=0;
else
temp(ii,1)=0;
temp(ii,2)=1;
temp(ii,3)=0;
temp(ii,4)=0;
end
else
if qch(ii)>=2*d
temp(ii,1)=0;
temp(ii,2)=0;
temp(ii,3)=0;
temp(ii,4)=1;
else
temp(ii,1)=0;
temp(ii,2)=1;
temp(ii,3)=0;
temp(ii,4)=1;
end
end
else
if ich(ii)>=2*d
if qch(ii)>=-2*d
temp(ii,1)=1;
temp(ii,2)=1;
temp(ii,3)=0;
temp(ii,4)=0;
else
temp(ii,1)=1;
temp(ii,2)=0;
temp(ii,3)=0;
temp(ii,4)=0;
end
else
if qch(ii)>=-2*d
temp(ii,1)=1;
temp(ii,2)=1;
temp(ii,3)=0;
temp(ii,4)=1;
else
temp(ii,1)=1;
temp(ii,2)=0;
temp(ii,3)=0;
temp(ii,4)=1;
end
end
end
else
if qch(ii)>=0
if ich(ii)>=-2*d
if qch(ii)>=2*d
temp(ii,1)=0;
temp(ii,2)=0;
temp(ii,3)=1;
temp(ii,4)=1;
else
temp(ii,1)=0;
temp(ii,2)=1;
temp(ii,3)=1;
temp(ii,4)=1;
end
else
if qch(ii)>=2*d
temp(ii,1)=0;
temp(ii,2)=0;
temp(ii,3)=1;
temp(ii,4)=0;
else
temp(ii,1)=0;
temp(ii,2)=1;
temp(ii,3)=1;
temp(ii,4)=0;
end
end
else
if ich(ii)>=-2*d
if qch(ii)>=-2*d
temp(ii,1)=1;
temp(ii,2)=1;
temp(ii,3)=1;
temp(ii,4)=1;
else
temp(ii,1)=1;
temp(ii,2)=0;
temp(ii,3)=1;
temp(ii,4)=1;
end
else
if qch(ii)>=-2*d
temp(ii,1)=1;
temp(ii,2)=1;
temp(ii,3)=1;
temp(ii,4)=0;
else
temp(ii,1)=1;
temp(ii,2)=0;
temp(ii,3)=1;
temp(ii,4)=0;
end
end
end
end
end
demodata=temp;
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -