Skip to content

Commit

Permalink
Tools: Test: Audio: Add to src_test.m option for xt-run
Browse files Browse the repository at this point in the history
This patch adds to src_test.m as optional 8th argument possibility
to launch SRC component tests with xt-run for xtensa binaries.

With this option it's easy to check objective audio quality
parameters for Xtensa implementation of SRC and ASRC components.

Signed-off-by: Seppo Ingalsuo <seppo.ingalsuo@linux.intel.com>
  • Loading branch information
singalsu committed Feb 10, 2025
1 parent f60992f commit cb64e76
Showing 1 changed file with 12 additions and 4 deletions.
16 changes: 12 additions & 4 deletions tools/test/audio/src_test.m
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
function [n_fail, n_pass, n_na] = src_test(bits_in, bits_out, fs_in_list, fs_out_list, full_test, show_plots, comp)
function [n_fail, n_pass, n_na] = src_test(bits_in, bits_out, fs_in_list, fs_out_list, full_test, show_plots, comp, xtrun)

%%
% src_test - test with SRC test bench objective audio quality parameters
%
% src_test(bits_in, bits_out, fs_in, fs_out)
% src_test(bits_in, bits_out, fs_in, fs_out, full_test, show_plots, comp, xtrun)
%
% bits_in - input word length
% bits_out - output word length
Expand All @@ -12,13 +12,17 @@
% full_test - set to 0 for chirp only, 1 for all, default 1
% show_plots - set to 1 to see plots, default 0
% comp - set to 'src' or 'asrc', default 'src'
% xtrun - set to 'xt-run' or 'xt-run --turbo' to test with xt-testbench
%
% E.g.
% src_test(32, 32, 44100, 48000, 1, 1, 'src', 'xt-run --turbo');
%
% A default in-out matrix with 32 bits data is tested if the
% parameters are omitted.
%

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

addpath('std_utils');
Expand Down Expand Up @@ -51,14 +55,16 @@
if nargin < 7
comp = 'src';
end
if nargin < 8
xtrun = '';
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
% Note that AAP and AIP are relaxed a bit from THD+N due to inclusion
% of point Fs/2 to test. The stopband of kaiser FIR is not equiripple
Expand All @@ -80,6 +86,7 @@
t.bits_out = bits_out; % Output word length
t.full_test = full_test; % 0 is quick check only, 1 is full set
t.comp = comp; % Component to test
t.xtrun = xtrun;

%% 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 @@ -450,6 +457,7 @@
test.fs = t.fs1;
test.fs1 = t.fs1;
test.fs2 = t.fs2;
test.xtrun = t.xtrun;
test.coef_bits = 24; % No need to use actual word length in test
test.att_rec_db = 0; % Not used in simulation test
test.quick = 0; % Test speed is no issue in simulation
Expand Down

0 comments on commit cb64e76

Please sign in to comment.