📄 qam16demod.m
字号:
function softbit=qam16demod(symbol)
a=sqrt(10);
symlength=length(symbol);
for ii=1:symlength;
if real(symbol(ii))>=0
if imag(symbol(ii))>=0
if real(symbol(ii))>=2*a
if imag(symbol(ii))>=2*a
temp(ii*4)=0;
temp(ii*4-1)==0;
temp(ii*4-2)==0;
temp(ii*4-3)==0;
else
temp(ii*4)=0;
temp(ii*4-1)==1;
temp(ii*4-2)==0;
temp(ii*4-3)==0;
end
else
if imag(symbol(ii))>=2*a
temp(ii*4)=0;
temp(ii*4-1)==0;
temp(ii*4-2)==0;
temp(ii*4-3)==1;
else
temp(ii*4)=0;
temp(ii*4-1)==1;
temp(ii*4-2)==0;
temp(ii*4-3)==1;
end
end
else
if real(symbol(ii))>=2*a
if imag(symbol(ii))>=-2*a
temp(ii*4)=1;
temp(ii*4-1)==1;
temp(ii*4-2)==0;
temp(ii*4-3)==0;
else
temp(ii*4)=1;
temp(ii*4-1)==0;
temp(ii*4-2)==0;
temp(ii*4-3)==0;
end
else
if imag(symbol(ii))>=-2*a
temp(ii*4)=1;
temp(ii*4-1)==1;
temp(ii*4-2)==0;
temp(ii*4-3)==1;
else
temp(ii*4)=1;
temp(ii*4-1)==0;
temp(ii*4-2)==0;
temp(ii*4-3)==1;
end
end
end
else
if imag(symbol(ii))>=0
if real(symbol(ii))>=-2*a
if imag(symbol(ii))>=2*a
temp(ii*4)=0;
temp(ii*4-1)==0;
temp(ii*4-2)==1;
temp(ii*4-3)==1;
else
temp(ii*4)=0;
temp(ii*4-1)==1;
temp(ii*4-2)==1;
temp(ii*4-3)==1;
end
else
if imag(symbol(ii))>=2*a
temp(ii*4)=0;
temp(ii*4-1)==0;
temp(ii*4-2)==1;
temp(ii*4-3)==0;
else
temp(ii*4)=0;
temp(ii*4-1)==1;
temp(ii*4-2)==1;
temp(ii*4-3)==0;
end
end
else
if real(symbol(ii))>=-2*a
if imag(symbol(ii))>=-2*a
temp(ii*4)=1;
temp(ii*4-1)==1;
temp(ii*4-2)==1;
temp(ii*4-3)==1;
else
temp(ii*4)=1;
temp(ii*4-1)==0;
temp(ii*4-2)==1;
temp(ii*4-3)==1;
end
else
if imag(symbol(ii))>=-2*a
temp(ii*4)=1;
temp(ii*4-1)==1;
temp(ii*4-2)==1;
temp(ii*4-3)==0;
else
temp(ii*4)=1;
temp(ii*4-1)==0;
temp(ii*4-2)==1;
temp(ii*4-3)==0;
end
end
end
end
end
softbit=temp;
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -