From 29502464156edd848b802ebab769d96ae0a22ba7 Mon Sep 17 00:00:00 2001 From: Seppo Ingalsuo Date: Fri, 6 Sep 2024 17:14:55 +0300 Subject: [PATCH] Tools: Test: Audio: Add to process_test.m option to show plots 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 --- tools/test/audio/process_test.m | 28 ++++++++++++++++++++++------ 1 file changed, 22 insertions(+), 6 deletions(-) diff --git a/tools/test/audio/process_test.m b/tools/test/audio/process_test.m index 1e1ef7511..4b90a2908 100644 --- a/tools/test/audio/process_test.m +++ b/tools/test/audio/process_test.m @@ -1,6 +1,6 @@ % 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 @@ -8,17 +8,19 @@ % 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 -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'; @@ -41,6 +43,10 @@ function [n_fail, n_pass, n_na] = process_test(comp, bits_in_list, bits_out_lis end if nargin < 6 + show_plots = 0; + end + + if nargin < 7 xtrun = ''; end @@ -68,9 +74,19 @@ function [n_fail, n_pass, n_na] = process_test(comp, bits_in_list, bits_out_lis % 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);