Deriving a formula for Discrete Cosine Transform from Discrete Fourier Transform

206 Views Asked by At

I'm trying to derive a formula for Discrete Cosine Transform (DCT) from Discrete Fourier Transform (DFT). I've been trying with Euler's formula $e^{ix} = \cos(x) + i\sin(x)$ and double angle formulas. I've been successful in deriving the DFT formula from Fourier Transform, but I'm struggling with DCT.

DFT: $$X_n = \sum_{k = 0}^{N - 1} X_k e^{-i \frac{2 \pi}{N}nk}$$
DCT: $$X_n = \sum_{k = 0}^{N - 1} X_k \cos\left[\frac{\pi}{N}\left(n + \frac{1}{2}\right)k\right]$$

Specifically, I'm trying to go from $e^{-i \frac{2 \pi}{N}nk}$ to $\cos\left[\frac{\pi}{N}\left(n + \frac{1}{2}\right)k\right]$ as mentioned in this link. However, I'm not sure about the scaling factor involved in setting the real parts of both.

Could someone provide a step-by-step derivation of the DCT formula or point me to resources for it? Any help would be appreciated.