Open main menu
Home
Random
Recent changes
Special pages
Community portal
Preferences
About Wikipedia
Disclaimers
Incubator escapee wiki
Search
User menu
Talk
Dark mode
Contributions
Create account
Log in
Editing
Discrete sine transform
Warning:
You are not logged in. Your IP address will be publicly visible if you make any edits. If you
log in
or
create an account
, your edits will be attributed to your username, along with other benefits.
Anti-spam check. Do
not
fill this in!
{{Short description|Transform in mathematics}} In [[mathematics]], the '''discrete sine transform (DST)''' is a [[List of Fourier-related transforms|Fourier-related transform]] similar to the [[discrete Fourier transform]] (DFT), but using a purely [[real number|real]] [[matrix (mathematics)|matrix]]. It is equivalent to the imaginary parts of a DFT of roughly twice the length, operating on real data with [[even and odd functions|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. 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 boundary condition|Neumann condition]] at ''x''=0 with a [[Dirichlet condition]].<ref>{{cite book |last1=Britanak |first1=Vladimir |last2=Yip |first2=Patrick C. |last3=Rao |first3=K. R. |author3-link=K. R. Rao |title=Discrete Cosine and Sine Transforms: General Properties, Fast Algorithms and Integer Approximations |date=2010 |publisher=[[Elsevier]] |isbn=9780080464640 |pages=35β6 |url=https://books.google.com/books?id=iRlQHcK-r_kC&pg=PA35}}</ref> Both the DCT and the DST were described by [[Nasir Ahmed (engineer)|Nasir Ahmed]], T. Natarajan, and [[K.R. Rao]] in 1974.<ref name="pubDCT">{{Citation |first1=Nasir |last1=Ahmed |author1-link=N. Ahmed |first2=T. |last2=Natarajan |first3=K. R. |last3=Rao |title=Discrete Cosine Transform |journal=IEEE Transactions on Computers |date=January 1974 |volume=C-23 |issue=1 |pages=90β93 |doi=10.1109/T-C.1974.223784 |s2cid=149806273 |url=https://www.ic.tu-berlin.de/fileadmin/fg121/Source-Coding_WS12/selected-readings/Ahmed_et_al.__1974.pdf}}</ref><ref name="Ahmed">{{cite journal |last=Ahmed |first=Nasir |author-link=N. Ahmed |title=How I Came Up With the Discrete Cosine Transform |journal=[[Digital Signal Processing (journal)|Digital Signal Processing]] |date=January 1991 |volume=1 |issue=1 |pages=4β5 |doi=10.1016/1051-2004(91)90086-Z |bibcode=1991DSP.....1....4A |url=https://www.scribd.com/doc/52879771/DCT-History-How-I-Came-Up-with-the-Discrete-Cosine-Transform|url-access=subscription }}</ref> The type-I DST (DST-I) was later described by [[Anil K. Jain (electrical engineer, born 1946)|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.<ref>{{cite journal |last1=Dhamija |first1=Swati |last2=Jain |first2=Priyanka |title=Comparative Analysis for Discrete Sine Transform as a suitable method for noise estimation |journal=International Journal of Computer Science |date=September 2011 |volume=8 |issue=5 |pages=162β164 |url=https://www.researchgate.net/publication/267228857 |access-date=4 November 2019 |via=ResearchGate}}</ref> ==Applications== DSTs are widely employed in solving [[partial differential equation]]s 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. ==Informal overview== [[Image:DST-symmetries.svg|thumb|right|350px|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).]] Like any Fourier-related transform, discrete sine transforms (DSTs) express a function or a signal in terms of a sum of [[sinusoid]]s with different [[frequencies]] and [[amplitude]]s. Like the [[discrete Fourier transform]] (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]]s, while the latter uses both cosines and sines (in the form of [[complex exponential]]s). However, this visible difference is merely a consequence of a deeper distinction: a DST implies different [[boundary condition]]s than the DFT or other related transforms. The Fourier-related transforms that operate on a function over a finite [[domain of a function|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. That is, once you write a function <math>f(x)</math> as a sum of sinusoids, you can evaluate that sum at any <math>x</math>, even for <math>x</math> where the original <math>f(x)</math> was not specified. The DFT, like the Fourier series, implies a [[periodic function|periodic]] extension of the original function. A DST, like a [[Sine and cosine transforms|sine transform]], implies an [[even and odd functions|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. 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 transform]]s (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 <math>2 \times 2 \times 2 \times 2 = 16</math> 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]]s by [[spectral method]]s, the boundary conditions are directly specified as a part of the problem being solved. ==Definition== Formally, the discrete sine transform is a [[linear]], invertible [[function (mathematics)|function]] ''F'' : '''R'''<sup>''N''</sup> {{mono|->}} '''R'''<sup>''N''</sup> (where '''R''' denotes the set of [[real number]]s), or equivalently an ''N'' × ''N'' [[square matrix]]. There are several variants of the DST with slightly modified definitions. The ''N'' real numbers ''x''<sub>0</sub>,...,''x''<sub>''N'' β 1</sub> are transformed into the ''N'' real numbers ''X''<sub>0</sub>,...,''X''<sub>''N'' β 1</sub> according to one of the formulas: ===DST-I=== [[File:Discrete sine transform.svg|thumb|upright=1.35|Discrete sine transform (https://www.desmos.com/calculator/r0od93dfgp).]] :<math>\begin{align}X_k &= \sum_{n=0}^{N-1} x_n \sin \left[\frac \pi {N+1} (n+1) (k+1) \right] & k &= 0, \dots, N-1\\ X_{k-1} &= \sum_{n=1}^{N} x_{n-1} \sin \left[\frac {\pi nk} {N+1}\right] & k &= 1, \dots, N\end{align}</math> The DST-I matrix is [[orthogonal matrix|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. 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''<sub>''n''</sub> is odd around ''n'' = β1 and odd around ''n''=''N''; similarly for ''X''<sub>''k''</sub>. ===DST-II=== <math display="block">X_k = \sum_{n=0}^{N-1} x_n \sin \left[\frac \pi N \left(n+\frac{1}{2}\right) (k+1)\right] \quad \quad k = 0, \dots, N-1</math> Some authors further multiply the ''X''<sub>''N'' β 1</sub> term by 1/{{radic|2}} (see below for the corresponding change in DST-III). This makes the DST-II matrix [[orthogonal matrix|orthogonal]] (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''<sub>''n''</sub> is odd around ''n'' = β1/2 and odd around ''n'' = ''N'' β 1/2; ''X''<sub>''k''</sub> is odd around ''k'' = β1 and even around ''k'' = ''N'' β 1. ===DST-III=== <math display=block>X_k = \frac{(-1)^k}{2} x_{N-1} + \sum_{n=0}^{N-2} x_n \sin \left[\frac{\pi}{N} (n+1) \left(k+\frac{1}{2}\right) \right] \quad \quad k = 0, \dots, N-1</math> Some authors further multiply the ''x''<sub>''N'' β 1</sub> term by {{radic|2}} (see above for the corresponding change in DST-II). This makes the DST-III matrix [[orthogonal matrix|orthogonal]] (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''<sub>''n''</sub> is odd around ''n'' = β1 and even around ''n'' = ''N'' β 1; ''X''<sub>''k''</sub> is odd around ''k'' = β1/2 and odd around ''k'' = ''N'' β 1/2. ===DST-IV=== <math display="block">X_k = \sum_{n=0}^{N-1} x_n \sin \left[\frac \pi N \left(n+\frac{1}{2}\right) \left(k+\frac{1}{2}\right) \right] \quad \quad k = 0, \dots, N-1</math> The DST-IV matrix is [[orthogonal matrix|orthogonal]] (up to a scale factor). The DST-IV implies the boundary conditions: ''x''<sub>''n''</sub> is odd around ''n'' = β1/2 and even around ''n'' = ''N'' β 1/2; similarly for ''X''<sub>''k''</sub>. ===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 [[discrete Fourier transform|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 display="inline">\sqrt{2/N}</math> so that the inverse does not require any additional multiplicative factor. ==Computation== Although the direct application of these formulas would require O(''N''<sup>2</sup>) 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. 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. ==Generalizations== A family of transforms composed of sine and [[sine hyperbolic]] functions exists; these transforms are made based on the [[natural frequency|natural]] [[vibration]] of thin square plates with different [[boundary conditions]].<ref>{{Cite journal| last1=Abedi|first1=M.| last2=Sun|first2=B.| last3=Zheng|first3=Z.| date=July 2019| title=A Sinusoidal-Hyperbolic Family of Transforms With Potential Applications in Compressive Sensing| journal=IEEE Transactions on Image Processing| volume=28| issue=7| pages=3571β3583| doi=10.1109/TIP.2019.2912355| pmid=31071031| bibcode=2019ITIP...28.3571A|s2cid=174820107 }}</ref> ==References== {{Reflist}} ==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/ FFTW Home Page]. A free ([[GNU General Public License|GPL]]) 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, "[http://fftw.org/fftw-paper-ieee.pdf 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 FFT Package 1-dim / 2-dim]. 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 | access-date=2011-08-13 | archive-date=2011-08-11 | archive-url=https://web.archive.org/web/20110811154417/http://apps.nrbook.com/empanel/index.html#pg=621 | url-status=dead }}. * R. Chivukula and Y. Reznik, "[http://www.reznik.org/papers/ADIP2011_DST67.pdf Fast Computing of Discrete Cosine and Sine Transforms of Types VI and VII]," ''Proc. SPIE'' Vol. 8135, 2011. [[Category:Discrete transforms]] [[Category:Fourier analysis]] [[Category:Indian inventions]]
Edit summary
(Briefly describe your changes)
By publishing changes, you agree to the
Terms of Use
, and you irrevocably agree to release your contribution under the
CC BY-SA 4.0 License
and the
GFDL
. You agree that a hyperlink or URL is sufficient attribution under the Creative Commons license.
Cancel
Editing help
(opens in new window)
Pages transcluded onto the current version of this page
(
help
)
:
Template:Citation
(
edit
)
Template:Cite book
(
edit
)
Template:Cite journal
(
edit
)
Template:Mono
(
edit
)
Template:Radic
(
edit
)
Template:Reflist
(
edit
)
Template:Short description
(
edit
)