Home |
Search |
Today's Posts |
#41
Posted to rec.audio.tech
|
|||
|
|||
mathmatics behind mixing voice over music
"Randy Yates" wrote in message ... "Karl Uppiano" writes: You can still see evidence of dither having been applied, but without the critical information encoded in the LSB, it does little or no good anymore. I think I see what you're trying to say, but you're wrong. The fallacy in your thinking can be exposed by examining a real scenario using actual implementation details, e.g., assuming two's complement arithmetic. Consider the following thought experiment: We digitize a sine wave with peak-to-peak amplitude of 1/8 LSB and with a DC offset of -1/4 LSB using dither into a 16-bit signed, two's complement digital signal. Let's also assume our analog sine wave is noiseless, just for heuristic purposes. So if we didn't have dither, the digital signal would just be zero. With dither, we get a very noisy sine wave. Alternately, assuming the dither is less than or equal to 1 LSB peak-to-peak, the digital signal resulting from the dither will be bouncing between 0 and -1, which in 16-bit signed two's complement is 0000h and FFFFh (hexadecimal). So if we hack off the LSB, guess what? We've still got a whole lotta variation in the signal. We didn't "lose" the effect of the dither completely - we still have 15 bits banging back and forth. The bottom line is that you can't view the dither as just wiggling the LSB. It's simply not the case. Funny, that was almost exactly the scenario I was about to present to you, to support *my* case. I agree, the effects of the dither will propagate across many, if not all 16 bits, depending on whether the PCM code happens to be near a "major carry" in binary arithmetic. Having all the bits flip does not mean a big change occurred. Dither operates just at, and below, the smallest quantization interval (i.e., 1 LSB). That is the thing we are trying to linearize. The higher bits don't need any help -- there's always a bit to the right to handle twice the precision. The LSB has no bit to its right, so it needs help from some other mechanism, i.e., dither. So here's my thought experiment: Suppose we have an ideal 16-bit, two's complement quantizer[1], and we inject a noiseless DC analog signal proportional to a quantization level of -0.49. Due to the limited resolution of the encoder, it will emit the closest thing it has, a stream of zeros (0x0000), having a mean error of +0.49. Now if you add dither to the input at a peak amplitude of (say) 0.6 LSB, the encoder will begin to emit a stream of zeros (0x0000) at a 51% random occurrence, and minus ones (0xffff) at a 49% random occurrence. The average value over time will be -0.49, exactly proportional to the input. Now let's change the input voltage to +0.49. Without dither, the output will again be a stream of zeros. The mean error is now -0.49. Turn on the dither, and the datastream will be 51% zeroes, and 49% ones (0x0001), for an average value of 0.49, exactly proportional to the input. This is almost a classic Heisenberg trade-off: You either get finite resolution (stair-steps) and complete certainty (no quiescent noise), or you get infinite resolution and some uncertainty (a noise floor). You can't have both. Anyway, now let's see what happens if you truncate the LSB. With dither, the datastream for -0.49 DC offset is a stream of zeroes and minus ones (0x0000 @ 51% and 0xffff @ 49%) which, after truncation, becomes a stream of 0x0000 and 0xfffe. The zero stays the same, but the -1 becomes -2. The "noise" doubles, and the DC offset now becomes 0.98. This is *not* what we want. The residual noise there all right, but it is twice as powerful as it needs to be, and it isn't helping at all. We have a bigger error than before. If the truncation was due to a right shift, the down-scaling would restore the DC and the noise level, so it might look ok here. Now lets look at the case where the DC offset is +0.49. Here, we have a stream of zeros and ones (0x0000 @ 51% and 0x0001 at 49%), which after truncation, becomes a stream of... zeros! No residual noise -- nothing. The DC offset is zero. A right shift cannot fix this. But it gets worse: We're now left with some sort of background noise that comes and goes, correlated with the signal level -- one of the things the dither was supposed to eliminate. This problem is with us any time that the LSB doesn't have a link to the higher bits through a binary carry or borrow -- a situation that occurs for two q-levels out of every four. So the linearizing and de-correlating effect from the dithering process is now badly damaged, if not destroyed entirely. [1] We could have the analog zero crossing correspond to the threshold at 0x0000 and 0xffff, or we could center the encoded zero on the zero crossing, so that the analog trip point is +0.5 LSB for 0x0001, and -0.5 LSB for 0xffff. For symmetry, I chose the latter. In practice, the analog DC zero crossing may be nowhere near that repeatable. To return to our topic, the proper way to view the situation is that the signal is, well, the signal. It is a (e.g.) 16-bit word in which each bit is significant. And when we multiply that 16-bit word by another 16-bit word, for example, when performing a gaining operation, the result MUST be 32 bits in length in order to simultaneously maintain precision and avoid overflow. So then when we convert this 32-bit result back to 16 bits, we necessarily REQUANTIZE it. I used to program the Motorola DSP 56000, which had a 56-bit accumulator for massive overflow. I thought it was a nice machine. And again, just as in any quantization step, we must use some form of linearization (e.g., dither, dither with noise-shaping, etc.) if we want to maintain "resolution below the least-significant bit." I agree, totally. -- % Randy Yates % "How's life on earth? %% Fuquay-Varina, NC % ... What is it worth?" %%% 919-577-9882 % 'Mission (A World Record)', %%%% % *A New World Record*, ELO http://home.earthlink.net/~yatescr |
Reply |
|
Thread Tools | |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
The Role of the New Producer/Engineer? | Pro Audio | |||
Some Recording Techniques | Pro Audio | |||
Some Mixing Techniques | Pro Audio | |||
Fwd: Research Says Music Really Does Have Charms to Soothe the Savage Breast ... and So On.... | Audio Opinions | |||
Voluntary Collective Licensing of Music File Sharing | Pro Audio |