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 during playback (Read 7855 times) previous topic - next topic
0 Members and 1 Guest are viewing this topic.

Dither during playback

I completly understand the concept of dithering when used during CD mastering. I.e. when converting from 24-bit to 16-bits. But I do not understand why dither should be used while playing back digital music. Does it make the final analog waveform more smooth?

Dither during playback

Reply #1
If you understand why it's needed when going from 24 to 16 bits, then there is no problem - the reason to use it in playback is *exactly* the same (going from 64 or 32 bits to 24 or 16 bits).

Dither during playback

Reply #2
You should apply dither every time you requantize the data.

If you do that somewhere on playback, well, then, you need to dither.

If not, you don't.
-----
J. D. (jj) Johnston

Dither during playback

Reply #3
Quote
You should apply dither every time you requantize the data.
[a href="index.php?act=findpost&pid=315863"][{POST_SNAPBACK}][/a]


Even while encoding to <pick one out of MP3, AAC, Vorbis, WMA> ?

/me trying to give a thought-provoking impulse


Sebi

Dither during playback

Reply #4
If you wish to have the original encoded signal to the greatest precision, dither is your best bet. decoding in 64bits floating point, say, and dither to 16, will give you practically the same shape as the originally decoded signal, therefore as close to the source as possible... AFAIK

Dither during playback

Reply #5
If you're encoding, and your original source is 16 bit, it would be as useless to dither up to 24 bits to encode as resampling an image to increase its detail.  Completely pointless.

Dither during playback

Reply #6
Quote
,Jul 25 2005, 09:25 PM]If you're encoding, and your original source is 16 bit, it would be as useless to dither up to 24 bits to encode as resampling an image to increase its detail.  Completely pointless.
[a href="index.php?act=findpost&pid=315900"][{POST_SNAPBACK}][/a]


Sure.
But those encoders DO (re)quantize. I was trying to refer to that quantizing step in encoders.

Sebi

Dither during playback

Reply #7
Quote
Quote
,Jul 25 2005, 09:25 PM]If you're encoding, and your original source is 16 bit, it would be as useless to dither up to 24 bits to encode as resampling an image to increase its detail.  Completely pointless.
[a href="index.php?act=findpost&pid=315900"][{POST_SNAPBACK}][/a]


Sure.
But those encoders DO (re)quantize. I was trying to refer to that quantizing step in encoders.

Sebi
[a href="index.php?act=findpost&pid=315902"][{POST_SNAPBACK}][/a]


Interesting point. One typically requantizes to a much lower precision than the original data, so would dithering help there? And now try to involve the masking curve. Perceptual dithering, anyone?

Dither during playback

Reply #8
I am confused all the more now. Why would you encode or requantize stuff during playback? We are talking about dithering during playback which is essentially a D/A conversion.

Dither during playback

Reply #9
Perhaps because lossy encoders tend to use floating point values IIRC? Dither would also be useful when using ReplayGain.
Acid8000 aka. PhilDEE

Dither during playback

Reply #10
Quote
Perhaps because lossy encoders tend to use floating point values IIRC? Dither would also be useful when using ReplayGain.
[a href="index.php?act=findpost&pid=315992"][{POST_SNAPBACK}][/a]

Since FP is used, and encoders can't really encode FP, you'll have to decode, before re-encoding. Therefore dithering will be useful.

Dither during playback

Reply #11
Quote
Quote
You should apply dither every time you requantize the data.
[a href="index.php?act=findpost&pid=315863"][{POST_SNAPBACK}][/a]


Even while encoding to <pick one out of MP3, AAC, Vorbis, WMA> ?

/me trying to give a thought-provoking impulse


Sebi
[a href="index.php?act=findpost&pid=315891"][{POST_SNAPBACK}][/a]


Err, no, this was, I thought, in the context of playback.

Inside a coder, you may do any number of specific things and perhaps use the introduced nonlinearities constructively, eh?
-----
J. D. (jj) Johnston

Dither during playback

Reply #12
Quote
Interesting point. One typically requantizes to a much lower precision than the original data, so would dithering help there? And now try to involve the masking curve. Perceptual dithering, anyone?
[a href="index.php?act=findpost&pid=315910"][{POST_SNAPBACK}][/a]


Consider:

You want to reduce the rate. You know that anything under a half-step size is inaudible. (We'll assume your perceptual model is perfect for this purpose, ok?)

Why, therefore, would you want to dither? You want to lose this information, not keep it. If you dither and keep it, you'll up your coding rate, too, by removing '0's from your noiseless aftercoding.

Yes?
No?
-----
J. D. (jj) Johnston

Dither during playback

Reply #13
Quote
Yes?
No?
[a href="index.php?act=findpost&pid=316127"][{POST_SNAPBACK}][/a]


Maybe. There's an interesting paper by Michael Gerzon (IIRC) about the use of dithering in psychoacoustic based codecs, but I don't have it.

I think the idea is that, for some signals, you'll get similar problems within a filter band to those that you get across the whole audio spectrum when simply truncating the audio data without dither - i.e. the quantisation noise could be highly correlated (in some way) with the original audio signal.

The correlated noise could be more audible than uncorrelated noise, so it could make sense to dither - it could even save you bits because you could quantise more aggressively, since the resulting (higher level) noise was less audible / objectionable.

In practice, maybe this idea is useless - I don't think any codec implements it.

However, it has some theoretical basis: People often talk about a signal at x dB masking another signal at y dB, as if just the frequencies and amplitudes define masking perfectly - but the real world isn't nearly so simple. Typical codecs have an adjustment of several dB (20dB was typical in early codecs) depending on whether the signal is noise-like to tone-like, because it effects the amount of masking. Likewise, the audibility of the "masked" signal (in this case, coding noise) depends on the character of that "masked" signal. If, for some strange case, it's not noise-like because of some correlation with the original signal, then the codec's masking calculation could be wrong.

Cheers,
David.

Dither during playback

Reply #14
Quote
I think the idea is that, for some signals, you'll get similar problems within a filter band to those that you get across the whole audio spectrum when simply truncating the audio data without dither - i.e. the quantisation noise could be highly correlated (in some way) with the original audio signal.

Well, yes, "removed" is highly correlated with the signal, the error signal is exactly equal to the signal in that subband, then, yes?
Quote
The correlated noise could be more audible than uncorrelated noise, so it could make sense to dither - it could even save you bits because you could quantise more aggressively, since the resulting (higher level) noise was less audible / objectionable.

Except that you'll find that the level remains the same, actually lower, remember that's how dithering works, it RAISES the noise level and destroys the correlation, so it's the other way around, I would think.
Quote
In practice, maybe this idea is useless - I don't think any codec implements it.

However, it has some theoretical basis: People often talk about a signal at x dB masking another signal at y dB, as if just the frequencies and amplitudes define masking perfectly - but the real world isn't nearly so simple. Typical codecs have an adjustment of several dB (20dB was typical in early codecs) depending on whether the signal is noise-like to tone-like, because it effects the amount of masking.

Absolutely, but this has nothing to do with dithering, this has to do with the characteristics of the original signal, does it not? That would be what Psychoacoustic Model 2 looks at, for instance (Meaning MPEG-1 Psych model 2), quite clearly.

The question of what the structure of the noise is seems to be secondary.
Quote
Likewise, the audibility of the "masked" signal (in this case, coding noise) depends on the character of that "masked" signal.

Really? Aside from the above, I haven't seen a lot of evidence to that effect.  It's true for tone on tone masking, but that's never what we see coming out of a quantizer, now, is it?

The "tonality" stuff has to do with the evenness of the envelope of the signal as it appears on the cochlea. That's evenness of the signal, not of the masked signal, which matters only if it affects the envelope of the signal to any great extent, among other things.  A error signal down 10dB or 20dB isn't going to have a lot of effect on most envelopes unless it's very, very periodic, in which case it's likely to be the removal of the original signal, yes?

Quote
If, for some strange case, it's not noise-like because of some correlation with the original signal, then the codec's masking calculation could be wrong.

Cheers,
David.
[a href="index.php?act=findpost&pid=316189"][{POST_SNAPBACK}][/a]


The most common case in a perceptual coder is a zero line. That by definition means that you have 100% correlation with the signal in that band, the signal is 'x' the output is 0, and the error is 'x'.

None the less, they still seem to work.

Now, I will say, if you dither the quantizer, you do not see the signal disappear, and you see the entropy of the quantizer output go up by about 1 bit/sample. Can you imagine what happens when you add 1 bit/sample to every subband in an entire spectrum? What does that do to your rate?
-----
J. D. (jj) Johnston

Dither during playback

Reply #15
The special case where the information within one sub-band is completely removed is not what I was referring to, though some codecs, notably AC-3, will happily replace such sub-bands (when decoding) with dither (well, just noise really!) at a roughly suitable level, rather than silence. In this instance, it brings an audible benefit at a given bitrate. The bitrate overhead is almost nothing - it's a dither/don't dither "0" subbands flag - sent once per audio block IIRC.

I don't think I'm disagreeing with you about the relative merits of adding dither before quantising in the encoder, so increasing the noise level (at a given bitrate), which would often be a bad thing to do. I'm trying to remember why Gerzon suggested it could be a good thing to do sometimes. I'll have to dig out the paper. I wasn't looking for the Spanish Inquisition. (still, no one expects them!  )


Don't you agree that, if spectrum levels are as equivalent as possible, just audible tone/tone tone/noise noise/tone noise/noise masker/maskee values are all different?


That's not to say that this is relevant, just that it's the reason why it hypothetically could be.

Cheers,
David.