Dither examples
来源:百度文库 编辑:神马文学网 时间:2024/06/30 21:15:13
Dither examples
There 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 samplingrate of 32.768 kHz. I realize that this is a strange sampling rate, butit made the graphs cleaner for the FFT analyses. The total length ofthe sine wave was 32768 samples (therefore 1 second of audio.) MATLABtypically calculates in 64-bit floating point, so we have lots ofresolution for analyzing an 8-bit signal, as I'm doing here.
To make the dither, I used the MATLAB function for generatingrandom numbers called RAND. The result of this is a number between 0and 1 inclusive. The PDF of the function is rectangular as we'll seebelow.
RPDF dither should have a rectangular probability densityfunction with extremes of -0.5 and 0.5 LSB's. Therefore, a value ofmore than half of an LSB is not possible in either the positive ornegative directions. To make RPDF dither, I made a vector of 32768numbers 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.
![](http://image2.360doc.cn/DownloadImg/2008/12/10/74585_2094612_2.png)
![](http://image2.360doc.cn/DownloadImg/2008/12/10/74585_2094612_3.png)
TPDF dither has the highest probability of being 0, and a 0 probabilityof being either less than -1 LSB or more than 1 LSB. This can be madeby 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'resubtracted here is to produce a TPDF that ranges from -1 to 1 LSB.
![](http://image2.360doc.cn/DownloadImg/2008/12/10/74585_2094612_4.png)
![](http://image2.360doc.cn/DownloadImg/2008/12/10/74585_2094612_5.png)
Let's look at the results of three options: no dither, RPDF dither and TPDF dither. Figure 8.23shows a frequency analysis of 4 signals (from top to bottom): (1) a64-bit 1 kHz sine wave, (2) an 8-bit quantized version of the sine wavewithout dither added, (3) an 8-bit quantized version with RPDF addedand (4) an 8-bit quantized version with TPDF added.
![](http://image2.360doc.cn/DownloadImg/2008/12/10/74585_2094612_6.png)
One of the important things to notice here is that, although thedithers raised the overall noise floor of the signal, the resultingartifacts are wide-band noise, rather than spikes showing up atharmonic intervals as can be seen in the no-dither plot. If we were tolook at the artifacts without the original 1 kHz sine wave, we get aplot as shown in Figure 8.24.
![](http://image2.360doc.cn/DownloadImg/2008/12/10/74585_2094612_7.png)