Skip to content

Commit

Permalink
Tools: Test: Audio: Add possibility to test ASRC with src_test.m
Browse files Browse the repository at this point in the history
The same tests can be applied for ASRC in sychronous mode. This
patch allows to pass component name as last argument. Use it
this way:

src_test(32, 32, 44100, 48000, 0, 1, 'asrc');

or

src_test(32, 32, 44100, 48000, 0, 1, 'src');
src_test(32, 32, 44100, 48000, 0, 1);

To run ASRC or SRC. See "help src_test" output for all
test options.

Signed-off-by: Seppo Ingalsuo <seppo.ingalsuo@linux.intel.com>
  • Loading branch information
singalsu authored and lgirdwood committed Nov 3, 2023
1 parent d2fccbd commit 1b9681e
Showing 1 changed file with 8 additions and 2 deletions.
10 changes: 8 additions & 2 deletions tools/test/audio/src_test.m
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
function [n_fail, n_pass, n_na] = src_test(bits_in, bits_out, fs_in_list, fs_out_list, full_test, show_plots)
function [n_fail, n_pass, n_na] = src_test(bits_in, bits_out, fs_in_list, fs_out_list, full_test, show_plots, comp)

%%
% src_test - test with SRC test bench objective audio quality parameters
Expand All @@ -11,6 +11,7 @@
% fs_out - vector of rates out, default 8 to 192 kHz
% 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'
%
% A default in-out matrix with 32 bits data is tested if the
% parameters are omitted.
Expand Down Expand Up @@ -47,13 +48,17 @@
if nargin < 6
show_plots = 0;
end
if nargin < 7
comp = 'src';
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 @@ -74,6 +79,7 @@
t.bits_in = bits_in; % Input word length
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

%% 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 @@ -435,7 +441,7 @@
%%

function test = test_defaults_src(t)
test.comp = 'src';
test.comp = t.comp;
test.fmt = t.fmt;
test.bits_in = t.bits_in;
test.bits_out = t.bits_out;
Expand Down

0 comments on commit 1b9681e

Please sign in to comment.