On 25/07/2015, robert bristow-johnson <r...@audioimagination.com> wrote:

> and that's not counting noise-shaping.

Since noise shaping merely changes the shape of the noise floor,
that's pretty much irrelevant. Noise shaping is equivalent to applying
a filter to the noise floor, for example a first order noise shaping
will simply change the noise floor to a -6 dB/oct slope, like applying
a first order highpass filter to white noise (like I demonstrated
earlier). The overall difference will be minor (but feel free to
repeat the experiment using a different noise floor, and present your
results).

(Also note that upsampling does not involve noise shaping at all,
unless it also involves quantization.)

>> Seems the conceptual misunderstanding here is that dithering does not
>> mean that the error is "described as noise".
>
> oh dear.  that's the whole point of it.
>
> do you understand what the difference between rectangular pdf dither and
> triangular pdf dither?

I could ask the same from you.

> what it does to the quantization signal?  the
> whole purpose is to take whatever nasty non-linearity (which a staircase
> function is) and turn it into something that is white (or bandlimited
> white), and with it's first two moments decoupled from the value of the
> input signal.

Yes, "by adding noise" (using triangular, rectangular, or whatever
probability distribution dither function).

Sure, trivially you can "describe" noise as noise, since it is noise
(what else), but it comes from _added_ noise from a noise generator,
_not_ the noise from the quantization (step) function.

>>   Rather, dithering means
>> that we deliberately *add* noise to the signal (because that has
>> advantages, see the literature).
>
> <sigh>

You cannot dither a signal if you only have a step function. That won't work.
You *must* need a noise generator, hence, you're adding external noise
to the signal.

"<sigh>" is a really convincing technical argument, you almost
convinced me. But let's see some sources:

Quote from https://en.wikipedia.org/wiki/Dither:

"Dither is an intentionally applied form of noise used to randomize
quantization error"

"[...] Lipshitz and Vanderkooy pointed out that different noise types,
with different probability density functions (PDFs) behave differently
when used as dither signals, and suggested optimal levels of dither
signal for audio.[10][11] Gaussian noise requires a higher level for
full elimination of distortion than rectangular PDF or triangular PDF
noise. Triangular PDF noise has the advantage of requiring a lower
level of added noise to eliminate distortion and also minimizing
'noise modulation'."

"RPDF stands for "Rectangular Probability Density Function,"
equivalent to a roll of a dice. Any number has the same random
probability of surfacing."

"TPDF stands for "Triangular Probability Density Function," equivalent
to a roll of two dice (the sum of two independent samples of RPDF)."

"Gaussian PDF is equivalent to a roll of a large number of dice. The
relationship of probabilities of results follows a bell-shaped, or
Gaussian curve, typical of dither generated by analog sources such as
microphone preamplifiers. If the bit depth of a recording is
sufficiently great, that preamp noise will be sufficient to dither the
recording."

Consider the meaning of the the words: "intentionally applied form of
noise", "randomize", "noise types when used as dither signals",
"triangular PDF noise", "added noise", "random probability", "analog
sources", "preamp noise".

Let's try what happens when I dither a 16-bit constant zero signal to
a 8-bit dithered signal.

16-bit constant zero signal (all samples are zero):
http://morpheus.spectralhead.com/wav/zero16bit.wav

Same thing dithered to 8-bit, using triangular dither (no noise shaping):
http://morpheus.spectralhead.com/wav/zero8bit_dithered.wav

Its spectrum looks like uniform distribution white noise:
http://morpheus.spectralhead.com/img/zero8bit_dithered_spectrum.png

By applying logic, consider how is it possible that the original
signal was a constant zero signal (all samples zero), and the
resulting dithered signal looks and sounds exactly like white noise.

Some further sources to confirm:

"Dithering is described in Section 5.1.2.5 as the addition of
low-amplitude random noise to an audio signal as it is being
quantized. The purpose of dithering is to prevent neighboring sample
values from quantizing all to the same level, which can cause breaks
or choppiness in the sound. Noise shaping can be performed in
conjunction with dithering to raise the noise to a higher frequency
where it is not noticed as much."[1]

"The concept of dither is to add some random noise to the waveform in
order to "break up" the statistical determineability of the stair
stepped waves. We do this by literally adding noise to the signal."[2]

"To dither means to add noise to our audio signal. Yes, we add noise
on purpose, and it is a good thing."[3]

Consider the meaning of the words: "addition of low-amplitude random
noise", "add some random noise", "literally adding noise", "add noise
on purpose".

References:
[1] "The Mathematics of Dithering and Noise Shaping "
http://digitalsoundandmusic.com/5-3-7-the-mathematics-of-dithering-and-noise-shaping/

[2] "Dither Explained - An explanation and proof of the benefit of
dither for the audio engineer"
http://www.users.qwest.net/~volt42/cadenzarecording/DitherExplained.pdf

[3] "What is dither?"
http://www.earlevel.com/main/1996/10/20/what-is-dither/

To disprove these sources, you will need a stronger argument than "<sigh>".

Remark: reference [3] is written by a member of this mailing list.

Now let's check the source code of some dither algorithm.

Dither.cpp from Audacity:
https://audacity.googlecode.com/svn/audacity-src/trunk/src/Dither.cpp

Here's how DITHER_NOISE is defined:

    // This is supposed to produce white noise and no dc
    #define DITHER_NOISE (rand() / (float)RAND_MAX - 0.5f)

Consider that it uses C library's uniform distribution random number
generator function rand() that - when normalized - generates uniform
distribution white noise. Consider the comment "this is supposed to
produce white noise".

Let's see how rectangular dithering is defined:

    // Rectangle dithering, apply one-step noise
    inline float Dither::RectangleDither(float sample)
    {
        return sample - DITHER_NOISE;
    }

Consider that all it does, is it merely adds "white noise" to the
signal. Consider the comment "apply one-step noise".

For the the source code for the functions for triangular and noise
shaped dithering, see the above link. Consider that all of them are
based on DITHER_NOISE (= "white noise") generated using C library's
standard uniform distribution random generator function rand().

Example, at one point, triangular dither is defined as:

    // Generate triangular dither, +-1 LSB, flat psd
    float r = DITHER_NOISE + DITHER_NOISE;

In other words, it's defined as sum of two white noise sources.

If at this point, you still fail to realize that dithering means
"adding random noise to the signal", there's really nothing else left
to say, you fail at basic logic.

I have shown several ways why dithering means 'adding noise to a
signal'. I've shown audio examples, showing that a constant zero
signal becomes noise when dithered (I've shown the very same example
two different times), I've shown how certain types of noise shaping
change the spectrum of the the noise floor of dithers, I've shown how
some of the various PDF's look like in description and in algorithm,
I've linked about 30+ external references in the topic of sigma-delta
converters and dithering, and I've quoted more than a half dozen
various sources. There is no point in repeating this further.

If, after all this, you still fail to understand that "dithering means
adding random noise to a signal", you basically

    1) fail at basic logic
    2) live in an alternate universe

Since a ditherered constant zero signal becomes nonzero after
dithering, it follows that if 0+X is nonzero, then X must be nonzero.
If you have a zero entropy constant signal, and the result of a
function is a noisy signal, then the only way that this can happen, is
that you added noise in the function. Said otherwise, "you don't get
something from nothing", unless you _add_ something - believing
otherwise means you live in an alternate reality (i.e. you're
delusional).
_______________________________________________
music-dsp mailing list
music-dsp@music.columbia.edu
https://lists.columbia.edu/mailman/listinfo/music-dsp

Reply via email to