📄 generateultable.m
字号:
%**************************************************************************
% 802.16-2004 OFDMA PHY - Sub-channel to tile mapper
%
% Description: Maps the sub-channel index to the set of tiles that
% belongs to that sub-channel according to 8.4.6.2
%
% Parameters: subAllocVector: vector of allocated sub-channel numbers
% UL_IDCell: ID cell(5 LSB) used as permutation number
% Nsubcarriers: number of data subcarriers for one
% subchannel (48)
% TilesPerSubchannel: number of tiles in one subchannel(6)
% FFT_size: number of FFT points
%
% Output: dataOVec: matrix of data carrier locations in the middle symbol
% of every slot, that are allocated to each subchannel.
% Each row corresponds to a different sub-channel.
% dataPVec: matrix of data carrier locations in the first/third
% symbol of every slot, that are allocated to each subchannel.
% Each row corresponds to a different sub-channel.
% pilotLocVec: matrix of pilot carrier locations in the first/third
% symbol of every slot, that are allocated to each subchannel.
% Each row corresponds to a different sub-channel.
% rotationOffset: Vector of initial rotation values that are used to rotate
% data symbols before mapping them to data carriers.
%
% Functions:
% N/A
%
% Data Files:
% N/A
%
%***************************************************************************
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
% Property of Freescale
% Freescale Confidential Proprietary
% Freescale Copyright (C) 2005 All rights reserved
% ----------------------------------------------------------------------------
% $RCSfile: GenerateULTable.m.rca $
% $Revision: 1.4 $
% $Date: Mon Dec 11 16:48:12 2006 $
% Target: Matlab
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%-- Matlab files used by this file
%-- End of list
function [dataOVec, dataPVec, pilotLocVec, rotationOffset] = GenerateULTable(subAllocVector,UL_PermBase,Nsubcarriers,TilesPerSubchannel,FFT_size)
% the permutation that determines the mapping of a subchannel to a
% physical set of tiles
switch FFT_size
case 2048
TilePermutation = [6,48,58,57,50,1,13,26,46,44,30,3,27,53,22,18,61,7,55,36,45,37,52,15,40,2,20,4,34,31,10,5,41,9,69,63,21,11,12,19,68,56,43,23,25,39,66,42,16,47,51,8,62,14,33,24,32,17,54,29,67,49,65,35,38,59,64,28,60,0];
case 1024
TilePermutation = [11,19,12,32,33,9,30,7,4,2,13,8,17,23,27,5,15,34,22,14,21,1,0,24,3,26,29,31,20,25,16,10,6,28,18];
case 512
TilePermutation = [11,15,10,2,12,9,8,14,16,4,0,5,13,3,6,7,1];
case 128
TilePermutation = 0:23;
end
% number of tiles in each group (a total of 6 groups of 70 contiguous
% tiles each)
Nsubchannels = length(TilePermutation);
Nused = length(subAllocVector);
tileMatrix = zeros(Nused,TilesPerSubchannel);
% compute tile locations according to 8.4.6.2.2 for each subchannel in
% the segment
% tileMatrix(i,j) is a value between 0 and 419
for i=1:Nused
for j=1:TilesPerSubchannel
% tileMatrix(i,j)= Nsubchannels*(j-1)+mod((TilePermutation(mod((subAllocVector(i)+j-1),Nsubchannels)+1)+UL_IDCell),Nsubchannels);
tileMatrix(i,j)= Nsubchannels*(j-1)+mod((TilePermutation(mod((subAllocVector(i)+j-1),Nsubchannels)+1)+UL_PermBase),Nsubchannels);
end
end
for i=1:Nused
carrierVec = tileMatrix(i,:)*4;
dataOVec(i,:) = sort([carrierVec,carrierVec+1,carrierVec+2,carrierVec+3])+1;
dataPVec(i,:) = sort([carrierVec+1,carrierVec+2])+1;
pilotLocVec(i,:) = sort([carrierVec,carrierVec+3])+1;
% determine the offset at which to map data to carriers
carrierOffset = mod(subAllocVector(i)*13,Nsubcarriers);
% instead of rotating the subcarrier mapping, rotate the data carriers
if (carrierOffset>0)
rotationOffset(i) = Nsubcarriers-carrierOffset+1;
else
rotationOffset(i) = 0;
end
end
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -