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


function [out]=mapping(data,pilot,profile,Allocation,SubchanToSubcar) 
 
switch profile.sys 
    case 'mcwill' 
        tone_st=floor((profile.Nfft-profile.Nused)/2); 
        data=reshape(data,profile.num*profile.Nf,size(data,1)*size(data,2)/profile.num/profile.Nf); 
        pilot=reshape(pilot,profile.num*profile.Nf,size(pilot,1)*size(pilot,2)/profile.num/profile.Nf); 
        temp=arrange(data,pilot); 
        tmp=zeros(profile.Nfft,profile.Nt); 
        for k=1:profile.n 
            for i=1:profile.Nt 
                for j=1:profile.num 
                    tmp(tone_st+SubchanToSubcar{Allocation(1,j+(k-1)*profile.num),Allocation(2,j+(k-1)*profile.num)}+1,i)=temp((j-1)*profile.Nf+1:j*profile.Nf,i+(k-1)*profile.Nt); 
                end 
            end 
        end 
    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)); 
                data=reshape(data,48,size(data,1)*size(data,2)/48); 
                tmp=zeros(512,6); 
                for j=1:size(subcarrier,2) 
                    for i=1:size(subcarrier,1) 
                        tmp(subcarrier(i,j)+1,:)=data(i,(j-1)*6+1:j*6); 
                    end 
                end 
                pilot=reshape(pilot,length(PilotSubcarrier),length(pilot)/length(PilotSubcarrier)); 
                for i=1:length(PilotSubcarrier) 
                    tmp(PilotSubcarrier(i)+44,:)=pilot(i,1:6); 
                end 
            case 'uplink' 
                index=1:size(SubchannelToTile,2)/profile.num/profile.n:size(SubchannelToTile,2); 
                index=ceil(index); 
                tile=SubchannelToTile(:,index); 
                tmp=zeros(512,6); 
                temp=zeros(6*4,6*profile.num*profile.n); 
                for i=1:6*profile.num*profile.n 
                    if (mod(i,6)==2) | (mod(i,6)==5) 
                        temp(:,i)=data(1:4*6); 
                        data(1:4*6)=[]; 
                    else 
                        for j=1:6 
                            temp((j-1)*4+1:j*4,i)=[pilot(1),data(1:2),pilot(2)]; 
                            pilot(1:2)=[]; 
                            data(1:2)=[]; 
                        end 
                    end 
                end 
                 
                for i=1:profile.n 
                    for j=1:profile.num 
                        for k=1:6 
                            subcarrier=TileCarrier{tile(k,(i-1)*profile.num+j)}; 
                            tmp(subcarrier,:)=temp((k-1)*4+1:k*4,(i-1)*profile.num*6+(j-1)*6+1:(i-1)*profile.num*6+j*6); 
                        end 
                    end 
                end 
                 
        end 
end 
 
out=tmp;