Discrete Chebyshev transform

In applied mathematics, a discrete Chebyshev transform (DCT) is an analog of the discrete Fourier transform for a function of a real interval, converting in either direction between function values at a set of Chebyshev nodes and coefficients of a function in Chebyshev polynomial basis. Like the Chebyshev polynomials, it is named after Pafnuty Chebyshev.

The two most common types of discrete Chebyshev transforms use the grid of Chebyshev zeros, the zeros of the Chebyshev polynomials of the first kind $$ T_n (x) $$ and the grid of Chebyshev extrema, the extrema of the Chebyshev polynomials of the first kind, which are also the zeros of the Chebyshev polynomials of the second kind $$ U_n (x) $$. Both of these transforms result in coefficients of Chebyshev polynomials of the first kind.

Other discrete Chebyshev transforms involve related grids and coefficients of Chebyshev polynomials of the second, third, or fourth kinds.

Discrete Chebyshev transform on the roots grid
The discrete chebyshev transform of u(x) at the points $${x_n}$$ is given by:
 * $$ a_m =\frac{p_m}{N}\sum_{n=0}^{N-1} u(x_n) T_m (x_n) $$

where:


 * $$ x_n = -\cos\left(\frac{\pi}{N} (n+\frac{1}{2})\right)$$


 * $$ a_m = \frac{p_m}{N} \sum_{n=0}^{N-1} u(x_n) \cos\left(m \cos^{-1}(x_n)\right) $$

where $$ p_m =1 \Leftrightarrow m=0 $$ and $$ p_m = 2 $$ otherwise.

Using the definition of $$x_n $$,


 * $$ a_m =\frac{p_m}{N} \sum_{n=0}^{N-1} u(x_n) \cos\left(\frac{m\pi}{N}(N+n+\frac{1}{2}) \right)$$


 * $$ a_m =\frac{p_m}{N} \sum_{n=0}^{N-1} u(x_n) (-1)^m\cos\left(\frac{m\pi}{N}(n+\frac{1}{2}) \right)$$

and its inverse transform:


 * $$ u_n =\sum_{m=0}^{N-1} a_m T_m (x_n) $$

(This so happens to the standard Chebyshev series evaluated on the roots grid.)


 * $$ u_n =\sum_{m=0}^{N-1} a_m \cos\left(\frac{m\pi}{N}(N+n+\frac{1}{2}) \right) $$


 * $$\therefore u_n =\sum_{m=0}^{N-1} a_m (-1)^m\cos\left(\frac{m\pi}{N}(n+\frac{1}{2}) \right)$$

This can readily be obtained by manipulating the input arguments to a discrete cosine transform.

This can be demonstrated using the following MATLAB code:

The discrete cosine transform (dct) is in fact computed using a fast Fourier transform algorithm in MATLAB.

And the inverse transform is given by the MATLAB code:

Discrete Chebyshev transform on the extrema grid
This transform uses the grid:


 * $$ x_n=-\cos\left(\frac{n\pi}{N}\right)$$


 * $$ T_n (x_m) = \cos\left(\frac{\pi m n}{N}+n\pi\right)=(-1)^n \cos\left(\frac{\pi m n}{N}\right)$$

This transform is more difficult to implement by use of a Fast Fourier Transform (FFT). However it is more widely used because it is on the extrema grid which tends to be most useful for boundary value problems. Mostly because it is easier to apply boundary conditions on this grid.

In this case the transform and its inverse are


 * $$ u(x_n)=u_n =\sum_{m=0}^{N} a_m T_m (x_n) $$


 * $$ a_m =\frac{p_m}{N}\left[\frac{1}{2} (u_0 (-1)^m +u_N)+\sum_{n=1}^{N-1} u_n T_m (x_n)\right] $$

where $$ p_m =1 \Leftrightarrow m=0, N $$ and $$ p_m = 2 $$ otherwise.

Usage and implementations
The primary uses of the discrete Chebyshev transform are numerical integration, interpolation, and stable numerical differentiation. An implementation which provides these features is given in the C++ library Boost.