📄 prbs_generator.m
字号:
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
% Property of Freescale
% Freescale Confidential Proprietary
% Freescale Copyright (C) 2005 All rights reserved
% ----------------------------------------------------------------------------
% $RCSfile: PRBS_generator.m.rca $
% $Revision: 1.4 $
% $Date: Mon Oct 30 18:36:32 2006 $
% Target: Matlab
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%
%***************************************************************************
% 802.16-2004 OFDMA PHY - PRBS_generator uplink function
%
% Description: This function generates the PRBS sequence for the
% data modulation. The data modulator takes care of the
% symbol offset.
%
% Input:
% UL_IDCell: Data Structure that contains zone configuration
% seg_num: Segment Number
% symb_offset: Symbol offset from frame start
%
% Nused_PRBS: number of subcarriers used (including DC)
%
% Output:
% PRBS_seq: PRBS sequence ( +/- 1 )
%
% Functions: N/A
%
% Data Files: N/A
%
%***************************************************************************
%-- Matlab files used by this file
%-- End of list
function PRBS_seq = PRBS_generator(UL_IDCell,seg_num,symb_offset,Nused_PRBS)
if seg_num<0 | seg_num>2
error('Error: Segment number must be 0, 1 or 2.');
end
%IDCell evaluation
IDCellB = bitand(UL_IDCell,[1 2 4 8 16])~=0; %filter and flip five LSBs
%segment number evaluation
SegmentNrInc = seg_num + 1;
SegmentNrIncB = bitand(SegmentNrInc,[1 2])~=0; %filter and flip two LSBs
%symbol offset evaluation
Symb_offsetB = bitand(symb_offset,[1 2 4 8])~=0; %filter and flip four LSBs
%PRBS initial vector
PRBS = [Symb_offsetB , SegmentNrIncB , IDCellB];
% Generate PRBS sequence for the usefull carriers within symbol and for 32
% additional carriers (to consider the symbol offset)
for (k=1:Nused_PRBS+32)
PRBS_seq(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 + -