IPB

Welcome Guest ( Log In | Register )

 
Reply to this topicStart new topic
Dither and Noise shaping, Request for explaation
cernall
post Jun 29 2010, 10:07
Post #1





Group: Members
Posts: 3
Joined: 29-June 10
Member No.: 81920



Can anyone please explain me how dither is used to reduce the quantization noise? And how Noise shaping works?
Go to the top of the page
+Quote Post
2Bdecided
post Jun 29 2010, 10:56
Post #2


ReplayGain developer


Group: Developer
Posts: 5069
Joined: 5-November 01
From: Yorkshire, UK
Member No.: 409



This is a good start:
http://en.wikipedia.org/wiki/Dither#Digital_audio

...then maybe this...
http://wiki.hydrogenaudio.org/index.php?title=Noise_shaping

Cheers,
David.
Go to the top of the page
+Quote Post
AndyH-ha
post Jun 29 2010, 11:15
Post #3





Group: Members
Posts: 2205
Joined: 31-August 05
Member No.: 24222



Dither is irrelevant unless the signal, the audio you want, is very low level. Dither is low level random noise at roughly the same amplitude as the low level audio it needs to correct (e.g. say below -85dBfs).

Sampling audio involves measuring the signal level at selected instances and assigning a number to represent the amplitude at that particular instance. The audio is, for all practical purposes, continuous. Like a geometric line, there are an infinite number of points, or amplitude values, between any beginning and end.

However, digital sampling can only choose from a limited number of values for each measurement. From zero to the maximum possible amplitude the equipment can handle, or more realistically, from negative maximum to positive maximum on either side of zero, is divided into a certain number of discrete values, depending on the bit depth (16 bit has 2**16 possible values).

The converter (ADC) must choose the value that is nearest to the actual audio amplitude. The difference between that value and the actual amplitude is the quantization error. When converted back to audio (DAC) these errors make audio which sounds different than the original input.

When the audio amplitude is high, the error is so small, relative to the audio, that the difference cannot be heard. When the audio amplitude is very low, a sine wave, or any variation thereof, will tend to vary between two, or very few, digital values. By itself , it will not sound much like the original audio. It will not be very pleasant.

Dither, random noise, added to the audio, breaks up the assignment of such a small number of values because the noise adds to or subtracts from the audio signal at each sampling instance, making the measured level either larger or smaller than the audio actually is.

It turns out that the quantization error, averaged over enough time to register to human hearing, is completely eliminated. Over a sufficient number of samples, the actual value of the audio signal comes up often enough that, if graphed, a smooth curve can be drawn that exactly represents the input signal. There are also all those other random measurements around that line, but human hearing tends to automatically ignore them.

The output sounds very much like the original audio plus some white noise. The overall result is much clearer, more accurate, and better sounding than the audio signal sampled by itself would provide. This is also true with many things other than audio.

Noise shaping shifts the noise away from a purely random distribution in the frequency domain. A large part of the dither noise is created at frequencies not heard well by humans. The noise shaping curve is the mathematical distribution that provides both this benefit and randomness. The dither still works the same way, vis a vis quantization error, but mainly only the audio, not the noise, is heard, on playback.
Go to the top of the page
+Quote Post
AndyH-ha
post Jun 29 2010, 11:16
Post #4





Group: Members
Posts: 2205
Joined: 31-August 05
Member No.: 24222



David, your references may be better than my writing, but I write slow.
Go to the top of the page
+Quote Post
Arnold B. Kruege...
post Jun 29 2010, 12:12
Post #5





Group: Members
Posts: 3651
Joined: 29-October 08
From: USA, 48236
Member No.: 61311



QUOTE (cernall @ Jun 29 2010, 05:07) *
Can anyone please explain me how dither is used to reduce the quantization noise? And how Noise shaping works?


Dither doesn't reduce quantization noise. Dither may even raise the noise floor. It often does.

What dither does is randomize quantization noise and make it less noticable and ugly-sounding.

You see quantization noise may be a misleading term. Most of us think of noise as being something that is random, like a hiss or a roar.

Quantization noise is *not* nexessarily random. It is 100% predictable given the signal and the sampling used. It is not necessarily a hiss or a roar, but instead it is a mixture of different sounds that result from the mixing of the sampling process with the signal being sampled. It includes some odd and ugly sounds that can sound like varying tones. For example if you sample a rising sine wave (musical note going up the scale?) the quantizaiton noise includes tones that quickly rise and fall.

Rnadom noise, particularly at low levels is relatively innocious because its energy is so diffuse. The ear tends to ignore diffuse sounds. Quantization noise can include concentrated sounds that the ear picks up quite well, even when at low levels.

What dither does is ensure that the quantization noise is randomized and more like regular thermal noise.

As I said quantization noise is 100% predictable given the signal and the sampling. If you add dither, then it becomes a third element that defines the exact nature of the quantization noise. Dither can be just about any signal, but some signals work far better than others at fooling the ear. The idea of noise shaping is to force the quantizaiton noise into parts of the audio band where it is less noticable to the ear.

The usual goal of designing dither is to force the quantization noise to be random and concentrated at high frequencies.
Go to the top of the page
+Quote Post
cernall
post Jun 30 2010, 04:34
Post #6





Group: Members
Posts: 3
Joined: 29-June 10
Member No.: 81920



@ Andy - Thanks a lot for your kind effort to explain me all. It is really helpful.

@ 2BDecided - The Hydrogen audio wiki is down i doubt.

@ Arnold - Helped me a lot to understand the concepts fully.
Go to the top of the page
+Quote Post
Axon
post Jun 30 2010, 05:06
Post #7





Group: Members (Donating)
Posts: 1984
Joined: 4-January 04
From: Austin, TX
Member No.: 10933



Wiki's down because MySQL took an enormous #2 earlier today. (I'm honestly surprised the forum itself is working - props to admins)

I don't know if this analogy will help your understanding any, but there is a sort of connection between dither and one time pads in cryptography: in both cases, you're essentially adding random noise to a very non-random signal, in order to mask a signal you don't want predicted in some sense. In cryptography it's the plaintext, in audio, it's the quantization noise.
Go to the top of the page
+Quote Post
googlebot
post Jun 30 2010, 09:10
Post #8





Group: Members
Posts: 698
Joined: 6-March 10
Member No.: 78779



That's a very bad analogy. Dither doesn't mask a discrete stream of information, but decorrelates quantization noise from the main stream of information, the audio signal. Further, it is not a main goal in cryptography to make a stream of information unpredictable - that is only a side effect. Unpredictability in one time pad cryptography refers to the key stream. "Unpredictability" in the domain of PCM audio refers to the unwanted data itself, not the key stream. Quantization noise gets decorrelated from the main signal to make it less audible (lets not forget that that is the primary goal). The key stream itself can simply be pseudo-random, thus possibly predictable in a cryptographical sense, but still completely accomplish all objectives required in the audio domain.

This post has been edited by googlebot: Jun 30 2010, 09:50
Go to the top of the page
+Quote Post
Arnold B. Kruege...
post Jun 30 2010, 11:35
Post #9





Group: Members
Posts: 3651
Joined: 29-October 08
From: USA, 48236
Member No.: 61311



QUOTE (Axon @ Jun 30 2010, 00:06) *
Wiki's down because MySQL took an enormous #2 earlier today. (I'm honestly surprised the forum itself is working - props to admins)

I don't know if this analogy will help your understanding any, but there is a sort of connection between dither and one time pads in cryptography: in both cases, you're essentially adding random noise to a very non-random signal, in order to mask a signal you don't want predicted in some sense. In cryptography it's the plaintext, in audio, it's the quantization noise.


I think that most people who really understand dither would strongly object to the use of the word "mask". It's especially troubling when used in a context where people understand how masking works in the context of the perception of sound.

Dither does not mask, it randomizes. Dither imposes minor time-shifts on the transition points of the quantization process.
Go to the top of the page
+Quote Post

Reply to this topicStart new topic
1 User(s) are reading this topic (1 Guests and 0 Anonymous Users)
0 Members:

 



RSS Lo-Fi Version Time is now: 2nd August 2014 - 04:30