# Dthering....

Started by October 10, 2003
```Hi,

I've a question about dithering in the digital domain.

Let's say I've to quantize a signal from 12 bits to 8 bits.

1) Does it make sense to apply dithering at all?
2) The noise (dithering) signal, must be real noise, or it
is enough to be just an uncorrelated signal?

For 2) I mean some signal with spectral properties similar
to white noise, but not a real random signal. For example
something like a sawtooth.

Final note: the signal to be dithered is finite in time.

Thanks,

bye,

--
Piergiorgio Sartor

```
```Piergiorgio Sartor wrote:
> Hi,
>
> I've a question about dithering in the digital domain.
>
> Let's say I've to quantize a signal from 12 bits to 8 bits.
>
> 1) Does it make sense to apply dithering at all?
> 2) The noise (dithering) signal, must be real noise, or it
>    is enough to be just an uncorrelated signal?
>
> For 2) I mean some signal with spectral properties similar
> to white noise, but not a real random signal. For example
> something like a sawtooth.
>
> Final note: the signal to be dithered is finite in time.

Ask yourself how repetitive your signal is. If it is essentially a one
shot event, then dithering only hurts. If it is highly repetitive -
either exact repititions, or things that change comparatively slowly
like music - dithering tends to be a win. Some people treat dithering
like the holy grail, which it is not. In the right contexts, however, it
can bring substantial gains.

Why would you expect something like a sawtooth added to a signal by
adding the sum of two random numbers (which is the usual thing for noise
based dithering)? Are you confusing the kind of noise based dithering we
usually do in DSP, with the triangle or sawtooth wave dithering often
used to extend the range of heavily oversampled ADCs?

Regards,
Steve

```
```Piergiorgio Sartor <piergiorgio.sartor@nexgo.REMOVE.THIS.de> wrote in message news:<3f8679b0\$0\$261\$4d4ebb8e@read.news.de.uu.net>...
> Hi,
>
> I've a question about dithering in the digital domain.
>
> Let's say I've to quantize a signal from 12 bits to 8 bits.
>
> 1) Does it make sense to apply dithering at all?

It depends. If you're talking about an audio signal, then
I'd say it makes a whole bunch of sense. 8 bits is pretty
coarse for an audio signal. In general the lower the number
of bits you're quantizing to, the more dithering makes sense.

> 2) The noise (dithering) signal, must be real noise, or it
>     is enough to be just an uncorrelated signal?
>
> For 2) I mean some signal with spectral properties similar
> to white noise, but not a real random signal. For example
> something like a sawtooth.

Let me just jump around your question and say a couple of things.
The ideal dither noise pdf (see Wannamaker) is triangular at
+/- 1 bit. This is easily generated by adding two uniform pdfs
at +/- 1/2 bit, which is in turn easily generated using linear
congruential number generators (provided you use the "right"
parameters).

> Final note: the signal to be dithered is finite in time.

I don't know that that makes a difference in terms of how
one dithers.

>
> Thanks,
>
> bye,

See ya'.

--RY
```
```Steve Underwood wrote:

> Ask yourself how repetitive your signal is. If it is essentially a one
> shot event, then dithering only hurts. If it is highly repetitive -
> either exact repititions, or things that change comparatively slowly
> like music - dithering tends to be a win. Some people treat dithering
> like the holy grail, which it is not. In the right contexts, however, it
> can bring substantial gains.

Well, what do you mean with "repetitive"?
The signal can be, repetitive or totally random or whatever.

> Why would you expect something like a sawtooth added to a signal by
> adding the sum of two random numbers (which is the usual thing for noise
> based dithering)? Are you confusing the kind of noise based dithering we
> usually do in DSP, with the triangle or sawtooth wave dithering often
> used to extend the range of heavily oversampled ADCs?

Generating random signal could be quite expensive.

Second, some properties could be identical, like symbol probability.

I was wodering if it is enough to have uncorreled signal or something
else is needed.

bye,

--
Piergiorgio Sartor

```
```Randy Yates wrote:

> It depends. If you're talking about an audio signal, then
> I'd say it makes a whole bunch of sense. 8 bits is pretty
> coarse for an audio signal. In general the lower the number
> of bits you're quantizing to, the more dithering makes sense.

OK.

> Let me just jump around your question and say a couple of things.
> The ideal dither noise pdf (see Wannamaker) is triangular at
> +/- 1 bit. This is easily generated by adding two uniform pdfs
> at +/- 1/2 bit, which is in turn easily generated using linear
> congruential number generators (provided you use the "right"
> parameters).
>

Uhm, I do not know.

What about using, as dithering signal, something like:

-3, -2, -1, 0, 1, 2, 3, 2, 1, 0, -1, -2, -3, etc.?

bye,

--
Piergiorgio Sartor

```
```Piergiorgio Sartor <piergiorgio.sartor@nexgo.REMOVE.THIS.de> wrote in message news:<3f8679b0\$0\$261\$4d4ebb8e@read.news.de.uu.net>...
> Let's say I've to quantize a signal from 12 bits to 8 bits.
>
> 1) Does it make sense to apply dithering at all?
> 2) The noise (dithering) signal, must be real noise, or it
>     is enough to be just an uncorrelated signal?
>
> For 2) I mean some signal with spectral properties similar
> to white noise, but not a real random signal. For example
> something like a sawtooth.

2) it may depend on what you want to dither for - see 1)

I would normally use dither to improve SFDR (Spurious Free Dynamic
Range), if this is your reason then I would strongly suggest it has to
be random, if you use dither for some other purpose then the below may
be irrelevant.

The dither has to be random because it works by delocalising
output.

An illustration of what I mean by this is that if a theoretical ADC
should output code A at input voltage B, but in fact it outputs code A
at input voltage B+[fixed_offsets] then this error will be repeated
each time the input voltage is near B.

In fact there will be an error associated with all the ADC output
codes, and if you had a high sample rate and little noise and plotted
the curve of the difference between the actual ADC output and the
'ideal' output, you would see all these little errors. If the input
signal was periodic, then eventually so would be the output error.

This periodic error gives rise to spurii in the spectrum of the ADC
output, and it is this which can attempt to address using dither. Thus
by adding random noise we hope that we stop the same error occurring
in the same place every time.

If the noise is not random for the duration of your input data, then
you could still eventually get a periodic error output, thus I suggest

Hope that helps

Al
```
```Piergiorgio Sartor <piergiorgio.sartor@nexgo.REMOVE.THIS.de> wrote in message news:<3f86be04\$0\$258\$4d4ebb8e@read.news.de.uu.net>...
> Randy Yates wrote:
>
> > It depends. If you're talking about an audio signal, then
> > I'd say it makes a whole bunch of sense. 8 bits is pretty
> > coarse for an audio signal. In general the lower the number
> > of bits you're quantizing to, the more dithering makes sense.
>
> OK.
>
> > Let me just jump around your question and say a couple of things.
> > The ideal dither noise pdf (see Wannamaker) is triangular at
> > +/- 1 bit. This is easily generated by adding two uniform pdfs
> > at +/- 1/2 bit, which is in turn easily generated using linear
> > congruential number generators (provided you use the "right"
> > parameters).
> >
>
> Uhm, I do not know.
>
> What about using, as dithering signal, something like:
>
> -3, -2, -1, 0, 1, 2, 3, 2, 1, 0, -1, -2, -3, etc.?
>
> bye,

No, I don't think that will work well. My gut tells me that the
best dither signals will have an autocorrelation function Rxx(tau)
that is zero when tau != 0, and this is definitely not true for
this function.

I heard you mention that true dither noise is very expensive in another
post in this thread. This is absolutely not true as long as you're
smart about how you do it. In other words, you can generate a dither
signal that is quite good without spending a lot of MIPS. More details
will be provided if you're interested.

--Randy
```
```On Fri, 10 Oct 2003 11:22:16 +0200, Piergiorgio Sartor
<piergiorgio.sartor@nexgo.REMOVE.THIS.de> wrote:

>Hi,
>
>I've a question about dithering in the digital domain.
>
>Let's say I've to quantize a signal from 12 bits to 8 bits.
>
>1) Does it make sense to apply dithering at all?
>2) The noise (dithering) signal, must be real noise, or it
>    is enough to be just an uncorrelated signal?
>
>For 2) I mean some signal with spectral properties similar
>to white noise, but not a real random signal. For example
>something like a sawtooth.
>
>Final note: the signal to be dithered is finite in time.

On 1):  It you want to decorrelate the spurs due to the new
quantization noise, then, yes, absolutely dithering can help.  Whether
or not it makes sense in your case depends on what you're doing and
what you need to get out of it.

2)  Using a sawtooth won't be nearly as effective as a more noisy
signal, but it might help compared to no dithering.  Consider that the
sawtooth signal has spectral contents that will still be present after
dithering, and if not carefully controlled the sawtooth spectrum may
add to desired signals that you'd like to preserve.   The idea of
adding noise is that it completely decorrelates the spurs due to the
quantization, but has a very small and uniform effect in the frequency
domain on the remaining signal.  I find it unlikely that a sawtooth
would be nearly as effective as noise.

Eric Jacobsen
Minister of Algorithms, Intel Corp.
My opinions may not be Intel's opinions.
http://www.ericjacobsen.org
```
```"Piergiorgio Sartor" <piergiorgio.sartor@nexgo.REMOVE.THIS.de> wrote in
> Randy Yates wrote:
>
> > It depends. If you're talking about an audio signal, then
> > I'd say it makes a whole bunch of sense. 8 bits is pretty
> > coarse for an audio signal. In general the lower the number
> > of bits you're quantizing to, the more dithering makes sense.
>
> OK.
>
> > Let me just jump around your question and say a couple of things.
> > The ideal dither noise pdf (see Wannamaker) is triangular at
> > +/- 1 bit. This is easily generated by adding two uniform pdfs
> > at +/- 1/2 bit, which is in turn easily generated using linear
> > congruential number generators (provided you use the "right"
> > parameters).
> >
>
> Uhm, I do not know.
>
> What about using, as dithering signal, something like:
>
> -3, -2, -1, 0, 1, 2, 3, 2, 1, 0, -1, -2, -3, etc.?

I triangular PDF is much different than a triangle wave!  You want the
former, not the latter.  This is a random signal that has a specific
probability distribution function.

In audio, dithering can be used to make "digital" sound more like "analog".
Consider a fading out (decaying) sine wave.  When recorded on analog tape,
the signal gets progressively softer until it dips below the noise floor.
Regardless of the level, it always sounds like a sine wave + noise.  With
(undithered) digital, as the number of available bits diminishes, the sine
wave starts to look more and more like a triangle or square wave.  This
sounds like a distorted sine wave (often described as "grainy"), not a sine
wave + noise.  Adding appropriate dither makes it again sound like a sine
wave + noise.

```
```Jon Harris wrote:

> I triangular PDF is much different than a triangle wave!  You want the
> former, not the latter.  This is a random signal that has a specific
> probability distribution function.

I know the difference between the two things...

> In audio, dithering can be used to make "digital" sound more like "analog".

That's interesting consideration, I never seen it
from this point of view.

bye,

--

piergiorgio

```