Digital Signal Processing Reference
In-Depth Information
electrical engineering. In transform coding, we can quantize the DCT coefficients and encode them
into binary information. The inverse DCT can transform the DCT coefficients back to the input data.
Let us proceed to Examples 11.8 and 11.9.
EXAMPLE 11.8
Assume that the following input data can each be encoded by 5 bits, including a sign bit:
xð0Þ¼10; xð1Þ¼8; xð2Þ¼10 and xð3Þ¼12
a. Determine the DCT coefficients.
b. Use the MATLAB function dct() to verify all the DCT coefficients.
Solution:
a. Using Equation (11.29) leads to
r CðkÞ
1
2
xð0Þ cos
p k
8
3p k
8
5p k
8
7p k
8
X DCT ðkÞ¼
þ xð1Þ cos
þ xð2Þ cos
þ xð3Þ cos
When k ¼ 0, we see that the DC component is calculated as
r Cð0Þ
1
2
xð0Þ cos
p 0
8
3p 0
8
5p 0
8
7p 0
8
X DCT ð0Þ¼
þ xð1Þ cos
þ xð2Þ cos
þ xð3Þ cos
r
1
2
p
2 ½xð0Þþxð1Þþxð2Þþxð3Þ ¼ 1
¼
2 ð10 þ 8 þ 10 þ 12Þ¼20
We clearly see that the first DCT coefficient is a scaled average value.
For k ¼ 1,
r Cð1Þ
1
2
xð0Þ cos
p 1
8
3p 1
8
5p 1
8
7p 1
8
X DCT ð1Þ¼
þ xð1Þ cos
þ xð2Þ cos
þ xð3Þ cos
r
1
2
3p
8
5p
8
7p
8
10 cos p
8
¼
1
þ 8 cos
þ 10 cos
þ 12 cos
¼1:8478
Similarly, we have
X DCT ð2Þ¼2 and X DCT ð3Þ¼0:7654
b. Using the MATLAB 1D-DCT function dct(), we can verify the DCT coeffcients:
>> dct([10 8 10 12])
ans ¼ 20.0000 1.8478 2.0000 0.7654
EXAMPLE 11.9
Assume the following DCT coefficients:
X DCT ð0Þ¼20; X DCT ð1Þ¼1:8478; X DCT ð0Þ¼2;
and
X DCT ð0Þ¼0:7654
a. Determine xð0Þ.
b. Use the MATLAB function idct() to verify all the recovered data samples.
Solution:
a. Applying Equations (11.30) and (11.31) , we have
Search WWH ::




Custom Search