Is DCT differentiable? I.e. is $\frac{\mathrm{d}\mathrm{DCT}(x)}{\mathrm{d} x}$ defined?

I've seen a few implementations in automatic differentiation software packages, so I suppose the answer is positive, but I'm still missing a mathematical proof.


1 Answer 1


The Discrete Cosine Transform of a discrete sequence $x$ can be defined as:

$$ {\tt DCT(}x{\tt )} = X_k = \frac{1}{2} (x_0 + (-1)^k x_{N-1}) + \sum_{n=1}^{N-2} x_n \cos \left[\frac{\pi}{N-1} n k \right] \quad \quad k = 0, \dots, N-1. $$

If, by differentiable, you mean: $$ \frac{\partial {\tt DCT(}x{\tt )}}{\partial x} $$ then isn't it just $$ \frac{\partial {\tt DCT(}x{\tt )}}{\partial x} = \frac{\partial X_k}{\partial x} =\left [ \begin{array}{ccccc} \frac{1}{2} & \cdots & \cos \left[\frac{\pi}{N-1} n k \right] & \cdots & (-1)^k\frac{1}{2} \end{array} \right ] $$ where $x = [ x_0, x_1, \ldots, x_{N-2}, x_{N-1} ]^T$ ?

What do you mean by a "mathematical proof"?


Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.