DSPRelated.com
Forums

Dithering for

Started by Yazz December 1, 2006
It is very interesting reading various takes on this subject in this
thread. I have had little to do with the engineering of audio and video
systems. I'm just one of those lucky enough to be a listener and a viewer,
with a perception of what sounds/looks good or bad.

My field is in sonar engineering, where (ambient)noise plays an important
part in the overall performance of the system. Without it, we would have
to introduce some prior to quantisation.

We set the signal-conditionining gain (before the A/D) such that ambient
noise just 'tickles' the 1-2 LSBs of the A/D to ensure that we can detect
our smallest of signals. Naturally, we use FFT to provide coherent
processing gain and, providing the signals (pulses, usually) are long
enough, we are used to detecting signals over more than 140dB dynamic
range with 16-bit converters. On their own, these signals would only be
worth < 1/100th of a bit. 

I never cease to be amazed at just how linear the amplitude characteric is
at these miniscule levels.

Jeff
John Monro wrote:

(snip)

> To re-state the question, does anyone disagree with the following > statement? > "For 'real-life' audio or video signals, adding dithering to the > sampling process does not make any perceptible improvement to the quality."
> I think it is true, and while I can present a theoretical argument, I > don't have the equipment or environment to check whether it is true.
I might agree, but not for the reason you (probably) mean. In most cases, 16 bit audio and 8 bit video is enough, especially if the input sources already have some noise. (I think t doesn't even need to be noise, other frequency components in the signal will also contribute.) For 8 bit audio or 4 bit video, you would probably easily see it. Slightly related, consider that the amplitude of vibration on your eardrum for the quietest signals you can hear is less than the diameter of an atom. -- glen

John Monro wrote:


> To re-state the question, does anyone disagree with the following > statement? > "For 'real-life' audio or video signals, adding dithering to the > sampling process does not make any perceptible improvement to the quality."
It depends. For audio, dithering starts making a noticeable improvement when the resolution gets below 10 bits. I developed the DSP/PWM part of 10kW audio amplifier. Without dithering, the idle tones of the noise shaper were very audible.
> I think it is true, and while I can present a theoretical argument, I > don't have the equipment or environment to check whether it is true.
It is quite simple to see for yourself: take a wave file and truncate the LSBs on every sample. Vladimir Vassilevsky DSP and Mixed Signal Design Consultant http://www.abvolt.com
Jerry Avins wrote:
> Jerry Avins wrote: > > ... > >> Noise would not be an improvement. Under conditions where external >> noise sources don't mask it, the detected 1/5-bit signal can be >> clearly audible with an evident pitch. >
Interesting! I would not have expected that.
> 1/5 --> 1/2. As a signal fades to silence, the quantizing becomes > evident, and sometimes that is intrusive. Dithering makes it less > intrusive. Perhaps because the low-level noise tends to mask some of the > artifacts, but also because it suppressed them. If you want to explore > the effects of dithering, quantize your audio to five bits or so, with > and without dither, and with different depths of dither. I haven't done > that myself, but I've heard the results and I'm a believer. It's much > harder to hear a good signal made slightly better than it is to hear a > bad one edge toward passable. > > Jerry
Was speech or music being used, rather than a test tone? Regards, John
Vladimir Vassilevsky wrote:
> > > John Monro wrote: > > >> To re-state the question, does anyone disagree with the following >> statement? >> "For 'real-life' audio or video signals, adding dithering to the >> sampling process does not make any perceptible improvement to the >> quality." > > It depends. For audio, dithering starts making a noticeable improvement > when the resolution gets below 10 bits. > > I developed the DSP/PWM part of 10kW audio amplifier. Without dithering, > the idle tones of the noise shaper were very audible.
OK, I can see that. I assume the idle tone is being produced because of zero-signal DC offsets of around a bit or so.
> >> I think it is true, and while I can present a theoretical argument, I >> don't have the equipment or environment to check whether it is true. > > It is quite simple to see for yourself: take a wave file and truncate > the LSBs on every sample. >
I think that would only demonstrate that fewer bits sounds worse, and I have already done that :=) Expanding on your suggestion though, it occurs to me that I could separate out the LSBs as you suggest, add a digitally-generated dither signal, and then add the 'carry' bit into the truncated main part of the digital sample. That should do the trick!
> Vladimir Vassilevsky > > DSP and Mixed Signal Design Consultant > > http://www.abvolt.com
Randy Yates wrote:
> John Monro <johnmonro@optusnet.com.au> writes: > >> Randy Yates wrote: >>> John Monro <johnmonro@optusnet.com.au> writes: >>>> [...] >>>> This brings me to my main point. Is dithering have any other use >>>> apart from improving the test-signal results? It seems to me that >>>> dithering does not provide any benefit at all when 'real-life' audio >>>> or video signals are being sampled, and I would be interested if >>>> anyone disagrees with this. >>> With such high resolution converters these days for audio, I think >>> for >>> the most part you're right. But there were some old Windows (95? >>> 3.1?) .wav files that were 8 bits, and failure to dither on those >>> suckers >>> was clearly audible. >> Thanks, that's the sort of evidence I was looking for. >>> Also, dithering is about more than removing spurs - it also (with the >>> right distribution) removes noise power modulation. I think this >>> can also be audible, but the likelihood with >= 16 bit converters >>> is probably low. >> I don't understand this because I can't see that adding more noise to >> the signal is going to help. > > Think about what would be less annoying - a constant, relatively low > noise level, or a lower noise level that sometimes ballooned quite > high. > >>> I think you actually may hear the "graininess" in undithered CDs >>> that fade to silence if you've got the volume up pretty loud. And >>> I'm not talking about "gain-riding" the volume as the music >>> fades, but listening at a constant, albeit loud, volume. >> Good point! I can see that in the absence of dither, as the last note >> fades away there would be a tendency for the sampled signal to jump >> from one set of quantisation levels to another. > > Yep, you get that "graininess." Sounds like shit. However, it's > not unusual for me to listen at levels >= 110 dB SPL unweighted.
Thanks for the reply Randy. By the way, I am a bit concerned about the 110 dB SPL. You can't avoid progressive loss of hearing at that level. Regards, John
John,

Suppose you decide to increase the sample rate to much higher than the
signal BW, add wideband dither noise prior to sampling, wideband in
relation to the high sample rate, sample with very coarse resolution,
then digitally decimate the signal, removing most of the quantization
noise in the process. Would you expect the quality to go up?

Dirk


John Monro wrote:

<snipped>

> > Thanks for the counterexample Jerry. Dithering clearly makes the signal > detectable, and this has advantages for measurement where multi-sample > averaging is carried out. You and Steve refer to this in later postings. > > The question is: in your counterexample, would dithering lead to a > perceived improvement to the quality of the audio signal ? I can't see > that it would, because the 0.5-bit amplitude signal which was previously > undetected in the absence of dithering now gets sampled as a 1-bit noise > signal. This is hardly an improvement! > > Regards, > John
John Monro wrote:
> Steve Underwood wrote: > >> John Monro wrote: >> >>> This brings me to my main point. Is dithering have any other use >>> apart from improving the test-signal results? It seems to me that >>> dithering does not provide any benefit at all when 'real-life' audio >>> or video signals are being sampled, and I would be interested if >>> anyone disagrees with this. >> >> >>> My argument is that real-life signals are neither constant-amplitude >>> nor constant-frequency nor repetitive. This should mean that the >>> quantisation noise will not be repetitive either. As a result, any >>> 'spurs' which occur will be highly transient and are will not be >>> perceived as tones in audio signals or patterns in video signals. In >>> effect, when real-life signals are sampled, the non-repetitive nature >>> of signals should suppress the production of spurs in exactly the >>> same way that dithering suppresses spurs when test signals are sampled. >> >> >> I think most serious signal processing people would massively disagree >> with the notion than dithering only improves artificial things, and it >> isn't just about audio or video. >> >> Sure, dithering gets oversold in a lot of cases. Processing what is >> essentially a single shot event isn't going to be improved by >> dithering. Most signals are, however, somewhere between single shot >> and totally repetitive. The more repetitive they are, the more they >> gain from dithering. >> >> Many real world signals are extremely repetitive. I have greatly >> improved performance in energy metering through dithering. Power >> waveforms change rather slowly in the real world, and you get almost >> 100% of the possible benefit dithering could give. >> >> Regards, >> Steve >> > Thanks Steve. > I take your point about measuring highly repetitive signals. I was not > thinking about this situation, which has some of the characteristics of > the 'test-signal' I mentioned but is if course a real-life application. > I was thinking more in terms of audio or video signals, and in the > perceived quality of the sound or picture. > > To re-state the question, does anyone disagree with the following > statement? > "For 'real-life' audio or video signals, adding dithering to the > sampling process does not make any perceptible improvement to the quality." > > I think it is true, and while I can present a theoretical argument, I > don't have the equipment or environment to check whether it is true. > > Regards, > John
Signals are not one shot or totally repetitive. They are on a sliding scale. For most of its duration, each millisecond of music has a lot of similarity with the millisecond before and the millisecond after. It is, therefore, rather closer to the totally repetitive end of the scale than to the one shot end of the scale. Regards, Srece
John Monro wrote:
> I don't understand this because I can't see that adding more noise to > the signal is going to help.
It's not the difference between adding noise and not adding noise. It's the difference between adding one type of noise (quantization) and adding two types of noise (dither + quantization). It turns out that adding the second type of noise cancels out some of the bad effects of the first type of noise (by retaining more information in a large enough sequence of samples). But both add noise, so sometimes it's a preference for which combination of noise seems worse. In many cases, noise which causes a small signal to suddenly disappear is far more noticeable than noise that causes a small signal to fade gradually into the a bit more background noise. IMHO. YMMV. -- rhn A.T nicholson d.0.t C-o-M
Steve Underwood wrote:
> John Monro wrote: >> Steve Underwood wrote: >> >>> John Monro wrote: >>> >>>> This brings me to my main point. Is dithering have any other use >>>> apart from improving the test-signal results? It seems to me that >>>> dithering does not provide any benefit at all when 'real-life' audio >>>> or video signals are being sampled, and I would be interested if >>>> anyone disagrees with this. >>> >>> >>>> My argument is that real-life signals are neither constant-amplitude >>>> nor constant-frequency nor repetitive. This should mean that the >>>> quantisation noise will not be repetitive either. As a result, any >>>> 'spurs' which occur will be highly transient and are will not be >>>> perceived as tones in audio signals or patterns in video signals. In >>>> effect, when real-life signals are sampled, the non-repetitive >>>> nature of signals should suppress the production of spurs in exactly >>>> the same way that dithering suppresses spurs when test signals are >>>> sampled. >>> >>> >>> I think most serious signal processing people would massively >>> disagree with the notion than dithering only improves artificial >>> things, and it isn't just about audio or video. >>> >>> Sure, dithering gets oversold in a lot of cases. Processing what is >>> essentially a single shot event isn't going to be improved by >>> dithering. Most signals are, however, somewhere between single shot >>> and totally repetitive. The more repetitive they are, the more they >>> gain from dithering. >>> >>> Many real world signals are extremely repetitive. I have greatly >>> improved performance in energy metering through dithering. Power >>> waveforms change rather slowly in the real world, and you get almost >>> 100% of the possible benefit dithering could give. >>> >>> Regards, >>> Steve >>> >> Thanks Steve. >> I take your point about measuring highly repetitive signals. I was >> not thinking about this situation, which has some of the >> characteristics of the 'test-signal' I mentioned but is if course a >> real-life application. I was thinking more in terms of audio or video >> signals, and in the perceived quality of the sound or picture. >> >> To re-state the question, does anyone disagree with the following >> statement? >> "For 'real-life' audio or video signals, adding dithering to the >> sampling process does not make any perceptible improvement to the >> quality." >> >> I think it is true, and while I can present a theoretical argument, I >> don't have the equipment or environment to check whether it is true. >> >> Regards, >> John > > Signals are not one shot or totally repetitive. They are on a sliding > scale. For most of its duration, each millisecond of music has a lot of > similarity with the millisecond before and the millisecond after. It is, > therefore, rather closer to the totally repetitive end of the scale than > to the one shot end of the scale. > > Regards, > Srece
But if the quantisation noise is repetitive this would happen only when there is more than merely 'a lot of similarity.' The signal would have to consist of repeating waveforms that are identical down to the one-bit level and lower. This can only happen with a constant-level test-tone is present, and only if its frequency is a simple fraction of the sample rate. I suppose a music synthesiser can achieve this, but it would have to be a simple one without a touch-sensitive keyboard, and without vibrato or tremolo effects and without any accompanying instruments. With music like that, who cares if there are a few harmonically-related spurs present? They may be an improvement! :=) Regards, John