DSPRelated.com
Forums

why DCT

Started by Neo May 3, 2005
glen herrmannsfeldt wrote:
> The book by Rao and Hwang, "Techniques and Standards for Image,
Video,
> and Audio Coding" has a description of the four DCT's. That is, with > the forward and inverse samples at integer or half integer points.
Actually, there are eight DCTs, although only four are commonly used. This is easy to see if you realize that DCTs are just real-even DFTs with optional half-sample shifts in the input and/or output. There are 4 possible half-sample shifts, and the "logical" DFT can have a length that is either even (DCTs I-IV) or odd (DCTs V-VIII). Steven G. Johnson
<stevenj@alum.mit.edu> wrote in message
news:1115834505.261753.4620@g49g2000cwa.googlegroups.com...

> Actually, there are eight DCTs, although only four are commonly used. > This is easy to see if you realize that DCTs are just real-even DFTs > with optional half-sample shifts in the input and/or output. There are > 4 possible half-sample shifts, and the "logical" DFT can have a length > that is either even (DCTs I-IV) or odd (DCTs V-VIII).
OK, this is just one of DSP things I just don't get, so please educate me: Transform Cosine argument Normalized DCT-1 j*k*pi/(N-1) j*k*2*pi/(2*N-2) DCT-2 (j+1/2)*k*pi/N (2*j+1)*k*2*pi/(4*N) DCT-3 j*(k+1/2)*pi/N j*(2*k+1)*2*pi/(4*N) DCT-4 (j+1/2)*(k+1/2)*pi/N (2*j+1)*(2*k+1)*2*pi/(8*N) DCT-5 j*k*pi/(N-1/2) j*k*2*pi/(2*N-1) DCT-6 (j+1/2)*k*pi/(N-1/2) (2*j+1)*k*2*pi/(4*N-2) DCT-7 j*(k+1/2)*pi/(N-1/2) j*(2*k+1)*2*pi/(4*N-2) DCT-8 (j+1/2)*(k+1/2)*pi/(N+1/2) (2*j+1)*(2*k+1)*2*pi/(8*N+4) If you normalize the numerator and denominator of the arguments of the cosines in the various transforms so that the numerator is the product of integers times 2*pi, as would be the case in the associated DFT, only the DCT-5 has an odd denominator. DCTs 6 & 7 seem to come from DFTs that have order twice an odd number and DCT-8 from order 4X an odd number, but I don't see the odd order DFT associated with these orders. -- write(*,*) transfer((/17.392111325966148d0,6.5794487871554595D-85, & 6.0134700243160014d-154/),(/'x'/)); end
Sorry, I should have said an odd-order *generalized* DFT (the GDFT
includes arbitrary shifts in the input/output indices).  To express the
half-sample shifts in terms of an ordinary DFT, as you noticed, you
need to multiply by 2 or 4.

e.g. the DCT-4 and DCT-8 correspond to what is sometimes called an "O^2
DFT", i.e. half-sample shifts in the input and output, for which to
convert to a regular DFT you have to multiply N by 4 and interleave
with zeros.

Steven