X-Git-Url: https://git.creatis.insa-lyon.fr/pubgit/?p=CreaPhase.git;a=blobdiff_plain;f=octave_packages%2Fsignal-1.1.3%2Fidst.m;fp=octave_packages%2Fsignal-1.1.3%2Fidst.m;h=fe7cd2bec6a1c76e701043184159f76bb76a24d1;hp=0000000000000000000000000000000000000000;hb=c880e8788dfc484bf23ce13fa2787f2c6bca4863;hpb=1705066eceaaea976f010f669ce8e972f3734b05 diff --git a/octave_packages/signal-1.1.3/idst.m b/octave_packages/signal-1.1.3/idst.m new file mode 100644 index 0000000..fe7cd2b --- /dev/null +++ b/octave_packages/signal-1.1.3/idst.m @@ -0,0 +1,30 @@ +## Author: Paul Kienzle (2006) +## This program is granted to the public domain. + +## -*- texinfo -*- +## @deftypefn {Function File} {@var{y} =} idst (@var{x}) +## @deftypefnx {Function File} {@var{y} =} idst (@var{x}, @var{n}) +## Computes the inverse type I discrete sine transform of @var{y}. If @var{n} is +## given, then @var{y} is padded or trimmed to length @var{n} before computing +## the transform. If @var{y} is a matrix, compute the transform along the +## columns of the the matrix. +## @seealso{dst} +## @end deftypefn + +function x = idst (y, n) + + if (nargin < 1 || nargin > 2) + print_usage; + endif + + if nargin == 1, + n = size(y,1); + if n==1, n = size(y,2); end + end + x = dst(y, n) * 2/(n+1); + +endfunction + +%!test +%! x = log(gausswin(32)); +%! assert(x, idst(dst(x)), 100*eps)