A related transform is the discrete cosine transform (DCT), which is equivalent to a DFT of real and even functions.

Formally, the discrete sine transform is a linear, invertible function F : R^{n} > R^{n} (where R denotes the set of real numbers). There are several variants of the DST with slightly modified definitions. The n real numbers x_{0}, ...., x_{n1} are transformed into the n real numbers f_{0}, ..., f_{n1} according to one of the formulas:
A DSTI of n=3 real numbers abc is exactly equivalent to a DFT of eight real numbers 0abc0(c)(b)(a) (odd symmetry). (In contrast, DST types IIIV involve a halfsample shift in the equivalent DFT.)
Thus, the DSTI corresponds to the boundary conditions: x_{k} is odd around k=1 and odd around k=n; similarly for f_{j}.
\sum_{k=0}^{n1} x_k \sin \left[\frac{\pi}{n} (j+1) (k+1/2) \right]</math>
Some authors further multiply the f_{n1} term by 1/√2 (see below for the corresponding change in DSTIII); this does not affect the basic properties, but breaks the direct correspondence with a realodd DFT of halfshifted input.
The DSTII implies the boundary conditions: x_{k} is odd around k=1/2 and odd around k=n1/2; f_{j} is odd around j=1 and even around j=n1.
\sum_{k=0}^{n2} x_k \sin \left[\frac{\pi}{n} (j+1/2) (k+1) \right]</math>
Some authors further multiply the x_{n1} term by √2 (see above for the corresponding change in DSTII); this does not affect the basic properties, but breaks the direct correspondence with a realodd DFT of halfshifted output.
The DSTIII implies the boundary conditions: x_{k} is odd around k=1 and even around k=n1; f_{j} is odd around j=1/2 and odd around j=n1/2.
\sum_{k=0}^{n1} x_k \sin \left[\frac{\pi}{n} (j+1/2) (k+1/2) \right]</math>
The DSTIV implies the boundary conditions: x_{k} is odd around k=1/2 and even around k=n1/2; similarly for f_{j}.
In principle, there are actually four additional types of discrete sine transform (Martucci, 1994), corresponding to realodd DFTs of logically odd order, which have factors of n+1/2 in the denominators of the sine arguments. However, these variants seem to be rarely used in practice.
The inverse of DSTI is DSTI multiplied by 2/(n+1). The inverse of DSTIV is DSTIV multiplied by 2/n. The inverse of DSTII is DSTIII multiplied by 2/n (and vice versa).
Like for the DFT, the normalization factor in front of these transform definitions is merely a convention and differs between treatments. For example, some authors multiply the transforms by <math>\sqrt{2/n}</math> so that the inverse does not require any additional multiplicative factor.
Although the direct application of these formulas would require O(n^{2}) operations, as in the fast Fourier transform (FFT) it is possible to compute the same thing with only O(n log n) complexity by factorizing the computation. (One can also compute DSTs via FFTs combined with O(n) pre and postprocessing steps.)
DSTs are widely employed in solving partial differential equations by spectral methods, where the different variants of the DST correspond to slightly different odd/even boundary conditions at the two ends of the array.
Search Encyclopedia

Featured Article
