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

📄 mslotdesegdlrx.m

📁 OFDMA 物理层开发的matlab 源码.飞思卡尔提供.对物理层开发的工程师有帮助!
💻 M
字号:
function [Out,BlkSize] = mSlotDesegDLRX(In,BurstD)
% Downlink Rx slot desegmentation for OFDMA of IEEE 802.16 (WiMAX) 
%
%     [Out,BlkSize] = mSlotDesegDLRX(In,BurstD)
%
% This module de-segmentates all slots of a burst into code blocks dependent
% on the defined burst dimension and FEC coding and modulation type. 
%
% In      : matrix of soft-symbols (bytes, values -128 to 127)
%           one column per slot
% BurstD  : burst descriptor
%
% Out     : output matrix (bytes, values -128 to 127)
%           One column per code block, the number of elements in each column
%           is the maximum code block size for the specified FEC code and
%           modulation type.
% BlkSize : row vector, length = number of code blocks
%           number of soft-symbols for each code block
%
% Matlab 7 Release 14 SP2

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%  Property of Freescale
%  Freescale Confidential Proprietary
%  Freescale Copyright (C) 2005 All rights reserved
%  ----------------------------------------------------------------------------
%  $RCSfile: mSlotDesegDLRX.m.rca $
%  $Revision: 1.2 $
%  $Date: Tue Aug  8 11:41:30 2006 $
%  Target: Matlab
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%

[m,Ns] = size(In);

%check input length
if Ns~=(BurstD.Slots)
   error('Error: Number of input slots do not match the burst profile.');
end
if (m~=(BurstD.ModMode*48))
   error('Error: Number of elements in the slots is not in line with modulation mode.');
end

%number of code blocks (matlab version, including division)
%CodeBlks = ceil(Ns/BurstD.J);
%number of code blocks (efficient C version)
Aux = [32767,16383,10922,8191, 0, 5461];
CodeBlks = bitshift(Ns*Aux(BurstD.J),-15)+1;

%number of slots in each code block
if CodeBlks==1
   NumSlots=Ns;
elseif CodeBlks==2
   temp=bitshift(Ns,-1);
   NumSlots=[Ns-temp,temp];
elseif CodeBlks>2
   partial=Ns-(CodeBlks-2)*BurstD.J;
   temp=bitshift(partial,-1);
   NumSlots=[BurstD.J*ones(1,CodeBlks-2),partial-temp,temp];
end

%allocate and generate output
Out=zeros(m*BurstD.J,CodeBlks,class(In));
slot=1;
for b=1:CodeBlks,
    for s=0:NumSlots(b)-1,
        Out(s*m+(1:m),b) = In(1:m,slot);
        slot=slot+1;
    end
end
BlkSize = NumSlots*m;

⌨️ 快捷键说明

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