%=======================================
% DST-1 : Discrete sine transform
%---------------------------------------
% Coefficients are same as defined by 
% 6.17 in the book
%
%=======================================
function y=dst1(x)

[M,N] = size(x);
x = x(2:M-1,:);
[M,N] = size(x);
y=[zeros(1,N);x;zeros(1,N);-flipud(x)];
yy=fft(y);
y=real(yy(2:M+1,:)/(-i*(M+1)));

y = [zeros(1,N);y;zeros(1,N)];
