Beruflich Dokumente
Kultur Dokumente
1
It is computationally easier to implement and more Why DCT not FFT?
efficient to regard the DCT as a set of basis functions • DCT is similar to the Fast Fourier Transform (FFT), but
which given a known input array size (8 x 8) can be can approximate lines well with fewer coefficients.
precomputed and stored.
This involves simply
computing values for a
convolution mask (8 x8
window) that get applied.
The values as simply
calculated from the DCT
formula. The 64 (8 x 8)
DCT basis functions are
illustrated in Fig.
• The N- point DFT X [k ] of a length-N real sequence is a • It is of interest to have orthogonal transform that represent
complex sequence satisfying the symmetry condition a real time-domain sequence X[k].
X [k ] = X *[( k ) N ]. • Several such orthogonal transforms have been developed
with each having certain attractive properties.
• For N even, the DFT samples X(0) and X[(N-2)/2] are real Definition
and distinct. The remaining N-2 DFT samples are complex,
and only half of these samples are distinct as the rest are • DFT of a real symmetric or antisymmetric finite length
complex conjugates of these samples. sequence is a product of a linear-phase term and a real
amplitude function.
• For N odd, the DFT sample X[0] is real, and the remaining • One class of real orthogonal transforms is based on
N-1 DFT samples are complex, of which only half of these converting an arbitrary sequence into either a symmetric or
samples are distinct as the rest are complex conjugates of an antisymmetric sequence and then extracting the real
these samples. orthogonal transform coefficients from the DFT of the
generated sequence with geometric symmetry.
• As a result, there is a redundancy in the DFT-based
frequency-domain representation of a discrete time sequence.
• The transforms developed via this approach are called • To develop a symmetric or antisymmetric sequence by
Discrete Cosine Transform, often abbreviated as DCT and periodic extension from a specified finite length sequence,
discrete sine transforms often abbreviated as DST. the above type of symmetry or antisymmetry can be
applied at each end of the given sequence.
• There are four types of finite length sequences exhibiting
geometric symmetry, depending on the location of the • This results in 16 distinct types of periodic extensions, of
point of symmetry or antisymmetry : which 8 extensions will be symmetric-periodic leading to 8
different types of DCTs, and 8 extensions will be
antisymmetric-periodic, leading to 8 different types of
• 1) whole sample symmetry (WS) DSTs.
2) whole sample antisymmetry (WA)
3) half-sample symmetry (HS) • Here we consider only the symmetric periodic extensions.
4) Half sample antisymmetry (HA)
2
x[n]
xWSHS [n]
xHSWS [n]
• To develop the expression for the Discrete Cosine
Transform, for each of the above symmetric periodic
sequences, we first extract one period from each.
{x[n]} = {a b c d},
• Likewise to develop the Type-2 Discrete Cosine Transform, • Let x[n] be a length-N sequence defined for 0 ≤ n ≤ N − 1.
we extract one period y[n] of the symmetric periodic • First x[n] is extended to a length 2N sequence by zero
sequence padding:
x HSHS [n].
⎧ x[ n], 0 ≤ n ≤ N −1
• For the length-4 sequence given above, the extracted period is xe [n] = ⎨
given by, ⎩0 N ≤ n ≤ 2 N − 1.
{y[n]} = {a b c d d c b a}
• Next a Type-2 symmetric sequence y[n] of length 2N is
• The DCT is then determined from the DFT of y[n]. formed from xe [n] according to
y[n] = xe [ n] + xe [2 N − 1 − n]. 0 ≤ n ≤ 2 N − 1.
• As the Type-2 DCT has been employed in a in a number of ⎧ x[n], 0 ≤ n ≤ N − 1,
international standards for image and video compression, such =⎨
as JPEG, MPEG and H.261, because of its better energy ⎩ x[2n − 1 − n]. N ≤ n ≤ 2 N − 1. .....(1)
compaction property, we consider here only this type of DCT,
Also called the even symmetrical discrete cosine transform.
3
• Note from (1), that the generated sequence y[n] satisfies • By making a change of variables, the DFT Y[k] can be
the symmetry property expressed as..
y[n] = y[2n –1 – n]. N −1 N −1
• The 2N point DFT Y[k] of the length-2N sequence y[n] is Y [k ] = ∑ x[n] W2knN + ∑ x[n] W − kn
2N W2kN(2 N −1)
n =0 n =0
thus … N −1
2 N −1 = W2−Nk / 2 ∑ x[n] (W2knNW2kN/ 2 + W2−NknW2−Nk / 2 )
Y [k ] = ∑ y[n] W kn
2N , 0 ≤ k ≤ 2 N − 1. n =0
n =0 N −1
⎛ π k (2n + 1) ⎞
• We can rewrite the above eqn. As…. X DCT [k ] = ∑ 2 x[n] cos ⎜ ⎟, 0 ≤ k ≤ 2 N − 1.
N −1 2 N −1
n =0 ⎝ 2N ⎠
Y [k ] = ∑ y[n] W2knN + ∑ y[n] W kn
2N
n =0 n= N • The Type 2N-point discrete cosine transform (DCT), X DCT [k ]
N −1
= W2−Nk / 2 ∑ x[n] (W2knNW2kN/2 + W2−NknW2−Nk /2 ) of the length-N sequence x[n] is obtained from the above
k /2
n=0 expression by extractingWthe : N samples of Y[k] and
2 N first
N −1
⎛ π k (2n + 1) ⎞
X DCT [k ] = ∑ 2 x[n] cos ⎜ ⎟, 0 ≤ k ≤ N − 1. • Above eqns. Constitute a discrete cosine transform pair for
n=0 ⎝ 2N ⎠ the sequence x[n], where the first one is the Analysis eqn.
And the second one is the Synthesis eqn.
• Note that the samples of X DCT [k ] are real for a real
sequence x[n]. • A DCT pair may often be denoted as …
• The inverse discrete cosine transform (IDCT) of an N- DCT
point X DCT [k ] is given by … x[n] ↔ X DCT [k ].
1 N −1 ⎛ π k (2n + 1) ⎞
x[n] = ∑ α [k ] X DCT [k ] cos ⎜⎝ 2 N ⎟⎠ ,
N n =0
0 ≤ n ≤ N − 1.
• Where…
⎧1
⎪ , k = 0,
α [k ] = ⎨ 2
⎪⎩1, 1 ≤ k ≤ N − 1.
THANK YOU