📄 test_dltablegen.m
字号:
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
% Property of Freescale
% Freescale Confidential Proprietary
% Freescale Copyright (C) 2005 All rights reserved
% ----------------------------------------------------------------------------
% $RCSfile: test_DlTableGen.m.rca $
% $Revision: 1.1 $
% $Date: Wed Oct 4 16:11:07 2006 $
% Target: Matlab
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%test DL scrambling table generation for FFT-512
%(one segment, all groups)
TC=input('Which test case number do you want to run? ');
if (~isnumeric(TC) | (TC<0))
disp('Error: Not a valid test case number!')
return;
end
TCstr=sprintf('TC%03d',TC);
CK=input('Do you want to compare test vectors? (y/n)','s');
addpath('../../../../CM/Utilities/matlab/');
%zone descriptor for DL-PUSC (required subset)
ZoneConfig = struct( 'NFFT', 512,...
'MaxSubch', 15,...
'CarrierPerSubch', 24,...
'NCluster', 30 ...
);
%loop over DL permutation base
for pb=0:31,
%asynchronous PHY control structure (required subset)
AsyncPhyControl = struct( 'DlPermBase', pb);
%generate table
DlCarrierMap = mGenDlTable(ZoneConfig, AsyncPhyControl);
%generate test vector
if ~exist(['../vector/ref/',TCstr],'dir')
mkdir(['../vector/ref/',TCstr]);
end
TVname=sprintf('../vector/ref/%s/DLCarrierMap_%02d.lod',TCstr,pb);
mGenBin(DlCarrierMap,TVname,'uint16','R');
if CK=='y'
%Compare with target outputs
type ='uint16';
filename=sprintf('../vector/ref/%s/DLCarrierMap_%02d.lod',TCstr,pb);
fidIn=fopen(filename,'r');
DataRef=fread(fidIn,Inf,type);
filename=sprintf('../vector/out/%s/DLCarrierMap_%02d.lod',TCstr,pb);
fidRef=fopen(filename,'r');
DataIn=fread(fidRef,Inf,type);
fclose(fidIn);
fclose(fidRef);
if any(DataIn-DataRef)
disp(sprintf('Error: DLCarrierMap_%02d.lod file failed.',pb));
else
disp(sprintf('OK: DLCarrierMap_%02d.lod file succeeded.',pb));
Out=mGetBin(filename,type,'R','b');
fid=fopen(sprintf('../vector/ref/%s/DLCarrierMap_%02d.txt',TCstr,pb),'w');
fprintf(fid,'%d\r\n',Out);
fclose(fid);
end
end
end
rmpath('../../../../CM/Utilities/matlab/');
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -