mirror of https://github.com/thesofproject/sof.git
Testbench: Update SRC tests criteria for lower 16 bit quality data
The tests created lot of unnecessary fails when testing with S16_LE format. The test pass criteria for THD+N, DR is relaxed for tests with 16 bit data. Since the gain of SRC conversions was lowered to -1 dB the test case for gain need to be updated. The gain is retrieved from src_param() function. An exception is added for FS1 == FS2 case when data is passed through. In that case expected gain is 0 dB. The frequency response measurement grid does not necessarily cover the exact upper frequency of pass-band. Therefore the min. upper passband frequency is scaled by 0.99. This avoids measurement technique related fails in test. The chirp spectra test case was updated to use for RMS level criteria for testing the level of signal. The peak level was less robust and caused unnecessary test fails. The option to not open plot windows during test is set. It improves speed of test and avoids display clutter. Signed-off-by: Seppo Ingalsuo <seppo.ingalsuo@linux.intel.com>
This commit is contained in:
parent
dea1f82b2a
commit
31e67a227c
|
@ -72,7 +72,9 @@ end
|
|||
% meet THD+N requirement.
|
||||
t.g_db_tol = 0.1;
|
||||
t.thdnf_db_max = -80;
|
||||
t.thdnf_db_16b = -60;
|
||||
t.dr_db_min = 100;
|
||||
t.dr_db_16b = 79;
|
||||
t.aap_db_max = -60;
|
||||
t.aip_db_max = -60;
|
||||
|
||||
|
@ -90,7 +92,7 @@ t.full_test = 1; % 0 is quick check only, 1 is full set
|
|||
% visibility set to to 0 only console text is seen. The plots are
|
||||
% exported into plots directory in png format and can be viewed from
|
||||
% there.
|
||||
t.close_plot_windows = 0; % Workaround for visible windows if Octave hangs
|
||||
t.close_plot_windows = 1; % Workaround for visible windows if Octave hangs
|
||||
t.visible = 'off'; % Use off for batch tests and on for interactive
|
||||
t.delete = 1; % Set to 0 to inspect the audio data files
|
||||
|
||||
|
@ -214,7 +216,11 @@ test = test_defaults_src(t);
|
|||
prm = src_param(t.fs1, t.fs2, test.coef_bits);
|
||||
test.fu = prm.c_pb*min(t.fs1,t.fs2);
|
||||
test.g_db_tol = t.g_db_tol;
|
||||
test.g_db_expect = 0;
|
||||
if test.fs1 == test.fs2
|
||||
test.g_db_expect = 0;
|
||||
else
|
||||
test.g_db_expect = prm.gain;
|
||||
end
|
||||
|
||||
%% Create input file
|
||||
test = g_test_input(test);
|
||||
|
@ -242,8 +248,8 @@ prm = src_param(t.fs1, t.fs2, test.coef_bits);
|
|||
|
||||
test.rp_max = prm.rp_tot; % Max. ripple +/- dB allowed
|
||||
test.f_lo = 20; % For response reporting, measure from 20 Hz
|
||||
test.f_hi = min(t.fs1,t.fs2)*prm.c_pb; % to designed filter upper frequency
|
||||
test.f_max = min(t.fs1/2, t.fs2/2); % Measure up to Nyquist frequency
|
||||
test.f_hi = 0.99 * min(t.fs1,t.fs2)*prm.c_pb; % to designed filter upper frequency
|
||||
test.f_max = 0.99 * min(t.fs1/2, t.fs2/2); % Measure up to Nyquist frequency
|
||||
|
||||
%% Create input file
|
||||
test = fr_test_input(test);
|
||||
|
@ -271,6 +277,11 @@ function [fail, thdnf] = thdnf_test(t)
|
|||
|
||||
%% Reference: AES17 6.3.2 THD+N ratio vs. frequency
|
||||
test = test_defaults_src(t);
|
||||
if test.bits_in > 16
|
||||
test.thdnf_max = t.thdnf_db_max;
|
||||
else
|
||||
test.thdnf_max = t.thdnf_db_16b;
|
||||
end
|
||||
|
||||
prm = src_param(t.fs1, t.fs2, test.coef_bits);
|
||||
test.f_start = 20;
|
||||
|
@ -287,7 +298,6 @@ test = test_run_src(test, t);
|
|||
|
||||
%% Measure
|
||||
test.fs = t.fs2;
|
||||
test.thdnf_max = t.thdnf_db_max;
|
||||
test = thdnf_test_measure(test);
|
||||
thdnf = max(max(test.thdnf));
|
||||
fail = test.fail;
|
||||
|
@ -303,7 +313,11 @@ function [fail, dr_db] = dr_test(t)
|
|||
|
||||
%% Reference: AES17 6.4.1 Dynamic range
|
||||
test = test_defaults_src(t);
|
||||
test.dr_db_min = t.dr_db_min;
|
||||
if test.bits_in > 16
|
||||
test.dr_db_min = t.dr_db_min;
|
||||
else
|
||||
test.dr_db_min = t.dr_db_16b;
|
||||
end
|
||||
|
||||
%% Create input file
|
||||
test = dr_test_input(test);
|
||||
|
|
|
@ -53,7 +53,7 @@ tz = sz(1)/test.fs;
|
|||
et = abs(test.cl-tz)/test.cl;
|
||||
rms_db = 10*log10(mean(z.^2)) + 20*log10(sqrt(2));
|
||||
offs_db = 20*log10(abs(mean(z)));
|
||||
sum_max_db = 20*log10(max(abs(s)));
|
||||
sum_rms_db = 10*log10(mean(s.^2))
|
||||
% Check for proper ratio of out/in samples, minimum level, maximum offset
|
||||
% and maximum of sum of channels. The input is such that the channels should
|
||||
% sum to zero. A phase difference in channels would cause non-zero output
|
||||
|
@ -68,7 +68,7 @@ else if (min(rms_db) < -3) && (test.fs2 + 1 > test.fs1)
|
|||
else if max(offs_db) > -40
|
||||
fail = 1;
|
||||
fprintf('Failed output chirp DC offset.\n');
|
||||
else if (sum_max_db > -100) && (mod(test.nch, 2) == 0)
|
||||
else if (sum_rms_db > -80) && (mod(test.nch, 2) == 0)
|
||||
fail = 1;
|
||||
fprintf('Failed output chirp channels phase.\n');
|
||||
else
|
||||
|
|
Loading…
Reference in New Issue