www.pudn.com > ldpc802.16.rar > demapping.m, change:2005-11-07,size:2757b


function [data,pilot]=demapping(in,profile,Allocation,SubchanToSubcar) 
 
switch profile.sys 
    case 'mcwill'         
        tone_st=floor((profile.Nfft-profile.Nused)/2); 
        temp=zeros(profile.num*profile.Nf,profile.Nt*profile.n); 
        for k=1:profile.n 
            for i=1:profile.Nt 
                for j=1:profile.num 
                    temp((j-1)*profile.Nf+1:j*profile.Nf,i+(k-1)*profile.Nt)=in(tone_st+SubchanToSubcar{Allocation(1,j+(k-1)*profile.num),Allocation(2,j+(k-1)*profile.num)}+1,i); 
                end 
            end 
        end 
        [tmp1,tmp2]=dearrang(temp);         
    case '80216e' 
        load 80216e_mapping 
        switch profile.link 
            case 'downlink' 
                load 80216e_pilot_downlink 
                index=1:size(SubchannelToSubcarrier,2)/profile.num/profile.n:size(SubchannelToSubcarrier,2); 
                index=ceil(index); 
                subcarrier=sort(SubchannelToSubcarrier(:,index)); 
                tmp1=zeros(48,6*profile.n); 
                for j=1:size(subcarrier,2) 
                    for i=1:size(subcarrier,1) 
                            tmp1(i,(j-1)*6+1:j*6)=in(subcarrier(i,j)+1,:); 
                    end 
                end 
                tmp1=tmp1(:); 
                tmp2=zeros(length(PilotSubcarrier),6); 
                for i=1:length(PilotSubcarrier) 
                    tmp2(i,:)=in(PilotSubcarrier(i)+44,:); 
                end 
                tmp2=tmp2(:); 
            case 'uplink' 
                index=1:size(SubchannelToTile,2)/profile.num/profile.n:size(SubchannelToTile,2); 
                index=ceil(index); 
                tile=SubchannelToTile(:,index); 
                temp=zeros(6*4,6*profile.num*profile.n); 
                for i=1:profile.n 
                    for j=1:profile.num 
                        for k=1:6 
                            subcarrier=TileCarrier{tile(k,(i-1)*profile.num+j)}; 
                            temp((k-1)*4+1:k*4,(i-1)*profile.num*6+(j-1)*6+1:(i-1)*profile.num*6+j*6)=in(subcarrier,:); 
                        end 
                    end 
                end 
                 
                tmp1=0; 
                tmp2=0; 
                for i=1:6*profile.n*profile.num 
                    if (mod(i,6)==2 | mod(i,6)==5) 
                        tmp1=[tmp1;temp(:,i)]; 
                    else 
                        for j=1:6 
                            te=temp((j-1)*4+1:j*4,i); 
                            tmp1=[tmp1;te(2:3)]; 
                            tmp2=[tmp2;te(1);te(end)]; 
                        end 
                    end 
                end 
                tmp1(1)=[]; 
                tmp2(1)=[]; 
        end 
end 
 
data=tmp1; 
pilot=tmp2;