mirror of https://github.com/thesofproject/sof.git
Tools: Test: Audio: Replace the gaussian dither with triangular
The gaussian (or other normal distribution shape) dither impacts too much 16 bit signals. The triangular probability density function (TDPF) is a sufficient compromise between added noise energy and de-correlation of PCM samples. This change improves for 48 kHz 16 bit audio measurement the THD+N from -62.6 dB to -73.6 dB. Signed-off-by: Seppo Ingalsuo <seppo.ingalsuo@linux.intel.com>
This commit is contained in:
parent
044d0b208d
commit
5471357792
|
@ -51,8 +51,7 @@ sx = size(x);
|
||||||
nx = sx(1);
|
nx = sx(1);
|
||||||
nch = sx(2);
|
nch = sx(2);
|
||||||
|
|
||||||
xq = int32(floor( scale*x + randn(nx,nch) - randn(nx,nch) -0.5)); % TPDF dither
|
xq = int32(round(scale * x + rand(nx,nch) + rand(nx, nch) - 1)); % TPDF dither
|
||||||
%xq = int32(round( scale*x )); % Omit dither
|
|
||||||
idx = find(xq > smax);
|
idx = find(xq > smax);
|
||||||
xq(idx) = smax;
|
xq(idx) = smax;
|
||||||
idx = find(xq < smin);
|
idx = find(xq < smin);
|
||||||
|
|
Loading…
Reference in New Issue