📄 qam64decode_new.m
字号:
%64QAM demodulation
%use the way of Logarithm of Likelihood Ratio (LLR)
%revSymbol is the symbol to be decisioned
%revSymbol is a line vector
%qam_sig is the decisioned complex QAM signal
%suppose that rho=1;
function [qam_sig]=QAM64decode_new(revSymbol)
qam_sig=[];
k=length(revSymbol);
for i1=1:k,
xk=real(revSymbol(i1));
yk=imag(revSymbol(i1));
%decition for the first bit
m=[-1 -3 -5 -7 1 3 5 7];
u=xk;
w1=LLR(u,m);
if w1>=0
c1=1;
else
c1=0;
end
%decition for the second bit
m=[3 1 -1 -3 7 5 -5 -7];
u=xk;
w2=LLR(u,m);
if w2>0
c2=1;
else
c2=0;
end
%decition for the third bit
m=[5 3 -3 -5 7 1 -1 -7];
u=xk;
w3=LLR(u,m);
if w3>=0
c3=1;
else
c3=0;
end
%decition for the forth bit
m=[-7 -5 -3 -1 7 5 3 1];
u=yk;
w4=LLR(u,m);
if w4>0
c4=1;
else
c4=0;
end
%decition for the fifth bit
m=[-3 -1 1 3 -7 -5 5 7];
u=yk;
w5=LLR(u,m);
if w5>0
c5=1;
else
c5=0;
end
%decition for the sixth bit
m=[-5 -3 3 5 -7 -1 1 7];
u=yk;
w6=LLR(u,m);
if w6>0
c6=1;
else
c6=0;
end
qam_sig1=[c1 c2 c3 c4 c5 c6];
qam_sig=[qam_sig qam_sig1];
end
%------Logarithm of Likelihood Ratio (LLR)------
function b=LLR(u,m)
for n=1:8
a(n)=exp(-((u+m(n))^2)/2);
end
b=log((a(1)+a(2)+a(3)+a(4))/(a(5)+a(6)+a(7)+a(8)));
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -