Tools: Test: In src_test.m do quick test without specify in/out rates

If the rates are an empty vector [] the default rates are used. This
allows test command "src_test(32, 32, [], [], 0, 0);" to do a quick
test without plots with default 8 - 192 kHz in/out matrix.

Signed-off-by: Seppo Ingalsuo <seppo.ingalsuo@linux.intel.com>
This commit is contained in:
Seppo Ingalsuo 2022-11-30 15:16:50 +02:00 committed by Liam Girdwood
parent 082672ea9f
commit f6b8b0e485
1 changed files with 12 additions and 6 deletions

View File

@ -7,8 +7,8 @@ function [n_fail, n_pass, n_na] = src_test(bits_in, bits_out, fs_in_list, fs_out
% %
% bits_in - input word length % bits_in - input word length
% bits_out - output word length % bits_out - output word length
% fs_in - vector of rates in % fs_in - vector of rates in, default 8 to 192 kHz
% fs_out - vector of rates out % fs_out - vector of rates out, default 8 to 192 kHz
% full_test - set to 0 for chirp only, 1 for all, default 1 % full_test - set to 0 for chirp only, 1 for all, default 1
% show_plots - set to 1 to see plots, default 0 % show_plots - set to 1 to see plots, default 0
% %
@ -27,6 +27,8 @@ mkdir_check('plots');
mkdir_check('reports'); mkdir_check('reports');
%% Defaults for call parameters %% Defaults for call parameters
default_in = [ 8 11.025 12 16 18.9 22.050 24 32 37.8 44.1 48 50 64 88.2 96 176.4 192] * 1e3;
default_out = [ 8 11.025 12 16 22.05 24 32 44.1 48 50 64 88.2 96 176.4 192] * 1e3;
if nargin < 1 if nargin < 1
bits_in = 32; bits_in = 32;
end end
@ -34,12 +36,10 @@ if nargin < 2
bits_out = 32; bits_out = 32;
end end
if nargin < 3 if nargin < 3
fs_in_list = [ 8 11.025 12 16 18.9 22.050 24 32 37.8 44.1 48 ... fs_in_list = default_in;
50 64 88.2 96 176.4 192] * 1e3;
end end
if nargin < 4 if nargin < 4
fs_out_list = [ 8 11.025 12 16 22.05 24 32 44.1 48 ... fs_out_list = default_out;
50 64 88.2 96 176.4 192] * 1e3;
end end
if nargin < 5 if nargin < 5
full_test = 1; full_test = 1;
@ -47,6 +47,12 @@ end
if nargin < 6 if nargin < 6
show_plots = 0; show_plots = 0;
end end
if isempty(fs_in_list)
fs_in_list = default_in;
end
if isempty(fs_out_list)
fs_out_list = default_out;
end
%% Generic test pass/fail criteria %% Generic test pass/fail criteria
% Note that AAP and AIP are relaxed a bit from THD+N due to inclusion % Note that AAP and AIP are relaxed a bit from THD+N due to inclusion