test_modmapper.m

来自「OFDMA 物理层开发的matlab 源码.飞思卡尔提供.对物理层开发的工程师有」· M 代码 · 共 82 行

M
82
字号
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%  Property of Freescale
%  Freescale Confidential Proprietary
%  Freescale Copyright (C) 2005 All rights reserved
%  ----------------------------------------------------------------------------
%  $RCSfile: test_ModMapper.m.rca $
%  Tag $Name:  $
%  $Revision: 1.2 $
%  $Date: Mon Dec 11 15:28:58 2006 $
%  Target: Matlab
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%

%-- Matlab files used by this file
%-- End of list

function status = test_ModMapper

addpath('../');
addpath('../../../../../../../SP/CM/matlab');

ModuleName = 'ModMapper';
disp(['Testing MEX ' ModuleName ' ... ']);

%-- General Settings
Q = 15;

%-- Test vectors, 1st col input, 2nd ref, 3rd ModeType,
%4th resolution, 5th boosting

TV = { ...
    'TC000/IF1gTX_00_00_00_00.lod' 'TC000/IF1hTX_00_00_00_00.lod' '2' '15' '0';
    'TC000/IF1gTX_00_00_01_00.lod' 'TC000/IF1hTX_00_00_01_00.lod' '4' '15' '0';
    'TC000/IF1gTX_00_00_02_00.lod' 'TC000/IF1hTX_00_00_02_00.lod' '6' '15' '0';
    
    };




%-- Loop over the TV
for i=1%1:size(TV,1)

    %-- Load stimuli
    In  = mGetBin(['../../vector/in/'  TV{i,1} ],'int8','R','b');
    Ref = mGetBin(['../../vector/ref/' TV{i,2} ],'int16','1R1I','b');

%     In = repmat(In,1,119); %emulate matrix
%     Ref = repmat(Ref,1,119);
    
    %-- Adjust Data
    In = logical(In);

    %-- Call function:
    Out = ModMapper(In,size(In,1),str2num(TV{i,3}),str2num(TV{i,4}),str2num(TV{i,5}))  ;

    %-- Compare
    diff = any(double(int16(Out))-double(Ref) );
    result = ( abs(diff)>0);
    if any(result)
        disp(['Error: MEX function failed for ' TV{i,1}  ]);
    else
        disp(['OK: MEX function succeeded for ' TV{i,1}  ]);
    end

end


if any([result ])
    disp(['Error: MEX function ' ModuleName ' failed.' ]);
    status = -1 ;
else
    disp(['OK: MEX function ' ModuleName ' succeeded.'  ]);
    status = 1;
end


rmpath('../');
rmpath('../../../../../../../SP/CM/matlab');



⌨️ 快捷键说明

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