# HG changeset patch # User Rik # Date 1288315099 25200 # Node ID 5962c1cfdbcbedf478dd579f2aef1c95dacfc582 # Parent 254a87b40f60334aef18f3b24b8dd3b5bc3f150a Deprecate autocor and autocov functions. diff -r 254a87b40f60 -r 5962c1cfdbcb ChangeLog --- a/ChangeLog Fri Oct 29 00:28:46 2010 +0200 +++ b/ChangeLog Thu Oct 28 18:18:19 2010 -0700 @@ -1,3 +1,7 @@ +2010-10-28 Rik + + * NEWS: Update deprecated function list with autocov and autocor. + 2010-10-25 Kai Habel * NEWS: Add uimenu. diff -r 254a87b40f60 -r 5962c1cfdbcb NEWS --- a/NEWS Fri Oct 29 00:28:46 2010 +0200 +++ b/NEWS Thu Oct 28 18:18:19 2010 -0700 @@ -408,7 +408,7 @@ release after 3.4): cellidx fstat values gammai - betai is_global + betai is_global autocor autocov Summary of important user-visible changes for version 3.2: --------------------------------------------------------- diff -r 254a87b40f60 -r 5962c1cfdbcb scripts/ChangeLog --- a/scripts/ChangeLog Fri Oct 29 00:28:46 2010 +0200 +++ b/scripts/ChangeLog Thu Oct 28 18:18:19 2010 -0700 @@ -1,3 +1,8 @@ +2010-10-28 Rik + + * deprecated/module.mk, signal/module.mk, deprecated/autocov.m, + deprecated/autocor.m: Deprecate autocov and autocor functions. + 2010-10-27 David Bateman * plot/__go_draw_axes__.m: Don't attempt to plot patch outlines if diff -r 254a87b40f60 -r 5962c1cfdbcb scripts/deprecated/autocor.m --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/scripts/deprecated/autocor.m Thu Oct 28 18:18:19 2010 -0700 @@ -0,0 +1,60 @@ +## Copyright (C) 1995, 1996, 1997, 1998, 2000, 2002, 2005, 2006, 2007 +## Friedrich Leisch +## +## This file is part of Octave. +## +## Octave is free software; you can redistribute it and/or modify it +## under the terms of the GNU General Public License as published by +## the Free Software Foundation; either version 3 of the License, or (at +## your option) any later version. +## +## Octave is distributed in the hope that it will be useful, but +## WITHOUT ANY WARRANTY; without even the implied warranty of +## MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +## General Public License for more details. +## +## You should have received a copy of the GNU General Public License +## along with Octave; see the file COPYING. If not, see +## . + +## -*- texinfo -*- +## @deftypefn {Function File} {} autocor (@var{x}, @var{h}) +## Return the autocorrelations from lag 0 to @var{h} of vector @var{x}. +## If @var{h} is omitted, all autocorrelations are computed. +## If @var{x} is a matrix, the autocorrelations of each column are +## computed. +## The particular algorithm used is from the field of statistics and +## differs from the definition used in signal processing. +## @end deftypefn + +## Author: FL +## Description: Compute autocorrelations + +## Deprecated in version 3.4 + +function retval = autocor (X, h) + + persistent warned = false; + if (! warned) + warned = true; + warning ("Octave:deprecated-function", + "autocor is obsolete and will be removed from a future version of Octave; See the Octave-Forge signal package and the function xcor for a replacement"); + endif + + + if (nargin == 1) + retval = autocov (X); + elseif (nargin == 2) + retval = autocov (X, h); + else + print_usage (); + endif + + if (min (retval (1,:)) != 0) + retval = retval ./ (ones (rows (retval), 1) * retval(1,:)); + endif + +endfunction + + + diff -r 254a87b40f60 -r 5962c1cfdbcb scripts/deprecated/autocov.m --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/scripts/deprecated/autocov.m Thu Oct 28 18:18:19 2010 -0700 @@ -0,0 +1,63 @@ +## Copyright (C) 1995, 1996, 1997, 1998, 1999, 2000, 2002, 2003, 2005, +## 2007 Friedrich Leisch +## +## This file is part of Octave. +## +## Octave is free software; you can redistribute it and/or modify it +## under the terms of the GNU General Public License as published by +## the Free Software Foundation; either version 3 of the License, or (at +## your option) any later version. +## +## Octave is distributed in the hope that it will be useful, but +## WITHOUT ANY WARRANTY; without even the implied warranty of +## MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +## General Public License for more details. +## +## You should have received a copy of the GNU General Public License +## along with Octave; see the file COPYING. If not, see +## . + +## -*- texinfo -*- +## @deftypefn {Function File} {} autocov (@var{x}, @var{h}) +## Return the autocovariances from lag 0 to @var{h} of vector @var{x}. +## If @var{h} is omitted, all autocovariances are computed. +## If @var{x} is a matrix, the autocovariances of each column are +## computed. +## The particular algorithm used is from the field of statistics and +## differs from the definition used in signal processing. +## @end deftypefn + +## Author: FL +## Description: Compute autocovariances + +## Deprecated in version 3.4 + +function retval = autocov (X, h) + persistent warned = false; + if (! warned) + warned = true; + warning ("Octave:deprecated-function", + "autocov is obsolete and will be removed from a future version of Octave; See the Octave-Forge signal package and the function xcov for a replacement"); + endif + + [n, c] = size (X); + + if (isvector (X)) + n = length (X); + c = 1; + X = reshape (X, n, 1); + endif + + X = center (X); + + if (nargin == 1) + h = n - 1; + endif + + retval = zeros (h + 1, c); + + for i = 0 : h + retval(i+1, :) = diag (X(i+1:n, :).' * conj (X(1:n-i, :))).' / n; + endfor + +endfunction diff -r 254a87b40f60 -r 5962c1cfdbcb scripts/deprecated/module.mk --- a/scripts/deprecated/module.mk Fri Oct 29 00:28:46 2010 +0200 +++ b/scripts/deprecated/module.mk Thu Oct 28 18:18:19 2010 -0700 @@ -1,6 +1,8 @@ FCN_FILE_DIRS += deprecated deprecated_FCN_FILES = \ + deprecated/autocor.m \ + deprecated/autocov.m \ deprecated/betai.m \ deprecated/cellidx.m \ deprecated/clg.m \ diff -r 254a87b40f60 -r 5962c1cfdbcb scripts/signal/autocor.m --- a/scripts/signal/autocor.m Fri Oct 29 00:28:46 2010 +0200 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,48 +0,0 @@ -## Copyright (C) 1995, 1996, 1997, 1998, 2000, 2002, 2005, 2006, 2007 -## Friedrich Leisch -## -## This file is part of Octave. -## -## Octave is free software; you can redistribute it and/or modify it -## under the terms of the GNU General Public License as published by -## the Free Software Foundation; either version 3 of the License, or (at -## your option) any later version. -## -## Octave is distributed in the hope that it will be useful, but -## WITHOUT ANY WARRANTY; without even the implied warranty of -## MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU -## General Public License for more details. -## -## You should have received a copy of the GNU General Public License -## along with Octave; see the file COPYING. If not, see -## . - -## -*- texinfo -*- -## @deftypefn {Function File} {} autocor (@var{x}, @var{h}) -## Return the autocorrelations from lag 0 to @var{h} of vector @var{x}. -## If @var{h} is omitted, all autocorrelations are computed. -## If @var{x} is a matrix, the autocorrelations of each column are -## computed. -## @end deftypefn - -## Author: FL -## Description: Compute autocorrelations - -function retval = autocor (X, h) - - if (nargin == 1) - retval = autocov (X); - elseif (nargin == 2) - retval = autocov (X, h); - else - print_usage (); - endif - - if (min (retval (1,:)) != 0) - retval = retval ./ (ones (rows (retval), 1) * retval(1,:)); - endif - -endfunction - - - diff -r 254a87b40f60 -r 5962c1cfdbcb scripts/signal/autocov.m --- a/scripts/signal/autocov.m Fri Oct 29 00:28:46 2010 +0200 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,53 +0,0 @@ -## Copyright (C) 1995, 1996, 1997, 1998, 1999, 2000, 2002, 2003, 2005, -## 2007 Friedrich Leisch -## -## This file is part of Octave. -## -## Octave is free software; you can redistribute it and/or modify it -## under the terms of the GNU General Public License as published by -## the Free Software Foundation; either version 3 of the License, or (at -## your option) any later version. -## -## Octave is distributed in the hope that it will be useful, but -## WITHOUT ANY WARRANTY; without even the implied warranty of -## MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU -## General Public License for more details. -## -## You should have received a copy of the GNU General Public License -## along with Octave; see the file COPYING. If not, see -## . - -## -*- texinfo -*- -## @deftypefn {Function File} {} autocov (@var{x}, @var{h}) -## Return the autocovariances from lag 0 to @var{h} of vector @var{x}. -## If @var{h} is omitted, all autocovariances are computed. -## If @var{x} is a matrix, the autocovariances of each column are -## computed. -## @end deftypefn - -## Author: FL -## Description: Compute autocovariances - -function retval = autocov (X, h) - - [n, c] = size (X); - - if (isvector (X)) - n = length (X); - c = 1; - X = reshape (X, n, 1); - endif - - X = center (X); - - if (nargin == 1) - h = n - 1; - endif - - retval = zeros (h + 1, c); - - for i = 0 : h - retval(i+1, :) = diag (X(i+1:n, :).' * conj (X(1:n-i, :))).' / n; - endfor - -endfunction diff -r 254a87b40f60 -r 5962c1cfdbcb scripts/signal/module.mk --- a/scripts/signal/module.mk Fri Oct 29 00:28:46 2010 +0200 +++ b/scripts/signal/module.mk Thu Oct 28 18:18:19 2010 -0700 @@ -5,8 +5,6 @@ signal/arch_rnd.m \ signal/arch_test.m \ signal/arma_rnd.m \ - signal/autocor.m \ - signal/autocov.m \ signal/autoreg_matrix.m \ signal/bartlett.m \ signal/blackman.m \