Discrete sine transform

It is equivalent to the imaginary parts of a DFT of roughly twice the length, operating on real data with odd symmetry (since the Fourier transform of a real and odd function is imaginary and odd), where in some variants the input and/or output data are shifted by half a sample.

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

[4] 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.

Like any Fourier-related transform, discrete sine transforms (DSTs) express a function or a signal in terms of a sum of sinusoids with different frequencies and amplitudes.

The Fourier-related transforms that operate on a function over a finite domain, such as the DFT or DST or a Fourier series, can be thought of as implicitly defining an extension of that function outside the domain.

The DFT, like the Fourier series, implies a periodic extension of the original function.

A DST, like a sine transform, implies an odd extension of the original function.

However, because DSTs operate on finite, discrete sequences, two issues arise that do not apply for the continuous sine transform.

In particular, consider a sequence (a,b,c) of three equally spaced data points, and say that we specify an odd left boundary.

These different boundary conditions strongly affect the applications of the transform, and lead to uniquely useful properties for the various DCT types.

Most directly, when using Fourier-related transforms to solve partial differential equations by spectral methods, the boundary conditions are directly specified as a part of the problem being solved.

Formally, the discrete sine transform is a linear, invertible function F : RN -> RN (where R denotes the set of real numbers), or equivalently an N × N square matrix.

The N real numbers x0,...,xN − 1 are transformed into the N real numbers X0,...,XN − 1 according to one of the formulas: The DST-I matrix is orthogonal (up to a scale factor).

A DST-I is exactly equivalent to a DFT of a real sequence that is odd around the zero-th and middle points, scaled by 1/2.

(In contrast, DST types II–IV involve a half-sample shift in the equivalent DFT.)

Some authors further multiply the XN − 1 term by 1/√2 (see below for the corresponding change in DST-III).

This makes the DST-II matrix orthogonal (up to a scale factor), but breaks the direct correspondence with a real-odd DFT of half-shifted input.

Some authors further multiply the xN − 1 term by √2 (see above for the corresponding change in DST-II).

This makes the DST-III matrix orthogonal (up to a scale factor), but breaks the direct correspondence with a real-odd DFT of half-shifted output.

The DST-IV implies the boundary conditions: xn is odd around n = −1/2 and even around n = N − 1/2; similarly for Xk.

DST types I–IV are equivalent to real-odd DFTs of even order.

In principle, there are actually four additional types of discrete sine transform (Martucci, 1994), corresponding to real-odd DFTs of logically odd order, which have factors of N+1/2 in the denominators of the sine arguments.

The inverse of DST-II is DST-III multiplied by 2/N (and vice versa).

As for the DFT, the normalization factor in front of these transform definitions is merely a convention and differs between treatments.

Although the direct application of these formulas would require O(N2) operations, it is possible to compute the same thing with only O(N log N) complexity by factorizing the computation similar to the fast Fourier transform (FFT).

(One can also compute DSTs via FFTs combined with O(N) pre- and post-processing steps.)

A DST-III or DST-IV can be computed from a DCT-III or DCT-IV (see discrete cosine transform), respectively, by reversing the order of the inputs and flipping the sign of every other output, and vice versa for DST-II from DCT-II.

A family of transforms composed of sine and sine hyperbolic functions exists; these transforms are made based on the natural vibration of thin square plates with different boundary conditions.

Illustration of the implicit even/odd extensions of DST input data, for N =9 data points (red dots), for the four most common types of DST (types I–IV).