changeset 11165:5962c1cfdbcb

Deprecate autocor and autocov functions.
author Rik <octave@nomad.inbox5.com>
date Thu, 28 Oct 2010 18:18:19 -0700
parents 254a87b40f60
children 9cdf43d1fa16
files ChangeLog NEWS scripts/ChangeLog scripts/deprecated/autocor.m scripts/deprecated/autocov.m scripts/deprecated/module.mk scripts/signal/autocor.m scripts/signal/autocov.m scripts/signal/module.mk
diffstat 9 files changed, 135 insertions(+), 104 deletions(-) [+]
line wrap: on
line diff
--- 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  <octave@nomad.inbox5.com>
+
+	* NEWS: Update deprecated function list with autocov and autocor.
+
 2010-10-25  Kai Habel  <kai.habel@gmx.de>
 
 	* NEWS: Add uimenu.
--- 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:
 ---------------------------------------------------------
--- 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  <octave@nomad.inbox5.com>
+
+	* deprecated/module.mk, signal/module.mk, deprecated/autocov.m,
+	  deprecated/autocor.m: Deprecate autocov and autocor functions.
+
 2010-10-27  David Bateman  <dbateman@free.fr>
 
 	* plot/__go_draw_axes__.m: Don't attempt to plot patch outlines if
--- /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
+## <http://www.gnu.org/licenses/>.
+
+## -*- 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 <Friedrich.Leisch@ci.tuwien.ac.at>
+## 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
+
+
+
--- /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
+## <http://www.gnu.org/licenses/>.
+
+## -*- 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 <Friedrich.Leisch@ci.tuwien.ac.at>
+## 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
--- 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 \
--- 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
-## <http://www.gnu.org/licenses/>.
-
-## -*- 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 <Friedrich.Leisch@ci.tuwien.ac.at>
-## 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
-
-
-
--- 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
-## <http://www.gnu.org/licenses/>.
-
-## -*- 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 <Friedrich.Leisch@ci.tuwien.ac.at>
-## 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
--- 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 \