📄 test_demodmapper.m
字号:
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
% Property of Freescale
% Freescale Confidential Proprietary
% Freescale Copyright (C) 2005 All rights reserved
% ----------------------------------------------------------------------------
% $RCSfile: test_DemodMapper.m.rca $
% Tag $Name: $
% $Revision: 1.2 $
% $Date: Mon Oct 30 18:01:52 2006 $
% Target: Matlab
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%-- Matlab files used by this file
%-- End of list
function status = test_DemodMapper
addpath('../');
addpath('../../../../../../../SP/CM/matlab');
ModuleName = 'DemodMapper';
disp(['Testing MEX ' ModuleName ' ... ']);
%-- General Settings
Q = 15;
%-- Test vectors, 1st col input, 2nd ref, 3rd ModeType
% nota: 1 TV for QPSK, 1 for 16QAM, 1 for 64QAM
TV = { ...
'IF2aaRX.lod' 'IF2RX.lod' '2';
'IF2aaRX.lod' 'IF2RX.lod' '4';
'IF2aaRX.lod' 'IF2RX.lod' '6';
};
%-- Loop over the TV
for i=1:size(TV,1)
ModeType = str2num(TV{i,3});
%-- Load stimuli
if (ModeType == 2)
modename = 'QPSK';
end
if (ModeType == 4)
modename = '16QAM';
end
if (ModeType == 6)
modename = '64QAM';
end
In = mGetBin(['../../vector/in/TCRND' modename '/' TV{i,1} ],'int16','1R1I','b');
Ref = mGetBin(['../../vector/ref/TCRND' modename '/' TV{i,2} ],'int8','R','b');
%-- Call function:
[mOut BlkSize]= DemodMapper(In,length(In),ModeType,'y');
mOut_fixed = int8(mOut); %this might introduce some saturation
%-- Compare
diff = any(double(mOut_fixed)-double(Ref) );
result = ( abs(diff)>1);
if any(result)
disp(['Error: MEX function failed for ' TV{i,1} ]);
else
disp(['OK: MEX function succeeded for ' TV{i,1} ' , not more than 1 unit of difference' ]);
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 + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -