dofuuz / soxr

The SoX resampler library
http://soxr.sourceforge.net/
Other
1 stars 0 forks source link

Fix dithering of 16bit output #1

Closed dofuuz closed 1 year ago

dofuuz commented 1 year ago

For Reproducible Science™

Fix periodic 0s in dithering

https://github.com/dofuuz/python-soxr/issues/11 https://sourceforge.net/p/soxr/discussion/general/thread/5d68180432/

Make 16bit dithering deterministic for reproducibility

https://github.com/dofuuz/python-soxr/issues/10

dofuuz commented 1 year ago

Further thoughts

libsoxr's dithering uses LCG random and its multiplier(1664525) may not be sufficient for 64bit int. Good(and larger) multipliers are available, but it may slow down processing. Related paper: https://arxiv.org/abs/2001.05304

libsoxr uses triangle dither and it may be improved by adding HPF. Implemention of Audacity

Anyway, impact of dithering is not big. So I'll just fix bug and make it deterministic for now.