Skip to content

Commit

Permalink
Tools: Testbench: add fulltest parameter in process_test
Browse files Browse the repository at this point in the history
fulltest param to control quick chirp test only or full test
including all quality tests.

As minor clean up, unused parameter in thdnf_mask() and test_run_process()
is removed.

Signed-off-by: Fred Oh <[email protected]>
  • Loading branch information
fredoh9 authored and lgirdwood committed Sep 7, 2022
1 parent 7eb9863 commit d9d5842
Showing 1 changed file with 19 additions and 16 deletions.
35 changes: 19 additions & 16 deletions tools/test/audio/process_test.m
Original file line number Diff line number Diff line change
Expand Up @@ -6,25 +6,28 @@
% Copyright(c) 2017-2022 Intel Corporation. All rights reserved.
% Author: Seppo Ingalsuo <[email protected]>

function [n_fail, n_pass, n_na] = process_test(comp, bits_in_list, bits_out_list, fs)

function [n_fail, n_pass, n_na] = process_test(comp, bits_in_list, bits_out_list, fs, fulltest)
%% Defaults for call parameters
if nargin < 1
comp = 'EQIIR';
end

if nargin < 2
bits_in_list = [16 24 32];
bits_in_list = 32;
end

if nargin < 3
bits_out_list = [16 24 32];
bits_out_list = 32;
end

if nargin < 4
fs = 48e3;
end

if nargin < 5
fulltest = 1;
end

%% Paths
t.blobpath = '../../topology/topology1/m4';
plots = 'plots';
Expand All @@ -40,7 +43,7 @@
t.ch = [1 2]; % Test channel 1 and 2
t.bits_in = bits_in_list; % Input word length from func arguments
t.bits_out = bits_out_list; % Output word length from func arguments
t.full_test = 1; % 0 is quick check only, 1 is full set
t.full_test = fulltest; % 0 is quick check only, 1 is full test

%% Show graphics or not. With visible plot windows Octave may freeze if too
% many windows are kept open. As workaround setting close windows to
Expand Down Expand Up @@ -82,9 +85,9 @@

v(1) = chirp_test(t);
if v(1) ~= -1 && t.full_test
[v(2) g] = g_test(t);
[v(3) dr] = dr_test(t);
[v(4) thdnf] = thdnf_test(t);
[v(2), g] = g_test(t);
[v(3), dr] = dr_test(t);
[v(4), thdnf] = thdnf_test(t);
v(5) = fr_test(t);

% TODO: Collect results for all channels, now get worst-case
Expand Down Expand Up @@ -156,7 +159,7 @@
test = chirp_test_input(test);

% Run test
test = test_run_process(test, t);
test = test_run_process(test);

% Analyze
test = chirp_test_analyze(test);
Expand All @@ -178,7 +181,7 @@
test = g_test_input(test);

% Run test
test = test_run_process(test, t);
test = test_run_process(test);

% Measure
test = g_spec(test, t);
Expand All @@ -199,7 +202,7 @@
test = dr_test_input(test);

% Run test
test = test_run_process(test, t);
test = test_run_process(test);

% Measure
test = dr_test_measure(test);
Expand All @@ -219,10 +222,10 @@
test = thdnf_test_input(test);

% Run test
test = test_run_process(test, t);
test = test_run_process(test);

% Measure
test = thdnf_mask(test, t);
test = thdnf_mask(test);
test = thdnf_test_measure(test);

% For EQ use the -20dBFS result and ignore possible -1 dBFS fail
Expand All @@ -243,7 +246,7 @@
test = fr_test_input(test);

% Run test
test = test_run_process(test, t);
test = test_run_process(test);

% Measure
test = fr_mask(test, t);
Expand All @@ -259,7 +262,7 @@
%% ------------------------------------------------------------
%% Helper functions

function test = thdnf_mask(test, prm)
function test = thdnf_mask(test)
min_bits = min(test.bits_in, test.bits_out);
test.thdnf_mask_f = [50 400 test.f_max];
test.thdnf_mask_hi = [-40 -50 -50];
Expand Down Expand Up @@ -352,7 +355,7 @@
test.fr_rp_max_db = 0.5; % Allow 0.5 dB frequency response ripple
end

function test = test_run_process(test, t)
function test = test_run_process(test)
delete_check(1, test.fn_out);
test = test_run(test);
end
Expand Down

0 comments on commit d9d5842

Please sign in to comment.