Mercurial > hg > octave-nkf
diff scripts/signal/diffpara.m @ 3457:e031284eea27
[project @ 2000-01-19 08:49:56 by jwe]
author | jwe |
---|---|
date | Wed, 19 Jan 2000 08:50:14 +0000 |
parents | 858695b3ed62 |
children | 3e3e14ad5149 |
line wrap: on
line diff
--- a/scripts/signal/diffpara.m +++ b/scripts/signal/diffpara.m @@ -35,15 +35,15 @@ ## Theory and Methods Springer 1987. ## @end deftypefn -## Author: FL <Friedrich.Leisch@ci.tuwien.ac.at> -## Description: Estimate the fractional differencing parameter +## Author: FL <Friedrich.Leisch@ci.tuwien.ac.at> +## Description: Estimate the fractional differencing parameter function [d, D] = diffpara (X, a, b) if ((nargin < 1) || (nargin > 3)) usage ("[d, D] = diffpara (X, a, b)"); else - if is_vector (X) + if (is_vector (X)) n = length (X); k = 1; X = reshape (X, n, 1); @@ -59,8 +59,8 @@ endif endif - if !(is_scalar (a) && is_scalar (b)) - error ("diffpara: a and b must be scalars"); + if (! (is_scalar (a) && is_scalar (b))) + error ("diffpara: a and b must be scalars"); endif D = zeros (b - a + 1, k); @@ -69,7 +69,7 @@ w = 2 * pi * (1 : n-1) / n; - x = 2 * log (abs( 1 - exp (-i*w))); + x = 2 * log (abs (1 - exp (-i*w))); y = log (periodogram (X(2:n,l))); x = center (x);