Discrete Sine Transform
   HOME

TheInfoList



OR:

In
mathematics Mathematics is an area of knowledge that includes the topics of numbers, formulas and related structures, shapes and the spaces in which they are contained, and quantities and their changes. These topics are represented in modern mathematics ...
, the discrete sine transform (DST) is a
Fourier-related transform This is a list of linear transformations of functions related to Fourier analysis. Such transformations map a function to a set of coefficients of basis functions, where the basis functions are sinusoidal and are therefore strongly localized i ...
similar to the
discrete Fourier transform In mathematics, the discrete Fourier transform (DFT) converts a finite sequence of equally-spaced samples of a function into a same-length sequence of equally-spaced samples of the discrete-time Fourier transform (DTFT), which is a complex- ...
(DFT), but using a purely
real Real may refer to: Currencies * Brazilian real (R$) * Central American Republic real * Mexican real * Portuguese real * Spanish real * Spanish colonial real Music Albums * ''Real'' (L'Arc-en-Ciel album) (2000) * ''Real'' (Bright album) (2010) ...
matrix Matrix most commonly refers to: * ''The Matrix'' (franchise), an American media franchise ** ''The Matrix'', a 1999 science-fiction action film ** "The Matrix", a fictional setting, a virtual reality environment, within ''The Matrix'' (franchis ...
. It is equivalent to the imaginary parts of a DFT of roughly twice the length, operating on real data with
odd Odd means unpaired, occasional, strange or unusual, or a person who is viewed as eccentric. Odd may also refer to: Acronym * ODD (Text Encoding Initiative) ("One Document Does it all"), an abstracted literate-programming format for describing X ...
symmetry Symmetry (from grc, συμμετρία "agreement in dimensions, due proportion, arrangement") in everyday language refers to a sense of harmonious and beautiful proportion and balance. In mathematics, "symmetry" has a more precise definit ...
(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. 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 In mathematics, in the field of differential equations, a boundary value problem is a differential equation together with a set of additional constraints, called the boundary conditions. A solution to a boundary value problem is a solution to th ...
. The DST is related to the discrete cosine transform (DCT), which is equivalent to a DFT of real and ''even'' functions. See the DCT article for a general discussion of how the boundary conditions relate the various DCT and DST types. Generally, the DST is derived from the DCT by replacing the Neumann condition at ''x=0'' with a Dirichlet condition. Both the DCT and the DST were described by Nasir Ahmed T. Natarajan and K.R. Rao in 1974. The type-I DST (DST-I) was later described by Anil K. Jain in 1976, and the type-II DST (DST-II) was then described by H.B. Kekra and J.K. Solanka in 1978.


Applications

DSTs are widely employed in solving
partial differential equation In mathematics, a partial differential equation (PDE) is an equation which imposes relations between the various partial derivatives of a Multivariable calculus, multivariable function. The function is often thought of as an "unknown" to be sol ...
s by
spectral methods Spectral methods are a class of techniques used in applied mathematics and scientific computing to numerically solve certain differential equations. The idea is to write the solution of the differential equation as a sum of certain " basis functio ...
, where the different variants of the DST correspond to slightly different odd/even boundary conditions at the two ends of the array.


Informal overview

Like any Fourier-related transform, discrete sine transforms (DSTs) express a function or a signal in terms of a sum of
sinusoid A sine wave, sinusoidal wave, or just sinusoid is a mathematical curve defined in terms of the ''sine'' trigonometric function, of which it is the graph. It is a type of continuous wave and also a smooth periodic function. It occurs often in ma ...
s with different
frequencies Frequency is the number of occurrences of a repeating event per unit of time. It is also occasionally referred to as ''temporal frequency'' for clarity, and is distinct from ''angular frequency''. Frequency is measured in hertz (Hz) which is eq ...
and
amplitude The amplitude of a periodic variable is a measure of its change in a single period (such as time or spatial period). The amplitude of a non-periodic signal is its magnitude compared with a reference value. There are various definitions of amplit ...
s. Like the
discrete Fourier transform In mathematics, the discrete Fourier transform (DFT) converts a finite sequence of equally-spaced samples of a function into a same-length sequence of equally-spaced samples of the discrete-time Fourier transform (DTFT), which is a complex- ...
(DFT), a DST operates on a function at a finite number of discrete data points. The obvious distinction between a DST and a DFT is that the former uses only
sine function In mathematics, sine and cosine are trigonometric functions of an angle. The sine and cosine of an acute angle are defined in the context of a right triangle: for the specified angle, its sine is the ratio of the length of the side that is opp ...
s, while the latter uses both cosines and sines (in the form of
complex exponential The exponential function is a mathematical Function (mathematics), function denoted by f(x)=\exp(x) or e^x (where the argument is written as an exponentiation, exponent). Unless otherwise specified, the term generally refers to the positiv ...
s). However, this visible difference is merely a consequence of a deeper distinction: a DST implies different
boundary condition In mathematics, in the field of differential equations, a boundary value problem is a differential equation together with a set of additional constraints, called the boundary conditions. A solution to a boundary value problem is a solution to th ...
s than the DFT or other related transforms. The Fourier-related transforms that operate on a function over a finite
domain Domain may refer to: Mathematics *Domain of a function, the set of input values for which the (total) function is defined **Domain of definition of a partial function **Natural domain of a partial function **Domain of holomorphy of a function * Do ...
, such as the DFT or DST or a
Fourier series A Fourier series () is a summation of harmonically related sinusoidal functions, also known as components or harmonics. The result of the summation is a periodic function whose functional form is determined by the choices of cycle length (or ''p ...
, can be thought of as implicitly defining an ''extension'' of that function outside the domain. That is, once you write a function f(x) as a sum of sinusoids, you can evaluate that sum at any x, even for x where the original f(x) was not specified. The DFT, like the Fourier series, implies a periodic extension of the original function. A DST, like a sine transform, implies an
odd Odd means unpaired, occasional, strange or unusual, or a person who is viewed as eccentric. Odd may also refer to: Acronym * ODD (Text Encoding Initiative) ("One Document Does it all"), an abstracted literate-programming format for describing X ...
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. First, one has to specify whether the function is even or odd at ''both'' the left and right boundaries of the domain (i.e. the min-''n'' and max-''n'' boundaries in the definitions below, respectively). Second, one has to specify around ''what point'' the function is even or odd. In particular, consider a sequence (''a'',''b'',''c'') of three equally spaced data points, and say that we specify an odd ''left'' boundary. There are two sensible possibilities: either the data is odd about the point ''prior'' to ''a'', in which case the odd extension is (−''c'',−''b'',−''a'',0,''a'',''b'',''c''), or the data is odd about the point ''halfway'' between ''a'' and the previous point, in which case the odd extension is (−''c'',−''b'',−''a'',''a'',''b'',''c'') These choices lead to all the standard variations of DSTs and also discrete cosine transforms (DCTs). Each boundary can be either even or odd (2 choices per boundary) and can be symmetric about a data point or the point halfway between two data points (2 choices per boundary), for a total of 2\times2\times2\times2=16 possibilities. Half of these possibilities, those where the ''left'' boundary is odd, correspond to the 8 types of DST; the other half are the 8 types of DCT. 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 equation In mathematics, a partial differential equation (PDE) is an equation which imposes relations between the various partial derivatives of a Multivariable calculus, multivariable function. The function is often thought of as an "unknown" to be sol ...
s by
spectral method Spectral methods are a class of techniques used in applied mathematics and scientific computing to numerically solve certain differential equations. The idea is to write the solution of the differential equation as a sum of certain " basis functio ...
s, the boundary conditions are directly specified as a part of the problem being solved.


Definition

Formally, the discrete sine transform is a
linear Linearity is the property of a mathematical relationship (''function'') that can be graphically represented as a straight line. Linearity is closely related to '' proportionality''. Examples in physics include rectilinear motion, the linear r ...
, invertible
function Function or functionality may refer to: Computing * Function key, a type of key on computer keyboards * Function model, a structured representation of processes in a system * Function object or functor or functionoid, a concept of object-oriente ...
''F'' : R''N'' R''N'' (where R denotes the set of
real number In mathematics, a real number is a number that can be used to measure a ''continuous'' one-dimensional quantity such as a distance, duration or temperature. Here, ''continuous'' means that values can have arbitrarily small variations. Every real ...
s), or equivalently an ''N'' × ''N''
square matrix In mathematics, a square matrix is a matrix with the same number of rows and columns. An ''n''-by-''n'' matrix is known as a square matrix of order Any two square matrices of the same order can be added and multiplied. Square matrices are often ...
. There are several variants of the DST with slightly modified definitions. The ''N'' real numbers ''x''0,...,''x''''N'' − 1 are transformed into the ''N'' real numbers ''X''0,...,''X''''N'' − 1 according to one of the formulas:


DST-I

:X_k = \sum_^ x_n \sin \left frac \pi (n+1) (k+1) \right\quad \quad k = 0, \dots, N-1 The DST-I matrix is
orthogonal In mathematics, orthogonality is the generalization of the geometric notion of ''perpendicularity''. By extension, orthogonality is also used to refer to the separation of specific features of a system. The term also has specialized meanings in ...
(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. For example, a DST-I of ''N''=3 real numbers (''a'',''b'',''c'') is exactly equivalent to a DFT of eight real numbers (0,''a'',''b'',''c'',0,−''c'',−''b'',−''a'') (odd symmetry), scaled by 1/2. (In contrast, DST types II–IV involve a half-sample shift in the equivalent DFT.) This is the reason for the ''N'' + 1 in the denominator of the sine function: the equivalent DFT has 2(''N''+1) points and has 2π/2(''N''+1) in its sinusoid frequency, so the DST-I has π/(''N''+1) in its frequency. Thus, the DST-I corresponds to the boundary conditions: ''x''''n'' is odd around ''n'' = −1 and odd around ''n''=''N''; similarly for ''X''''k''.


DST-II

:X_k = \sum_^ x_n \sin \left frac \pi N \left(n+\frac\right) (k+1)\right\quad \quad k = 0, \dots, N-1 Some authors further multiply the ''X''''N'' − 1 term by 1/ (see below for the corresponding change in DST-III). This makes the DST-II matrix
orthogonal In mathematics, orthogonality is the generalization of the geometric notion of ''perpendicularity''. By extension, orthogonality is also used to refer to the separation of specific features of a system. The term also has specialized meanings in ...
(up to a scale factor), but breaks the direct correspondence with a real-odd DFT of half-shifted input. The DST-II implies the boundary conditions: ''x''''n'' is odd around ''n'' = −1/2 and odd around ''n'' = ''N'' − 1/2; ''X''''k'' is odd around ''k'' = −1 and even around ''k'' = ''N'' − 1.


DST-III

:X_k = \frac x_ + \sum_^ x_n \sin \left frac (n+1) \left(k+\frac\right) \right\quad \quad k = 0, \dots, N-1 Some authors further multiply the ''x''''N'' − 1 term by (see above for the corresponding change in DST-II). This makes the DST-III matrix
orthogonal In mathematics, orthogonality is the generalization of the geometric notion of ''perpendicularity''. By extension, orthogonality is also used to refer to the separation of specific features of a system. The term also has specialized meanings in ...
(up to a scale factor), but breaks the direct correspondence with a real-odd DFT of half-shifted output. The DST-III implies the boundary conditions: ''x''''n'' is odd around ''n'' = −1 and even around ''n'' = ''N'' − 1; ''X''''k'' is odd around ''k'' = −1/2 and odd around ''k'' = ''N'' − 1/2.


DST-IV

:X_k = \sum_^ x_n \sin \left frac \pi N \left(n+\frac\right) \left(k+\frac\right) \right\quad \quad k = 0, \dots, N-1 The DST-IV matrix is
orthogonal In mathematics, orthogonality is the generalization of the geometric notion of ''perpendicularity''. By extension, orthogonality is also used to refer to the separation of specific features of a system. The term also has specialized meanings in ...
(up to a scale factor). The DST-IV implies the boundary conditions: ''x''''n'' is odd around ''n'' = −1/2 and even around ''n'' = ''N'' − 1/2; similarly for ''X''''k''.


DST V–VIII

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. However, these variants seem to be rarely used in practice.


Inverse transforms

The inverse of DST-I is DST-I multiplied by 2/(''N'' + 1). The inverse of DST-IV is DST-IV multiplied by 2/''N''. 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. For example, some authors multiply the transforms by \sqrt so that the inverse does not require any additional multiplicative factor.


Computation

Although the direct application of these formulas would require O(''N''2) 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 A fast Fourier transform (FFT) is an algorithm that computes the discrete Fourier transform (DFT) of a sequence, or its inverse (IDFT). Fourier analysis converts a signal from its original domain (often time or space) to a representation in th ...
(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. In this way it follows that types II–IV of the DST require exactly the same number of arithmetic operations (additions and multiplications) as the corresponding DCT types.


References


Bibliography

* S. A. Martucci, "Symmetric convolution and the discrete sine and cosine transforms," ''IEEE Trans. Signal Process.'' SP-42, 1038–1051 (1994). * Matteo Frigo and Steven G. Johnson: ''FFTW'', http://www.fftw.org/. A free (
GPL The GNU General Public License (GNU GPL or simply GPL) is a series of widely used free software licenses that guarantee end users the four freedoms to run, study, share, and modify the software. The license was the first copyleft for general u ...
) C library that can compute fast DSTs (types I–IV) in one or more dimensions, of arbitrary size. Also M. Frigo and S. G. Johnson,
The Design and Implementation of FFTW3
" ''Proceedings of the IEEE'' 93 (2), 216–231 (2005). * Takuya Ooura: General Purpose FFT Package, http://www.kurims.kyoto-u.ac.jp/~ooura/fft.html. Free C & FORTRAN libraries for computing fast DSTs in one, two or three dimensions, power of 2 sizes. * {{Citation , last1=Press , first1=WH , last2=Teukolsky , first2=SA , last3=Vetterling , first3=WT , last4=Flannery , first4=BP , year=2007 , title=Numerical Recipes: The Art of Scientific Computing , edition=3rd , publisher=Cambridge University Press , location=New York , isbn=978-0-521-88068-8 , chapter=Section 12.4.1. Sine Transform , chapter-url=http://apps.nrbook.com/empanel/index.html#pg=621. * R. Chivukula and Y. Reznik,
Fast Computing of Discrete Cosine and Sine Transforms of Types VI and VII
" ''Proc. SPIE'' Vol. 8135, 2011. Discrete transforms Fourier analysis Indian inventions