Skip to content

Commit b73f584

Browse files
committed
Tools: Test: In src_test.m do quick test without specify in/out rates
If the rates are an empty vector [] the default rates are used. This allows test command "src_test(32, 32, [], [], 0, 0);" to do a quick test without plots with default 8 - 192 kHz in/out matrix. Signed-off-by: Seppo Ingalsuo <seppo.ingalsuo@linux.intel.com>
1 parent f9cf6d7 commit b73f584

File tree

1 file changed

+12
-6
lines changed

1 file changed

+12
-6
lines changed

tools/test/audio/src_test.m

Lines changed: 12 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -7,8 +7,8 @@
77
%
88
% bits_in - input word length
99
% bits_out - output word length
10-
% fs_in - vector of rates in
11-
% fs_out - vector of rates out
10+
% fs_in - vector of rates in, default 8 to 192 kHz
11+
% fs_out - vector of rates out, default 8 to 192 kHz
1212
% full_test - set to 0 for chirp only, 1 for all, default 1
1313
% show_plots - set to 1 to see plots, default 0
1414
%
@@ -27,26 +27,32 @@
2727
mkdir_check('reports');
2828

2929
%% Defaults for call parameters
30+
default_in = [ 8 11.025 12 16 18.9 22.050 24 32 37.8 44.1 48 50 64 88.2 96 176.4 192] * 1e3;
31+
default_out = [ 8 11.025 12 16 22.05 24 32 44.1 48 50 64 88.2 96 176.4 192] * 1e3;
3032
if nargin < 1
3133
bits_in = 32;
3234
end
3335
if nargin < 2
3436
bits_out = 32;
3537
end
3638
if nargin < 3
37-
fs_in_list = [ 8 11.025 12 16 18.9 22.050 24 32 37.8 44.1 48 ...
38-
50 64 88.2 96 176.4 192] * 1e3;
39+
fs_in_list = default_in;
3940
end
4041
if nargin < 4
41-
fs_out_list = [ 8 11.025 12 16 22.05 24 32 44.1 48 ...
42-
50 64 88.2 96 176.4 192] * 1e3;
42+
fs_out_list = default_out;
4343
end
4444
if nargin < 5
4545
full_test = 1;
4646
end
4747
if nargin < 6
4848
show_plots = 0;
4949
end
50+
if isempty(fs_in_list)
51+
fs_in_list = default_in;
52+
end
53+
if isempty(fs_out_list)
54+
fs_out_list = default_out;
55+
end
5056

5157
%% Generic test pass/fail criteria
5258
% Note that AAP and AIP are relaxed a bit from THD+N due to inclusion

0 commit comments

Comments
 (0)