1 function Y = dstn(X,N)
\r
2 % discrete sine transform along dimension N
\r
4 % discrete sine transform along dimension N of X
\r
6 % permute dimensions N <-> 1
\r
10 % pad dim 1 by zeros and collapse the others
\r
13 Y = reshape(Y,m(1),mm);
\r
14 W = zeros(2*m(1)+2,mm);
\r
16 Y = imag( fft(W,[],1) );
\r
17 % pick transform between pads and uncollapse
\r
18 Y = reshape(Y(2:m(1)+1,:),m);
\r
19 % permute dimensions N <-> 1 back
\r