Skip to main content

Notice

Please note that most of the software linked on this forum is likely to be safe to use. If you are unsure, feel free to ask in the relevant topics, or send a private message to an administrator or moderator. To help curb the problems of false positives, or in the event that you do find actual malware, you can contribute through the article linked here.
Topic: Dither Plots (Read 9446 times) previous topic - next topic
0 Members and 1 Guest are viewing this topic.

Dither Plots

Three plots to illustrate the effect of dither.
The signal is a sine sweep that gradually decreases in level from -24dBFS to -144dBFS.
The time axis is also amplitude axis since the level drops exactly 10dB/s.
Example: at 5 seconds the level is -50dBFS, at 11 seconds the level is -110dBFS.

[attachment=5060:DitherPlots.jpg]

Dither Plots

Reply #1
That truncated version is not what I would expect - though it depends how you handle and interpret the DC offset (i.e. which digital value is in the middle), and whether you do truncation or rounding.

Cool Edit Pro seems to round without dither:
[attachment=5061:d_16.jpg]

Obviously you can make it look brighter, darker, sharper etc by changing the FFT settings for the spectrogram, but I think the way yours just stops is indicative of a different kind of rounding.

Cheers,
David.

Dither Plots

Reply #2
Obviously you can make it look brighter, darker, sharper etc by changing the FFT settings for the spectrogram, but I think the way yours just stops is indicative of a different kind of rounding.
Interesting difference. AFAIK the audio applications I use don't use rounding, they just mute any signal that doesn't exceed the LSB level. Intuitively I'd say that this is more correct than what rounding seems to be doing. Imagine a -120dBFS input. Apparently CEP translates this to a -90dBFS tone with distortion products. Wouldn't the "error" be smaller if the 16 bit version was digital silence ?
There was a similar discussion on ProSoundWeb a few months ago. Truncation and rounding seem to be handled differently by various audio applications.

Dither Plots

Reply #3
...but "rounding" is just "truncation with a preceding 1/2 LSB DC offset".

I'm not sure either is better - in this artificial case it's the difference between a quiet signal becoming silence vs a quiet signal becoming distorted - but in real life, you'd never get such quiet signals, and certainly not where both the DC offset and low frequency components were less than -96dB. If either of these are present, then you won't see the same effect anyway.

Your implied RMS error argument holds for a -120dB tone, but not a -100dB tone, where the distorted version is closer to the original than pure silence.

Either way, I'd use dither! (as I know you're recommending in the accompanying thread).

Cheers,
David.

Dither Plots

Reply #4
That truncated version is not what I would expect - though it depends how you handle and interpret the DC offset (i.e. which digital value is in the middle), and whether you do truncation or rounding.

Cool Edit Pro seems to round without dither:
Obviously you can make it look brighter, darker, sharper etc by changing the FFT settings for the spectrogram, but I think the way yours just stops is indicative of a different kind of rounding.

Cheers,
David.

I think if you check "use symmetric dithering" in CEP's settings - even if you don't intend to dither - you should get the same results as Kees. At least that's my experience with Audition. There, rounding is only done correctly when this box is checked.

Chris
If I don't reply to your reply, it means I agree with you.

Dither Plots

Reply #5
AFAIK there's no such setting in CEP 1.2a (which I'm still using!). Maybe it was added in Audition or CEP 2.0?

Cheers,
David.

Dither Plots

Reply #6
AFAIK there's no such setting in CEP 1.2a (which I'm still using!). Maybe it was added in Audition or CEP 2.0?

Cheers,
David.

Probably. In CEP 2.x and Audition 1.x, the setting is accessed by pressing F4. It looks like this:

[attachment=5068:audition_dither.png]

Chris
If I don't reply to your reply, it means I agree with you.

Dither Plots

Reply #7
Yep, that's missing here.

(I have CEP 2.0, but don't use it - old habits die hard!)

Cheers,
David.

Dither Plots

Reply #8
rounding is only done correctly when this box is checked.
Can you tell some more about correct and incorrect rounding ? On the Pro Sound Web forum someone listed a few audio applications that appear to apply the same "wrong?" rounding when truncating (without dither) to 16 bit: Logic 7, Logic 8, Pro Tools 7(native), Peak ProXT 6. I suppose (hope) that the rounding is disabled (or ineffective) when dithering is on.

Dither Plots

Reply #9
rounding is only done correctly when this box is checked.
Can you tell some more about correct and incorrect rounding ? On the Pro Sound Web forum someone listed a few audio applications that appear to apply the same "wrong?" rounding when truncating (without dither) to 16 bit: Logic 7, Logic 8, Pro Tools 7(native), Peak ProXT 6. I suppose (hope) that the rounding is disabled (or ineffective) when dithering is on.


Well, to me, the only correct rounding is the one which rounds to the closest positive or negative integer, i.e. -0.5 becomes -1, 0.5 becomes 1, -0.49 and 0.49 become 0, and so on. The problem with David's plot from CEP 1.2 is that although the amplitude of the tone reaches less than 0.5 LSB (from a 16-bit perspective) around 9 seconds, is is not rounded to zero as in your izotope plot. Instead, either the positive or negative values are set to 1 or -1 LSB, respectively. This is what I get when not checking the above setting in Audition. The low-level tone is still resolved after conversion to 16 bit, but it doesn't decrease to zero amplitude. Apparently, this is due to an offset of -0.5 LSB being added before the rounding operation.

If you're using dither, there should be no audible difference because a random value is added before rounding/truncating, so even for silence, the dithered output would toggle between 0 and +1 or -1. Still, there will be an additional offset of +0.5 or -0.5 LSB in the output signal, which is why I always use the "symmetric dither" option.

Chris
If I don't reply to your reply, it means I agree with you.

Dither Plots

Reply #10
Someone on the Gearslutz forum suggested that the "sticky LSB" problem could be related to denormalization.
I'm not a dsp or cpu expert, so I was wondering if someone here could have a look at that info. It surely looks interesting:
Quote
The problem is caused by certain plugins performing very precise mathematical calculations with very small numbers close to zero (silence). This causes the CPU to go into high precision mode, using up all available processing power. This is known as denormalization. The only fix is for the plugin developers to write additional code which prevents the CPU from going into high precision mode.

I wouldn't expect this to be a problem at 16 bit LSB level, but perhaps it is ?
http://en.wikipedia.org/wiki/Denormal_number
http://phonophunk.com/articles/pentium4-de...zation.php?pg=1

Dither Plots

Reply #11
IIRC min possible value for 32-bit float is 2^-126 (= 1.175494351*10^38). So you should use 127-bit wav files for denormals to appear in them.

 

Dither Plots

Reply #12
Denormals are used for gradual underflow throughout the whole value range (including the +/- 1 range of 32 bit floating point audio).

Anyway, I also don't think it is an issue. On the hardware side denormals don't cause errors and not even perfomance hits for >P4 processors and any software countermeasures (for old hardware) should rather show a sticky 0 than a sticky LSB if anything.

Rounding to nearest vs. truncation or adding/missing offsets at the wrong place is a common source of bugs in software development and the true cause™ very probably isn't anything more mysterious than that. In my opinion C.R.Helmrich hit the nail right on the head already. No need to search for alternative explanations.