locosoundman wrote on Wed, 20 October 2004 14:24 |
Could you possibly take it one step further and explain how TPDF Dither is implemented?
Thanks, Rob
|
Regarding triangle PDF. First why?
As I mentioned in the earlier post, when the signal get to be low, and we “run out of” quantization levels (not enough bits relative to small signal), the error signal becomes signal dependent - no more a random noise behavior. Part of the error signal becomes harmonic distortions, and the rest does becomes noise, but not at constant amplitude. The noise “going up and down in level” is called “noise modulation”.
Of course, adding random noise (dither) is a compromise, but just slight increase in the noise floor is a small price to pay. The harmonic distortion and noise modulation are a lot more offensive. Yet, we are interested in adding as little noise energy as possible.
Dr. Lipshitz and DR. Vanderkooey from Toronto university presented the solution, which is TDPF (triangle dither). They found out that 1 LSB rectangular dither is enough to eliminate the harmonic distortions, but the noise modulation does not disappear.
Say you have a quantization levels at -2,-1,0,1,2,3… and the dither amplitude is .999 (near 1). With zero signal, if the DC is at 0, the dither will be between 0 and 0.999, never hitting 1, so the output code is always at zero. No noise at all. But say we move the DC to +0.5. Now the dither is between 0.5 and 1.499. So about half the time we are between 0 and 1, the rest of the time we are between 1 and 2. We now have noise.
If a tiny bit of DC van change the noise, so can a small signal… That is how noise modulation occurs. So Lipshitz and Vanderkooey figured that the minimum noise energy required to eliminate both distortions and noise modulation is triangle noise (statistical distribution wise). The idea is to have the same constant noise level on average (changing DC or adding a small signal should not effect the noise amplitude.
What is triangle probability, how do we make it?
Lets, begin with rectangular probability. We take a dice and throw it many times, and soon enough we learn that each number (1 through 6) is about as likely as the other. With a lot of dice throwing we find equal probability thus a rectangular shape
1 x
2 x
3 x
4 x
5 x
6 x
Now let’s throw 2 dice. We can get a 1+1=2, or a 3+4=7 or “anything”. But there is only one way to get a 2 - (1+1)
two ways to get a 3 – (1+2) or (2+1)
three ways to get a 4 – (1+3) or (3+1) or (2+2)
four ways to get a 5
five ways to get a 6
six ways to get a 7
five ways to get a 8…
one way to get a 12 (6+6)
Combined to a pictue it looks like a traingle:
2 x
3 x x
4 x x x
5 x x x x
6 x x x x x
7 x x x x x x
8 x x x x x
9 x x x x
10 x x x
11 x x
12 x
There are 2 requirements to get (on average) a triangle shape:
1. Each dice is random or “fair”
2. The dice do not influence each other, they are independent.
Therefore generating a triangular dither is done by adding 2 separate and INDEPENDENT rectangular dithers, 1LSB in amplitude each. The minimum value is 0+0=0. The maximum value is 1+1=2 LSB’s, and the energy is concentrated (peak of the triangular) at 1.
If you make that dither and subtract 1, you end up with:
The minimum value is 0+0-1= -1. The maximum value is 1+1-1= 1 LSB’s, and the most of the time (peak of the triangular) you are near 0, thus most of the time you are not adding too much noise… The main point is that if you now add DC (or signal), the dither energy stays constant(I am not expaling in detail but it is so).
Adding more noise will buy noting and only increase the noise level. But it is interesting to note that adding more and more rectangular will approach a normal (Gaussian) distribution - It looks like a bell shaped curve.
BR
Dan Lavry