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

📄 mgenprbs.m

📁 OFDMA 物理层开发的matlab 源码.飞思卡尔提供.对物理层开发的工程师有帮助!
💻 M
字号:
%***************************************************************************
%  802.16-2004 OFDMA PHY - mGenPRBS  downlink function
%
%    Description: This function generates the PRBS sequence for the
%                 data modulation. The data modulator takes care of the
%                 symbol offset.
%
%    Input:    
%           ZoneConfig: Data Structure that contains zone configuration
%                       params, including number of carriers, number of 
%                       used carriers, maximum number of subchanels, etc. 
%                       For details please see WiMAX Integration Framework 
%                       Specification document
%           AsyncPhyControl:Asynchronous PHY control data structure
%                       contains info such as DlPremableBase IdCell, etc.
%                       
%     Output: 
%           wk:         PRBS sequence ( +/- 1 )
%                       
%    Functions:         N/A
%                 
%    Data Files:        N/A
%                   
%***************************************************************************

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%  Property of Freescale
%  Freescale Confidential Proprietary
%  Freescale Copyright (C) 2005 All rights reserved
%  ----------------------------------------------------------------------------
%  $RCSfile: mGenPRBS.m.rca $
%  $Revision: 1.1 $
%  $Date: Tue Oct  3 06:48:14 2006 $
%  Target: Matlab
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%


function wk = mGenPRBS(ZoneConfig, AsyncPhyControl)

if AsyncPhyControl.SegmentNr<0 | AsyncPhyControl.SegmentNr>2
   error('Error: Segment number must be 0, 1 or 2.');
end

%IDCell evaluation
IDCell  = AsyncPhyControl.IDCell;
IDCellB = bitand(IDCell,[1 2 4 8 16])~=0; %filter and flip five LSBs

%segment number evaluation
SegmentNrInc  = AsyncPhyControl.SegmentNr + 1;
SegmentNrIncB = bitand(SegmentNrInc,[1 2])~=0; %filter and flip two LSBs

%PRBS initial vector 
PRBS = [1 1 1 1 , SegmentNrIncB , IDCellB];

% Generate PRBS sequence for the usefull carriers within symbol
% (including DC and 31 additional carriers to consider the symbol offset)  
for (k=1:ZoneConfig.NFFTUsed+32)
    wk(k,1) = 1 - PRBS(11)*2;
    PRBS  = [bitxor(PRBS(9),PRBS(11)) PRBS(1:10)];
end

⌨️ 快捷键说明

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