]> Creatis software - CreaPhase.git/blob - octave_packages/signal-1.1.3/idst.m
Add a useful package (from Source forge) for octave
[CreaPhase.git] / octave_packages / signal-1.1.3 / idst.m
1 ## Author: Paul Kienzle <pkienzle@users.sf.net> (2006)
2 ## This program is granted to the public domain.
3
4 ## -*- texinfo -*-
5 ## @deftypefn {Function File} {@var{y} =} idst (@var{x})
6 ## @deftypefnx {Function File} {@var{y} =} idst (@var{x}, @var{n})
7 ## Computes the inverse type I discrete sine transform of @var{y}.  If @var{n} is 
8 ## given, then @var{y} is padded or trimmed to length @var{n} before computing 
9 ## the transform.  If @var{y} is a matrix, compute the transform along the 
10 ## columns of the the matrix.
11 ## @seealso{dst}
12 ## @end deftypefn
13
14 function x = idst (y, n)
15
16   if (nargin < 1 || nargin > 2)
17     print_usage;
18   endif
19
20   if nargin == 1,
21     n = size(y,1);
22     if n==1, n = size(y,2); end
23   end
24   x = dst(y, n) * 2/(n+1);
25
26 endfunction
27
28 %!test
29 %! x = log(gausswin(32));
30 %! assert(x, idst(dst(x)), 100*eps)