5.3 Discrete Sine Transform

dst(X[, type=1])

Replaces the columns of a dense real matrix with their discrete sine transforms. The second argument, an integer between 1 and 4, denotes the type of transform (DST-I, DST-II, DST-III, DST-IV). These transforms are defined as follows (for a matrix with n rows).

                       n∑-1
 DST -I:    X[k,:]  :=   2   X [j,:]sin(π (j + 1)(k+ 1)∕(n+ 1)),   k = 0,...,n - 1.
                       j=0
                       n∑-1
DST -II:    X[k,:]  :=   2   X [j,:]sin(π (j + 1∕2)(k+ 1)∕n),   k = 0,...,n - 1.
                       j=0
                          k            n∑-2
DST-III:    X[k,:]  :=   (- 1)X [n- 1,:]+ 2    X [j,:]sin(π(j + 1)(k+ 1∕2)∕n),  k = 0,...,n - 1.
                                       j=0
                       n∑-1
DST-IV:    X[k,:]  :=   2   X [j,:]sin(π (j + 1∕2)(k+ 1∕2)∕n),   k = 0,...,n - 1.
                       j=0

idst(X[, type=1])

Replaces the columns of a dense real matrix with the inverses of the discrete sine transforms defined above.