Dither examplesThere are three typical dither PDF's used in PCM digital audio, RPDF, TPDF (triangular PDF) and Gaussian PDF. We'll look at the first two. For this section, I used MATLAB to make a sine wave with a sampling rate of 32.768 kHz. I realize that this is a strange sampling rate, but it made the graphs cleaner for the FFT analyses. The total length of the sine wave was 32768 samples (therefore 1 second of audio.) MATLAB typically calculates in 64-bit floating point, so we have lots of resolution for analyzing an 8-bit signal, as I'm doing here. To make the dither, I used the MATLAB function for generating random numbers called RAND. The result of this is a number between 0 and 1 inclusive. The PDF of the function is rectangular as we'll see below. RPDF dither should have a rectangular probability density function with extremes of -0.5 and 0.5 LSB's. Therefore, a value of more than half of an LSB is not possible in either the positive or negative directions. To make RPDF dither, I made a vector of 32768 numbers using the command RAND(1, n) - 0.5 where is the length of the dither signal, in samples. The result is equivalent to white noise.
TPDF dither has the highest probability of being 0, and a 0 probability of being either less than -1 LSB or more than 1 LSB. This can be made by adding two random numbers, each with an RPDF together. Using MATLAB, this is most easily done using the the command RAND(1, n) - RAND(1, n) where is the length of the dither signal, in samples. The reason they're subtracted here is to produce a TPDF that ranges from -1 to 1 LSB.
Let's look at the results of three options: no dither, RPDF dither and TPDF dither. Figure 8.23 shows a frequency analysis of 4 signals (from top to bottom): (1) a 64-bit 1 kHz sine wave, (2) an 8-bit quantized version of the sine wave without dither added, (3) an 8-bit quantized version with RPDF added and (4) an 8-bit quantized version with TPDF added.
One of the important things to notice here is that, although the dithers raised the overall noise floor of the signal, the resulting artifacts are wide-band noise, rather than spikes showing up at harmonic intervals as can be seen in the no-dither plot. If we were to look at the artifacts without the original 1 kHz sine wave, we get a plot as shown in Figure 8.24.
|
|