www.pudn.com > RS_BCM_255_223_4[1].Matlab.rar > soft_decision.m, change:2007-04-16,size:544b


function out= soft_decision(in) 
%用于对8PSK解调的软判决,8*10电平,量化值介于0到7 
n=length(in); 
x=real(in); 
y=imag(in); 
out=zeros(1,n); 
sita=zeros(1,n); 
tangent=y./x; 
arctangent=atan(tangent); 
for i=1:n 
    if (x(i)>=0)&(y(i)>=0) 
        sita(i)=arctangent(i)*180/pi; 
    elseif (x(i)>0)&(y(i)<0) 
        sita(i)=arctangent(i)*180/pi+360; 
    elseif (x(i)<0)&(y(i)>=0) 
        sita(i)=arctangent(i)*180/pi+180; 
    elseif (x(i)<=0)&(y(i)<0) 
        sita(i)=arctangent(i)*180/pi+180; 
    end 
end 
out=(floor(sita./4.5+0.5))./10;