From 1b9681e00f5135072ec196119ab34d331593ac68 Mon Sep 17 00:00:00 2001 From: Seppo Ingalsuo Date: Fri, 3 Nov 2023 14:44:54 +0200 Subject: [PATCH] Tools: Test: Audio: Add possibility to test ASRC with src_test.m 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 --- tools/test/audio/src_test.m | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/tools/test/audio/src_test.m b/tools/test/audio/src_test.m index 607fa846ca0d..adcaef88821b 100644 --- a/tools/test/audio/src_test.m +++ b/tools/test/audio/src_test.m @@ -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 @@ -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. @@ -47,6 +48,9 @@ if nargin < 6 show_plots = 0; end +if nargin < 7 + comp = 'src'; +end if isempty(fs_in_list) fs_in_list = default_in; end @@ -54,6 +58,7 @@ 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 @@ -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 @@ -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;