
308 Discrete Cosine Transform
Example 15.1 Compute the DCT,
X
ct
{k),
of x(n) =
{2,1,0,3}.
Com-
pute x(n) back from Xctik).
Solution
Form the sequence xo(n) =
{2,0,3,1}.
Compute the DFT of xo(n), XO(k) —
{6,
—1
+
j,
4,
—1 —
j}. The twiddle factors are
Wfe = {1,0.92 - jO.38,0.71 - jO.71,0.38 - j'0.92}
Multiplying XO(k), term by term, by
W*Q
and taking the real parts, we
get {6.0,-0.54,2.83,-1.31}. A more efficient procedure for this step is
as follows. As the DFT is conjugate-symmetric, if XO(k) = a + jb, then
XO(N
—
k) = a
—
jb. The twiddle factors are related in the following way.
If W*
N
= c + jd, then W\
N
~ = —d
—
jc. Therefore, the products are
related.
(a+jb)(c + jd) = (ac-bd)+j(ad + bc)
(a
—
jb)(—d
—
jc) =
—
(ad + be)
—
j (ac
—
bd)
The imaginary part of the product
W%
N
XO(k)
in the first half is the nega-
tive of the value of the real part with index N
—
k. Therefore, multiplication
with the twiddle factors over half the range is sufficient. Now,
X^k)
= C(fc){6.0, -0.54,2.83, -1.31} = {3.0, -0.38,2.0, -0.92}
The inverse: We trace the steps backwards. Multiply X
c
tik) by constants
for
A;
= 0 and J\ for other values of k to get {1.5,
-0.27,1.41,
-0.65}.
Due to the property mentioned above, the complex signal, W*
6
XOik), can
be constructed with a scale factor as
{1.5,
-0.27 + jO.65,1.41 -
jl.41,
-0.65 + jO.27}
Now, XOik) can be computed with a scale factor as
^{1.5,
-0.27 + jO.65,1.41 -
jl.41,
-0.65 + jO.27}
= {1.5, -0.50 + jO.50,2, -0.50 - jO.50}
These values have been normalized for DCT. For taking the IDFT the first
value must be multiplied by JV = 4 and other values by y = 2 (Note
that the number of multiplication by constants can be minimized in the
implementation of the algorithm.) to get XOik) = {6, -1 + j,4, -1
—
j}.
Computing the IDFT of XOik), we get xoin) =
{2,0,3,1}.
The first half
vT