function b=dst(a,n) %DST Discrete sine transform (Used in Poisson reconstruction) % Y = DST(X) returns the discrete sine transform of X. % The vector Y is the same size as X and contains the % discrete sine transform coefficients. % Y = DST(X,N) pads or truncates the vector X to length N % before transforming. % If X is a matrix, the DST operation is applied to each % column. This transform can be inverted using IDST. % Author: Amit Agrawal error(nargchk(1,2,nargin)); if min(size(a))==1 if size(a,2)>1 do_trans = 1; else do_trans = 0; end a = a(:); else do_trans = 0; end if nargin==1, n = size(a,1); end m = size(a,2); % Pad or truncate a if necessary if size(a,1)