2.8 DCT Notes
2.8 DCT Notes
Assume that the data array has finite rectangular support on then the 2-D DCT is given as
for
(4.3.1)
The DCT basis functions for size 8 x 8 are shown in Figure ( ). The mapping between the mathematical values and the
colors (gray levels) is the same as in the DFT case. Each basis function occupies a small square; the squares are then
arranged into as 8 x 8 mosaic. Note that unlike the DFT, where the highest frequencies occur near , the
, the highest frequencies of the DCT occur at the highest indices .
(4.3.2)
where the weighting function w(k) is given just as in the case of 1-D DCT by
(4.3.3)
From eqn (4.3.1), we see that the 2-D DCT is a separable operator. As such it can be applied to the rows and then the
columns, or vice versa. Thus the 2-D theory can be developed by repeated application of the 1-D theory. In the
following subsections we relate the 1-D DCT to 1-D DFT of a symmetrically extended sequence. This not only provides
an understanding of the DCT but also enables its fast calculation. We also present a fast DCT calculation that can
avoid the use of complex arithmetic in the usual case where x is a real-valued signal, e.g., an image. (Note: the next
two subsections can be skipped by the reader familiar with the 1-D DCT)
https://nptel.ac.in/content/storage2/courses/117104069/chapter_7/7_17.html 1/1
17/09/2020 Digital image processing
Review of 1- D DCT
In the 1-D case the DCT is defined as
(4.3.4)
for every N point signal having support The corresponding inverse transform, or IDCT, can be written
as
(4.3.5)
It turns out that this 1-D DCT can be understood in terms of the DFT of a symmetrically extended sequence,
(4.3.6)
This is not the only way to symmetrically extend x , but this method results in the most widely used DCT sometimes
called DCT-2 with support In fact, on defining the 2N point DFT we will show that
the DCT can be alternatively expressed as
(4.3.7)
Thus the DCT is just the DFT analysis of the symmetrically extended signal defined in (4.3.6):
Looking at this equation, we see that there is no overlap in its two components, which fit together without a gap. We can
see that right after comes at position , which is then followed by the rest of the nonzero part
of x in reverse order, upto , where sits .We can see a point of symmetry midway between
and N, i.e., at .
If we consider its periodic extension we will also see a symmetry about the point . We thus expect that
the 2N point will be real valued except for the phase factor . So the phase factor in eqn (4.3.7) is just what
is needed to cancel out the phase term in Y and make the DCT real , as it must if the two equations, (4.3.1) and (4.3.7),
are to agree for real valued inputs x.
To reconcile these two definitions, we start out with eqn (4.3.7), and proceed as follows:
https://nptel.ac.in/content/storage2/courses/117104069/chapter_7/7_18.html 1/2
17/09/2020 Digital image processing
the last line following from and Euler's relation, which agrees with the original
definition, eqn (4.3.4).
The formula for the inverse DCT, can be established similarly, starting out from
https://nptel.ac.in/content/storage2/courses/117104069/chapter_7/7_18.html 2/2
17/09/2020 Digital image processing
2) Energy conservations:
(4.3.8)
3) Symmetry:
Then the vector contains the unitary DCT, whose elements are given as
A unitary matrix is one whose inverse is the same as the transpose . For the unitary DCT, we have
which is a slight modification on the DCT Parseval relation (4.3.8). So the unitary DCT preserves the energy of the
signal x.
https://nptel.ac.in/content/storage2/courses/117104069/chapter_7/7_19.html 1/2
17/09/2020 Digital image processing
https://nptel.ac.in/content/storage2/courses/117104069/chapter_7/7_19.html 2/2
17/09/2020 Power System Analysis
and this holds true for arbitrary values of the parameter . We can relate this matrix Q to the inverse covariance
matrix of a 1-D first-order stationary Markov random sequence, with correlation coefficient necessarily satisfying
where and . The actual covariance matrix of the Markov random sequence
is
It can further be shown that when , , so that eigenvectors approximate each other too. Because the
eigenvectors of a matrix and its inverse are the same, we then have the fact that the unitary DCT basis vectors
approximate the Karhunen-Loeve expansion, with basis vectors given as the solution to the matrix-vector equation,
https://nptel.ac.in/content/storage2/courses/117104069/chapter_7/7_20.html 1/2
17/09/2020 Power System Analysis
Thus the 1-D DCT of a first-order Markov random vector of dimension N should be close to the KLT of x when its
correlation coefficient This ends the review of the 1-D DCT.
https://nptel.ac.in/content/storage2/courses/117104069/chapter_7/7_20.html 2/2
17/09/2020 Digital image processing
is just the separable operator resulting from application of the 1-D DCT along first one dimension and then the other,
the order being immaterial, we can easily extend the 1-D DCT properties to the 2-D case. In terms of the connection of
the 2-D DCT with the 2-DFT, we thus see that we must symmetrically extend in, say, the horizontal direction and then
symmetrically extend that result in the vertical direction. The resulting symmetric function (extension) becomes
The symmetry is about the lines and then from (4.3.7), it follows that the 2-D DCT is given in terms of
Comments
• We see that both the 1-D and 2-D DCTs involve only real arithmetic for real-valued data, and this may be important in
some applications.
• The symmetric extension property can be expected to result in fewer high frequency coefficients in DCT with respect
to DFT. Such would be expected for lowpass data, since there would often be a jump at the four edges of the
period of the corresponding periodic sequence which is not consistent with small high- frequency
coefficients in the DFS or DFT. Thus the DCT is attractive for lossy data storage applications, where the exact value of
the data is not of paramount importance.
• The DCT can be used for a symmetrical type of filtering with a symmetrical filter.
https://nptel.ac.in/content/storage2/courses/117104069/chapter_7/7_21.html 1/1