📄 mrepslotmapultx.m
字号:
function [SlotVecs] = mRepSlotMapULTX(In,SlotVecs,ZoneD,BurstD)
% Uplink Tx (MS) repetition and slot mapping for OFDMA of IEEE 802.16 (WiMAX)
%
% [SlotVecs] = mRepSlotMapULTX(In,SlotVecs,ZoneD,BurstD)
%
% This module performes the segmentation of the encoded, interleaved and
% modulation mapped data of one burst (In) into slots. For QPSK, the slots
% are repeated according to the repetition factor R. Then, the slots are
% mapped/added to the slot vectors of the zone (SlotVecs).
%
% In : burst input matrix (complex)
% one column per slot, 48 elements per slot
% SlotVecs: input/output matrix that is the IF to FP (complex)
% one column per slot vector, 48*ZoneD.NumSubch rows
% ZoneD : zone descriptor
% BurstD : burst descriptor
%
% Matlab 7 Release 14 SP2
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
% Property of Freescale
% Freescale Confidential Proprietary
% Freescale Copyright (C) 2005 All rights reserved
% ----------------------------------------------------------------------------
% $RCSfile: mRepSlotMapULTX.m.rca $
% $Revision: 1.2 $
% $Date: Tue Aug 8 11:42:49 2006 $
% Target: Matlab
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
[m,n]=size(In);
[r,c]=size(SlotVecs);
if m~=48
error('Error: Slots must contain 48 elements.');
end
%allocated slots
Ns = BurstD.Duration;
%check burst dimension
if mod(BurstD.SymOff,ZoneD.Type)
error('Error: OFDMA symbol offset does not match zone type.');
end
if (BurstD.Duration > (ZoneD.NumSym*(ZoneD.NumSubch-BurstD.SubchOff)-BurstD.SymOff)/ZoneD.Type);
error('Error: Burst size exceeds zone dimension.');
end
if ((n*BurstD.R)~=Ns)
error('Error: Number of provided slots and repetition factor are not in line with burst size.');
end
%check zone dimension
if ((ZoneD.NumSym/ZoneD.Type)~=c)
error('Error: Number of provided slot vectors does not match zone dimension.');
end
if ((ZoneD.NumSubch*48)~=r)
error('Error: Slot vector length does not match zone dimension.');
end
%repetition
temp=In;
for k=1:(BurstD.R-1),
temp=[temp;In];
end
temp=reshape(temp,48,BurstD.Duration);
% Offset to start of burst
OffX1 = BurstD.SymOff/ZoneD.Type; % OFDMA symbol offset
OffY1 = BurstD.SubchOff; % subchannel offset
% Offset to end of burst
OffX2 = mod(OffX1+BurstD.Duration,ZoneD.NumSym/ZoneD.Type);
OffY2 = OffY1+floor((OffX1+BurstD.Duration)/ZoneD.NumSym*ZoneD.Type);
% for each slot calculate the offsets
SlotX=zeros(1,BurstD.Duration); % OFDMA symbol offsets
SlotY=zeros(1,BurstD.Duration); % subchannel offsets
z=1;
for x=0:OffX1-1,
if (x<OffX2)
for y=OffY1+1:OffY2,
SlotX(z)=x;
SlotY(z)=y;
z=z+1;
end
else
for y=OffY1+1:OffY2-1,
SlotX(z)=x;
SlotY(z)=y;
z=z+1;
end
end
end
for x=OffX1:(ZoneD.NumSym/ZoneD.Type)-1,
if (x<OffX2)
for y=OffY1:OffY2,
SlotX(z)=x;
SlotY(z)=y;
z=z+1;
end
else
for y=OffY1:OffY2-1,
SlotX(z)=x;
SlotY(z)=y;
z=z+1;
end
end
end
%place slots into SlotVecs
for k=1:BurstD.Duration,
SlotVecs(SlotY(k)*48+(1:48),SlotX(k)+1)= temp(:,k);
end
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -