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
Tn(x)
Un(x)
Other discrete Chebyshev transforms involve related grids and coefficients of Chebyshev polynomials of the second, third, or fourth kinds.
The discrete chebyshev transform of u(x) at the points
{xn}
am=
pm | |
N |
N-1 | |
\sum | |
n=0 |
u(xn)Tm(xn)
where:
xn=-\cos\left(
\pi | (n+ | |
N |
1 | |
2 |
)\right)
am=
pm | |
N |
N-1 | |
\sum | |
n=0 |
u(xn)\cos\left(m\cos-1(xn)\right)
where
pm=1\Leftrightarrowm=0
pm=2
Using the definition of
xn
am=
pm | |
N |
N-1 | |
\sum | |
n=0 |
u(xn)\cos\left(
m\pi | (N+n+ | |
N |
1 | |
2 |
)\right)
am=
pm | |
N |
N-1 | |
\sum | |
n=0 |
u(xn)
| |||||
(-1) | (n+ |
1 | |
2 |
)\right)
and its inverse transform:
un
N-1 | |
=\sum | |
m=0 |
amTm(xn)
(This so happens to the standard Chebyshev series evaluated on the roots grid.)
un
N-1 | |
=\sum | |
m=0 |
am\cos\left(
m\pi | (N+n+ | |
N |
1 | |
2 |
)\right)
\thereforeun
N-1 | |
=\sum | |
m=0 |
am
| |||||
(-1) | (n+ |
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:
f = f(end:-1:1,:);A = size(f); N = A(1); if exist('A(3)', 'var') && A(3)~=1 for i=1:A(3) a(:,:,i) = sqrt(2/N) * dct(f(:,:,i)); a(1,:,i) = a(1,:,i) / sqrt(2); endelse a = sqrt(2/N) * dct(f(:,:,i)); a(1,:)=a(1,:) / sqrt(2);endThe 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:
a = idct(sqrt(N/2) * [a(1,:) * sqrt(2); a(2:end,:)]);
end
This transform uses the grid:
x | ||||
|
\right)
Tn(xm)=\cos\left(
\pimn | |
N |
+n\pi\right)=(-1)n\cos\left(
\pimn | |
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(xn)=un
N | |
=\sum | |
m=0 |
amTm(xn)
am=
pm | \left[ | |
N |
1 | |
2 |
(u0(-1)m+uN)+\sum
N-1 | |
n=1 |
unTm(xn)\right]
where
pm=1\Leftrightarrowm=0,N
pm=2
The primary uses of the discrete Chebyshev transform are numerical integration, interpolation, and stable numerical differentiation.[1] An implementation which provides these features is given in the C++ library Boost.[2]