⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 qam16decode_new.m

📁 由4个.m文件组成
💻 M
字号:
%16QAM 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]=QAM16decode_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=[3 -3 1 -1];
    u=xk;
    w1=LLR(u,m);
    if w1>=0
        c1=1;
    else
        c1=0;
    end
    
%decition for the second bit    
    m=[3 -3 1 -1];
    u=yk;
    w2=LLR(u,m);
    if w2>0
        c2=1;
    else
        c2=0;
    end
    
%decition for the third bit    
    m=[3 1 -3 -1];
    u=xk;
    w3=LLR(u,m);
    if w3>=0
        c3=1;
    else
        c3=0;
    end

%decition for the forth bit    
    m=[3 1 -3 -1];
    u=yk;
    w4=LLR(u,m);
    if w4>0
        c4=1;
    else
        c4=0;
    end
    
    qam_sig1=[c1 c2 c3 c4];
    qam_sig=[qam_sig qam_sig1]; 
end

%------Logarithm of Likelihood Ratio (LLR)------
function b=LLR(u,m)
    for n=1:4
        a(n)=exp(-((u+m(n))^2)/2); 
    end
    b=log((a(1)+a(2))/(a(3)+a(4)));

⌨️ 快捷键说明

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