⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 mderepslotdemapdlrx.m

📁 OFDMA 物理层开发的matlab 源码.飞思卡尔提供.对物理层开发的工程师有帮助!
💻 M
字号:
function [Slots] = mDerepSlotDemapDLRX(SlotVecs,ZoneD,BurstD)
% Downlink Rx (MS) derepetition and slot demapping for OFDMA of IEEE 802.16 (WiMAX) 
%
%     [Slots] = mDerepSlotDemapDLRX(SlotVecs,ZoneD,BurstD)
%
% This module performs the segmentation of the modulated burst data into
% into slots and combines the repeated slots into one single slot. 
% Note that repetition is only applied for QPSK.
%
% SlotVecs: input/output matrix that is the IF from FP (complex)
%           one column per slot vector, 48*ZoneD.NumSubch rows
% ZoneD   : zone descriptor
% BurstD  : burst descriptor
%
% Out     : burst output matrix (complex)
%           one column per slot, 48 elements per slot
%
% Matlab 7 Release 14 SP2

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%  Property of Freescale
%  Freescale Confidential Proprietary
%  Freescale Copyright (C) 2005 All rights reserved
%  ----------------------------------------------------------------------------
%  $RCSfile: mDerepSlotDemapDLRX.m.rca $
%  $Revision: 1.1 $
%  $Date: Thu Sep 28 04:02:52 2006 $
%  Target: Matlab
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%

[r,c]=size(SlotVecs);

if (BurstD.IUC==254) %distinguish between MAP and "normal" bursts
   %allocated slots
   Ns = BurstD.Duration;
   %check MAP burst dimension
   if (Ns>(ZoneD.NumSym*ZoneD.NumSubch-BurstD.SymOff)/ZoneD.Type-BurstD.SubchOff)
      error('Error: MAP burst does not fit into zone.');
   end
else  
   %allocated slots
   Ns = BurstD.NumSym*BurstD.NumSubch/ZoneD.Type;
   %check burst dimension
   if mod(BurstD.NumSym,ZoneD.Type)
      error('Error: Number of OFDMA symbols does not match zone type.');
   end
   if ((BurstD.NumSym+BurstD.SymOff)>ZoneD.NumSym)
      error('Error: OFDMA symbol dimension exceeds zone limit.');
   end
   if ((BurstD.NumSubch+BurstD.SubchOff)>ZoneD.NumSubch)
      error('Error: Subchannel dimension exceeds zone limit.');
   end
end

if mod(Ns,BurstD.R)
    error('Error: Number of allocated slots is not a multiple of the repetition factor.');
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

%extract burst from SlotVecs matrix
if (BurstD.IUC==254) %distinguish between MAP and "normal" bursts
  %MAP burst
  subch=BurstD.SubchOff;
  timeslot=BurstD.SymOff/ZoneD.Type;
  Slots=zeros(48,Ns,class(SlotVecs));
  for k=1:Ns,
     Slots(:,k)=SlotVecs(subch*48+1:(subch+1)*48,timeslot+1);
     subch=subch+1;
     if subch>=ZoneD.NumSubch
        subch=0;
        timeslot=timeslot+1;
     end
  end
  Slots=reshape(Slots,BurstD.R*48,Ns/BurstD.R); 
else
  %normal burst
  X=BurstD.SymOff/ZoneD.Type+(1:BurstD.NumSym/ZoneD.Type);
  Y=BurstD.SubchOff*48+(1:BurstD.NumSubch*48);
  Slots = SlotVecs(Y,X);
  Slots = reshape(Slots,BurstD.R*48,Ns/BurstD.R);
end

%derepetition
if BurstD.R>1
   %temporarily calculate with double precision
   temp = zeros(48,Ns/BurstD.R);
   for k=0:BurstD.R-1,
       temp(:,:) = temp + double(Slots(k*48+(1:48),:));
   end
   %allocate output matrix of same class as input
   Slots = zeros(48,Ns/BurstD.R,class(SlotVecs));
   Slots(:,:) = temp/BurstD.R;
end

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -