# 离散正弦变换

## 定義

### DST-I

${\displaystyle X_{k}=\sum _{n=0}^{N-1}x_{n}\sin \left[{\frac {\pi }{N+1}}(n+1)(k+1)\right]\quad \quad k=0,\dots ,N-1}$

${\displaystyle N=3}$的實數abc的DST-I變換等價於8點實數0abc0(-c)(-b)(-a)（奇對稱）的DFT轉換，再除2（而DST-II~DST-IV等價於DFT有半個取樣的位移）。

### DST-II

${\displaystyle 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}$

### DST-III

${\displaystyle 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}$

### DST-IV

${\displaystyle 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}$

## 反變換

DST-I的反變換是把DST-I乘以${\displaystyle {\frac {1}{N+1}}}$。 DST-IV的反變換是把DST-IV乘以${\displaystyle {\frac {2}{N}}}$。 DST-II的反變換是把DST-III乘以${\displaystyle {\frac {2}{N}}}$，反之亦然。

## 參考資料

• S. A. Martucci, "Symmetric convolution and the discrete sine and cosine transforms," IEEE Trans. Sig. Processing SP-42, 1038-1051 (1994).
• Matteo Frigo and Steven G. Johnson: FFTW, http://www.fftw.org/页面存档备份，存于互联网档案馆）. A free (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, "The Design and Implementation of FFTW3," Proceedings of the IEEE 93 (2), 216–231 (2005).