www.pudn.com > ldpc802.16.rar > qamdemod4.m, change:2005-10-26,size:462b


function [data_sym]=qamdemod4(data_in) 
 
map_table=[-0.7071 + 0.7071i  -0.7071 - 0.7071i  0.7071 + 0.7071i  0.7071 - 0.7071i]; 
 
data=reshape(data_in,1,size(data_in,1)*size(data_in,2)); 
for i=1:length(data) 
    metric=1e20; 
    for j=1:4 
        metric1=abs(data(i)-map_table(j)); 
        if (metric1<metric) 
            metric=metric1; 
            data_sym(i)=j-1; 
        end 
    end 
end 
data_sym=reshape(data_sym,size(data_in,1),size(data_in,2));