-
-
Notifications
You must be signed in to change notification settings - Fork 1.2k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Recording: Add dither when using fixed point samples #8679
Comments
Commented by: JosepMaJAZ I contacted the author and he said that the code has never been finished, so that's why it isn't documented I believe the intention was to have different dither models, not only white noise, and probably that's why it is unfinished. |
Commented by: daschuer How useful is the current state? What is missing to use it for Mixxx? It would be a pity, if we have to add our own dithering inside Mixxx which also stops us from using the sndfile integrated sample conversion routines. |
Commented by: JosepMaJAZ Completely unimplemented, it seems:
|
Commented by: daschuer Thank you for the update. Now we have two options to fix the bug, In both cases we can use the portaudio dither code, since the license is compatible. It could be fun to contribute a improved version to both upstream projects. |
Commented by: Be-ing Are there any other libraries that could be used for this? Maybe SoX? http://sox.sourceforge.net/SoX/NoiseShaping |
Commented by: daschuer The relevant sox code is here: Noise shaping would be a nice, but it requires significant more CPU, so it should be optional. libav / ffmpeg has also a dither solution: This is the Portaudio Implementation: |
Commented by: Be-ing "Noise shaping would be a nice, but it requires significant more CPU, so it should be optional." This is for recording purposes, correct? If so, this doesn't have to be a real time process does it? |
Commented by: JosepMaJAZ It is a real time process. You record while you mix. This can be used to listen to it later (learn or share) as well as keeping a record of a live mix that you realize. I'm not sure if the process itself should be too complex. Of course, there are different ways to dither with noise shape, but basically, the concepts are: dither: add uncorrelated noise to the signal, so that when the bits of the signal are truncated, it does not generate correlated distortion (in form of frequencies correlated with the sound). noise shaping: a technique in which white noise is modified in such a way that its frequency representation gets a different shape than flat line. Given the human ear, the shape commonly used is similar to an increasing line (i.e. lower power in the lower frequencies and higher power in the higher frequencies). Usually, software use Triangular-PDF (the type of noise shaping) dither. Said that, I don't know the exact details of this technique. |
Commented by: daschuer Triangular-PDF is just the type of noise which is added for dither, to replace the quantization noise. Noise shaping: Like shown here: This is implemented in https://sourceforge.net/p/sox/code/ci/master/tree/src/dither.h |
Reported by: daschuer
Date: 2016-11-05T20:11:45Z
Status: Confirmed
Importance: Low
Launchpad Issue: lp1639499
Tags: portaudio, recording
Dither is required to replace quantization noise with less notable random noise when converting floating point samples into fixed point samples.
This should be done when recording as well.
libsndfile can dither the signal when required, but it is disabled by default.
Unfortunately it is an undocumented feature. The test code can be found here:
https://github.com/erikd/libsndfile/blob/2fcf531ac940829cf350f86786fcff5160a32143/tests/dither_test.c#L157
The text was updated successfully, but these errors were encountered: