Skip to content

Commit

Permalink
Tools: Test: Audio: Add to process_test.m option to show plots
Browse files Browse the repository at this point in the history
This change replaces 6th argument with show_plots. If it is
set to 1, the plots are not hidden. If set to 2, also the
temporary sound files are not deleted that is useful for
debugging.

Signed-off-by: Seppo Ingalsuo <seppo.ingalsuo@linux.intel.com>
  • Loading branch information
singalsu committed Sep 6, 2024
1 parent 3cafcd4 commit 670457c
Showing 1 changed file with 22 additions and 6 deletions.
28 changes: 22 additions & 6 deletions tools/test/audio/process_test.m
Original file line number Diff line number Diff line change
@@ -1,24 +1,26 @@
% process_test - test objective audio quality parameters
%
% process_test(comp, bits_in_list, bits_out_list, fs, fulltest, xtrun)
% process_test(comp, bits_in_list, bits_out_list, fs, fulltest, show_plots, xtrun)
%
% Inputs
% comp - component to test
% bits_in_list - input word lengths
% bits_out_list - output workd lengths
% fs - sample rate
% fulltest - 0 perform only chirp test, 1 perform all
% show_plots - use 1 to show, defaults to hidden with 0
% with value 2 also temporary sound files are preserved
% xtrun - set to 'xt-run' or 'xt-run --turbo' to test with xt-testbench
%
% E.g.
% process_test('eq-iir', 32, 32, 48000, 0, 'xt-run --turbo');
% process_test('eq-iir', 32, 32, 48000, 0, 0, 'xt-run --turbo');
% process_test('eq-iir', 32, 32);

% SPDX-License-Identifier: BSD-3-Clause
% Copyright(c) 2017-2022 Intel Corporation. All rights reserved.
% Author: Seppo Ingalsuo <seppo.ingalsuo@linux.intel.com>

function [n_fail, n_pass, n_na] = process_test(comp, bits_in_list, bits_out_list, fs, fulltest, xtrun)
function [n_fail, n_pass, n_na] = process_test(comp, bits_in_list, bits_out_list, fs, fulltest, show_plots, xtrun)
%% Defaults for call parameters
if nargin < 1
comp = 'EQIIR';
Expand All @@ -41,6 +43,10 @@
end

if nargin < 6
show_plots = 0;
end

if nargin < 7
xtrun = '';
end

Expand Down Expand Up @@ -68,9 +74,19 @@
% visibility set to 0 only console text is seen. The plots are
% exported into plots directory in png format and can be viewed from
% there.
t.plot_close_windows = 1; % Workaround for visible windows if Octave hangs
t.plot_visible = 'off'; % Use off for batch tests and on for interactive
t.files_delete = 1; % Set to 0 to inspect the audio data files
if show_plots > 0
t.plot_close_windows = 0; % Workaround for visible windows if Octave hangs
t.plot_visible = 'on'; % Use off for batch tests and on for interactive
else
t.plot_close_windows = 1;
t.plot_visible = 'off';
end

if show_plots > 1
t.files_delete = 0; % Set to 0 to inspect the audio data files
else
t.files_delete = 1;
end

%% Prepare
process_test_paths(true);
Expand Down

0 comments on commit 670457c

Please sign in to comment.