📄 test_fpifft.m
字号:
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
% Property of Freescale
% Freescale Confidential Proprietary
% Freescale Copyright (C) 2005 All rights reserved
% ----------------------------------------------------------------------------
% $RCSfile: test_fpifft.m.rca $
% Tag $Name: $
% $Revision: 1.1 $
% $Date: Fri Oct 27 15:54:14 2006 $
% Target: Matlab
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
function status = test_fpifft
disp('%-- Test of MEX IFFT --%')
%-- Add path for mGetBin.m,dll and test vectors
addpath('../../../../../FP/CM/Utilities/matlab');
addpath('../')
addpath('./vectors_fpifft')
%-- Find here the test vectors used
TVNames = { 'out512_43.bin' 'out512_46.bin' 'out1024_87.bin' 'out1024_92.bin' 'input_ifft1024.bin' ; ...
'out512_43out.bin' 'out512_46out.bin' 'out1024_87out.bin' 'out1024_92out.bin' 'output_ifft1024_up16_ref.bin' };
%-- Scaling used (hex)
Scaling = [hex2dec('00008000'),hex2dec('00008000'),hex2dec('00008000'),hex2dec('00008000'),hex2dec('00008000') ];
%-- Additionnal Scaling (optional parameter)
additionnalScaling = [1 1 1 1 1];
for i=1:size(TVNames,2)
disp(['test vector: ' TVNames{1,i} ])
%-- Get stimuli
Vin= mGetBin(TVNames{1,i},'int16','1R1I');
Vin = double(Vin);
%-- Get ref
ref= mGetBin(TVNames{2,i},'int16','1R1I');
ref=double(ref);
%-- Calling the dll
[ifftVout, scale ] = fpifft(Vin,Scaling(1,i),additionnalScaling(i));
%-- Some Display in Command Window
disp(['Scaling used: ' dec2hex(scale) '.' ])
diff_ifft=(ifftVout-ref);%./max(fftVout,Vin);
s(i)=sum(diff_ifft);
[Sifftr(i),Imax]=max(abs(real(diff_ifft)));
disp([' => max absolute real difference between mex ifft(Vin) and ref: ' int2str(Sifftr(i)) '.' ])
disp([' ifftVout(' int2str(Imax) ')=' int2str(ifftVout(Imax)) ' and' ...
'ref(' int2str(Imax) ')=' int2str(ref(Imax)) ])
[Siffti(i),Imax]=max(abs(imag(diff_ifft)));
disp([' => max absolute imag difference between mex fft(Vin) and ref: ' int2str(Siffti(i)) '.' ])
disp([' ifftVout(' int2str(Imax) ')=' int2str(ifftVout(Imax)) ' and' ...
'ref(' int2str(Imax) ')=' int2str(ref(Imax)) ])
disp([' ']);
end
disp(' ***************************');
if sum(s)==0
disp([' *** TEST FPIFFT PASSED ***' ])
status =1 ;
else
disp([' *** TEST FPIFFT FAILLED ***' ])
status = -1 ;
end
disp(' ***************************');
disp('%-- End of Test of MEX IFFT --%')
%-- Remove paths
rmpath('../../../../../FP/CM/Utilities/matlab');
rmpath('../')
rmpath('./vectors_fpifft')
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -