This list is closed, nobody may subscribe to it.
2001 |
Jan
|
Feb
|
Mar
|
Apr
|
May
|
Jun
|
Jul
(10) |
Aug
(5) |
Sep
(3) |
Oct
(41) |
Nov
(41) |
Dec
(33) |
---|---|---|---|---|---|---|---|---|---|---|---|---|
2002 |
Jan
(75) |
Feb
(10) |
Mar
(170) |
Apr
(174) |
May
(66) |
Jun
(11) |
Jul
(10) |
Aug
(44) |
Sep
(73) |
Oct
(28) |
Nov
(139) |
Dec
(52) |
2003 |
Jan
(35) |
Feb
(93) |
Mar
(62) |
Apr
(10) |
May
(55) |
Jun
(70) |
Jul
(37) |
Aug
(16) |
Sep
(56) |
Oct
(31) |
Nov
(57) |
Dec
(83) |
2004 |
Jan
(85) |
Feb
(67) |
Mar
(27) |
Apr
(37) |
May
(75) |
Jun
(85) |
Jul
(160) |
Aug
(68) |
Sep
(104) |
Oct
(25) |
Nov
(39) |
Dec
(23) |
2005 |
Jan
(10) |
Feb
(45) |
Mar
(43) |
Apr
(19) |
May
(108) |
Jun
(31) |
Jul
(41) |
Aug
(23) |
Sep
(65) |
Oct
(58) |
Nov
(44) |
Dec
(54) |
2006 |
Jan
(96) |
Feb
(27) |
Mar
(69) |
Apr
(59) |
May
(67) |
Jun
(35) |
Jul
(13) |
Aug
(461) |
Sep
(160) |
Oct
(399) |
Nov
(32) |
Dec
(72) |
2007 |
Jan
(316) |
Feb
(305) |
Mar
(318) |
Apr
(54) |
May
(194) |
Jun
(173) |
Jul
(282) |
Aug
(91) |
Sep
(227) |
Oct
(365) |
Nov
(168) |
Dec
(18) |
2008 |
Jan
(71) |
Feb
(111) |
Mar
(155) |
Apr
(173) |
May
(70) |
Jun
(67) |
Jul
(55) |
Aug
(83) |
Sep
(32) |
Oct
(68) |
Nov
(80) |
Dec
(29) |
2009 |
Jan
(46) |
Feb
(18) |
Mar
(95) |
Apr
(76) |
May
(140) |
Jun
(98) |
Jul
(84) |
Aug
(123) |
Sep
(94) |
Oct
(131) |
Nov
(142) |
Dec
(125) |
2010 |
Jan
(128) |
Feb
(158) |
Mar
(172) |
Apr
(134) |
May
(94) |
Jun
(84) |
Jul
(32) |
Aug
(127) |
Sep
(167) |
Oct
(109) |
Nov
(69) |
Dec
(78) |
2011 |
Jan
(39) |
Feb
(58) |
Mar
(52) |
Apr
(47) |
May
(56) |
Jun
(76) |
Jul
(55) |
Aug
(54) |
Sep
(165) |
Oct
(255) |
Nov
(328) |
Dec
(263) |
2012 |
Jan
(82) |
Feb
(147) |
Mar
(400) |
Apr
(216) |
May
(209) |
Jun
(160) |
Jul
(86) |
Aug
(141) |
Sep
(156) |
Oct
(6) |
Nov
|
Dec
|
2015 |
Jan
|
Feb
|
Mar
|
Apr
|
May
|
Jun
|
Jul
(1) |
Aug
|
Sep
(1) |
Oct
|
Nov
(1) |
Dec
(2) |
2016 |
Jan
|
Feb
(2) |
Mar
(2) |
Apr
(1) |
May
(1) |
Jun
(2) |
Jul
(1) |
Aug
(1) |
Sep
|
Oct
|
Nov
(1) |
Dec
|
2019 |
Jan
|
Feb
|
Mar
(1) |
Apr
|
May
|
Jun
|
Jul
|
Aug
|
Sep
|
Oct
|
Nov
|
Dec
|
2021 |
Jan
|
Feb
|
Mar
|
Apr
(3) |
May
(4) |
Jun
(8) |
Jul
(2) |
Aug
(5) |
Sep
(9) |
Oct
|
Nov
|
Dec
|
From: <par...@us...> - 2012-08-23 17:15:28
|
Revision: 10898 http://octave.svn.sourceforge.net/octave/?rev=10898&view=rev Author: paramaniac Date: 2012-08-23 17:15:22 +0000 (Thu, 23 Aug 2012) Log Message: ----------- control: rename key again to 'noiseinput' Modified Paths: -------------- trunk/octave-forge/main/control/inst/__slicot_identification__.m trunk/octave-forge/main/control/inst/moen4.m trunk/octave-forge/main/control/inst/moesp.m trunk/octave-forge/main/control/inst/n4sid.m Modified: trunk/octave-forge/main/control/inst/__slicot_identification__.m =================================================================== --- trunk/octave-forge/main/control/inst/__slicot_identification__.m 2012-08-23 16:18:49 UTC (rev 10897) +++ trunk/octave-forge/main/control/inst/__slicot_identification__.m 2012-08-23 17:15:22 UTC (rev 10898) @@ -115,7 +115,7 @@ rcond = val; case "confirm" conf = logical (val); - case {"input", "inputs"} + case {"noiseinput", "noiseinputs", "noise", "input", "inputs"} noise = val; otherwise warning ("%s: invalid property name '%s' ignored", method, key); Modified: trunk/octave-forge/main/control/inst/moen4.m =================================================================== --- trunk/octave-forge/main/control/inst/moen4.m 2012-08-23 16:18:49 UTC (rev 10897) +++ trunk/octave-forge/main/control/inst/moen4.m 2012-08-23 17:15:22 UTC (rev 10898) @@ -129,7 +129,7 @@ ## No confirmation. Default value. ## @end table ## -## @item 'input' +## @item 'noiseinput' ## The desired type of noise input channels. ## @table @var ## @item 'n' Modified: trunk/octave-forge/main/control/inst/moesp.m =================================================================== --- trunk/octave-forge/main/control/inst/moesp.m 2012-08-23 16:18:49 UTC (rev 10897) +++ trunk/octave-forge/main/control/inst/moesp.m 2012-08-23 17:15:22 UTC (rev 10898) @@ -128,7 +128,7 @@ ## No confirmation. Default value. ## @end table ## -## @item 'input' +## @item 'noiseinput' ## The desired type of noise input channels. ## @table @var ## @item 'n' Modified: trunk/octave-forge/main/control/inst/n4sid.m =================================================================== --- trunk/octave-forge/main/control/inst/n4sid.m 2012-08-23 16:18:49 UTC (rev 10897) +++ trunk/octave-forge/main/control/inst/n4sid.m 2012-08-23 17:15:22 UTC (rev 10898) @@ -128,7 +128,7 @@ ## No confirmation. Default value. ## @end table ## -## @item 'input' +## @item 'noiseinput' ## The desired type of noise input channels. ## @table @var ## @item 'n' This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <car...@us...> - 2012-08-23 16:18:56
|
Revision: 10897 http://octave.svn.sourceforge.net/octave/?rev=10897&view=rev Author: carandraug Date: 2012-08-23 16:18:49 +0000 (Thu, 23 Aug 2012) Log Message: ----------- xcorr2: fix bug caused by r9421 Revision Links: -------------- http://octave.svn.sourceforge.net/octave/?rev=9421&view=rev Modified Paths: -------------- trunk/octave-forge/main/signal/NEWS trunk/octave-forge/main/signal/inst/xcorr2.m Modified: trunk/octave-forge/main/signal/NEWS =================================================================== --- trunk/octave-forge/main/signal/NEWS 2012-08-23 07:43:52 UTC (rev 10896) +++ trunk/octave-forge/main/signal/NEWS 2012-08-23 16:18:49 UTC (rev 10897) @@ -15,6 +15,9 @@ ** The function `rceps' was fixed to work correctly with odd-length inputs. + ** Bugfix in `xcorr2' introduced in 1.1.2 that would not accept "none" as + sacle option. + ** The following functions are new: movingrms schtrig clustersegment Modified: trunk/octave-forge/main/signal/inst/xcorr2.m =================================================================== --- trunk/octave-forge/main/signal/inst/xcorr2.m 2012-08-23 07:43:52 UTC (rev 10896) +++ trunk/octave-forge/main/signal/inst/xcorr2.m 2012-08-23 16:18:49 UTC (rev 10897) @@ -65,23 +65,26 @@ ## bias routines by Dave Cogdell (cog...@as...) ## optimized by Paul Kienzle (pki...@us...) - if strcmp(lower(biasflag), 'biased'), - c = c / ( min ([ma, mb]) * min ([na, nb]) ); - elseif strcmp(lower(biasflag), 'unbiased'), - lo = min ([na,nb]); - hi = max ([na, nb]); - row = [ 1:(lo-1), lo*ones(1,hi-lo+1), (lo-1):-1:1 ]; + switch lower (biasflag) + case {"biased"} + c = c / ( min ([ma, mb]) * min ([na, nb]) ); + case {"unbiased"} + lo = min ([na,nb]); + hi = max ([na, nb]); + row = [ 1:(lo-1), lo*ones(1,hi-lo+1), (lo-1):-1:1 ]; - lo = min ([ma,mb]); - hi = max ([ma, mb]); - col = [ 1:(lo-1), lo*ones(1,hi-lo+1), (lo-1):-1:1 ]'; + lo = min ([ma,mb]); + hi = max ([ma, mb]); + col = [ 1:(lo-1), lo*ones(1,hi-lo+1), (lo-1):-1:1 ]'; - bias = col*row; - c = c./bias; + bias = col*row; + c = c./bias; - elseif strcmp(lower(biasflag),'coeff'), - c = c/max(c(:))'; - else - error ("invalid type of scale %s", biasflag); - endif + case {"coeff"} + c = c/max(c(:))'; + case {"none"} + ## do nothing, it's all done + otherwise + error ("invalid type of scale %s", biasflag); + endswitch endfunction This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <par...@us...> - 2012-08-23 07:43:58
|
Revision: 10896 http://octave.svn.sourceforge.net/octave/?rev=10896&view=rev Author: paramaniac Date: 2012-08-23 07:43:52 +0000 (Thu, 23 Aug 2012) Log Message: ----------- control: minor doc enhancement Modified Paths: -------------- trunk/octave-forge/main/control/devel/sensitivity.m Modified: trunk/octave-forge/main/control/devel/sensitivity.m =================================================================== --- trunk/octave-forge/main/control/devel/sensitivity.m 2012-08-23 07:30:41 UTC (rev 10895) +++ trunk/octave-forge/main/control/devel/sensitivity.m 2012-08-23 07:43:52 UTC (rev 10896) @@ -19,7 +19,10 @@ ## @deftypefn{Function File} {@var{Ms} =} sensitivity (@var{L}) ## @deftypefnx{Function File} {@var{Ms} =} sensitivity (@var{P}, @var{C}) ## @deftypefnx{Function File} {@var{Ms} =} sensitivity (@var{P}, @var{C1}, @var{C2}, @dots{}) -## Return sensitivity margin @var{Ms}. +## Return sensitivity margin @var{Ms}. The quantity @var{Ms} is +## simply the inverse of the shortest distance from the Nyquist +## curve to the critical point -1. Reasonable values of @var{Ms} +## are in the range from 1.3 to 2. ## ## @strong{Inputs} ## @table @var This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <par...@us...> - 2012-08-23 07:30:48
|
Revision: 10895 http://octave.svn.sourceforge.net/octave/?rev=10895&view=rev Author: paramaniac Date: 2012-08-23 07:30:41 +0000 (Thu, 23 Aug 2012) Log Message: ----------- control: add sensitivity function Added Paths: ----------- trunk/octave-forge/main/control/devel/sensitivity.m Added: trunk/octave-forge/main/control/devel/sensitivity.m =================================================================== --- trunk/octave-forge/main/control/devel/sensitivity.m (rev 0) +++ trunk/octave-forge/main/control/devel/sensitivity.m 2012-08-23 07:30:41 UTC (rev 10895) @@ -0,0 +1,84 @@ +## Copyright (C) 2012 Lukas F. Reichlin +## +## This file is part of LTI Syncope. +## +## LTI Syncope 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. +## +## LTI Syncope 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 LTI Syncope. If not, see <http://www.gnu.org/licenses/>. + +## -*- texinfo -*- +## @deftypefn{Function File} {@var{Ms} =} sensitivity (@var{L}) +## @deftypefnx{Function File} {@var{Ms} =} sensitivity (@var{P}, @var{C}) +## @deftypefnx{Function File} {@var{Ms} =} sensitivity (@var{P}, @var{C1}, @var{C2}, @dots{}) +## Return sensitivity margin @var{Ms}. +## +## @strong{Inputs} +## @table @var +## @item L +## Open loop transfer function. +## @var{L} can be any type of LTI system, but it must be square. +## @item P +## Plant model. Any type of LTI system. +## @item C +## Controller model. Any type of LTI system. +## @item C1, C2, @dots{} +## If several controllers are specified, command @command{sensitivity} +## computes the sensitivity @var{Ms} for each of them in combination +## with plant @var{P}. +## @end table +## +## @strong{Outputs} +## @table @var +## @item Ms +## Sensitivity margin @var{Ms} as defined in [1]. Scalar value. +## If several controllers are specified, @var{Ms} becomes +## a vector with as many entries as controllers. +## @end table +## +## @strong{Algorithm}@* +## Uses SLICOT AB13DD by courtesy of +## @uref{http://www.slicot.org, NICONET e.V.} +## +## @strong{References}@* +## [1] Astr@"om, K. and H@"agglund, T. (1995) +## PID Controllers: +## Theory, Design and Tuning, +## Second Edition. +## Instrument Society of America. +## +## @end deftypefn + +## Author: Lukas Reichlin <luk...@gm...> +## Created: August 2012 +## Version: 0.1 + +function Ms = sensitivity (G, varargin) + + ## TODO: show nyquist diagram of L with circle + ## center (-1, 0) and radius equal to the + ## shortest distance 1/Ms, frequency w is + ## [Ms, w] = norm (S, inf) + + if (nargin == 0) + print_usage (); + elseif (nargin == 1) # L := G + I = eye (size (G)); + S = feedback (I, G); # S = inv (I + G), S = feedback (I, G*-I, "+") + Ms = norm (S, inf); + else # P := G, C := varargin + L = cellfun (@(C) G*C, varargin, "uniformoutput", false); + I = cellfun (@(L) eye (size (L)), L, "uniformoutput", false); + S = cellfun (@feedback, I, L, "uniformoutput", false); + Ms = cellfun (@(S) norm (S, inf), S); + endif + +endfunction This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <cd...@us...> - 2012-08-22 02:46:48
|
Revision: 10894 http://octave.svn.sourceforge.net/octave/?rev=10894&view=rev Author: cdf Date: 2012-08-22 02:46:39 +0000 (Wed, 22 Aug 2012) Log Message: ----------- code maintainance, simplification and cleanup before new release Modified Paths: -------------- trunk/octave-forge/main/openmpi_ext/inst/Pi.m trunk/octave-forge/main/openmpi_ext/inst/helloworld.m trunk/octave-forge/main/openmpi_ext/src/MPI_Barrier.cc trunk/octave-forge/main/openmpi_ext/src/MPI_Comm_Load.cc trunk/octave-forge/main/openmpi_ext/src/MPI_Comm_Test.cc trunk/octave-forge/main/openmpi_ext/src/MPI_Comm_rank.cc trunk/octave-forge/main/openmpi_ext/src/MPI_Comm_size.cc trunk/octave-forge/main/openmpi_ext/src/MPI_Finalize.cc trunk/octave-forge/main/openmpi_ext/src/MPI_Finalized.cc trunk/octave-forge/main/openmpi_ext/src/MPI_Get_processor_name.cc trunk/octave-forge/main/openmpi_ext/src/MPI_Init.cc trunk/octave-forge/main/openmpi_ext/src/MPI_Initialized.cc trunk/octave-forge/main/openmpi_ext/src/MPI_Iprobe.cc trunk/octave-forge/main/openmpi_ext/src/MPI_Op_Load.cc trunk/octave-forge/main/openmpi_ext/src/MPI_Op_Test.cc trunk/octave-forge/main/openmpi_ext/src/MPI_Probe.cc trunk/octave-forge/main/openmpi_ext/src/MPI_Recv.cc trunk/octave-forge/main/openmpi_ext/src/MPI_Send.cc trunk/octave-forge/main/openmpi_ext/src/Makefile trunk/octave-forge/main/openmpi_ext/src/simple.h Modified: trunk/octave-forge/main/openmpi_ext/inst/Pi.m =================================================================== --- trunk/octave-forge/main/openmpi_ext/inst/Pi.m 2012-08-21 01:12:21 UTC (rev 10893) +++ trunk/octave-forge/main/openmpi_ext/inst/Pi.m 2012-08-22 02:46:39 UTC (rev 10894) @@ -18,7 +18,7 @@ # For instance addpath("../src"); # mpirun -np 5 octave -q --eval "Pi(2E7,'s')" -function Pi(N,mod) +function results = Pi(N,mod) addpath("../src"); # Pi: Classic PI computation by numeric integration of arctan'(x) in [0..1] # Modified: trunk/octave-forge/main/openmpi_ext/inst/helloworld.m =================================================================== --- trunk/octave-forge/main/openmpi_ext/inst/helloworld.m 2012-08-21 01:12:21 UTC (rev 10893) +++ trunk/octave-forge/main/openmpi_ext/inst/helloworld.m 2012-08-22 02:46:39 UTC (rev 10894) @@ -15,7 +15,7 @@ # Please add the oct files openmpi_ext folder # For instance -addpath("../src"); +addpath('../src'); # if you have 4 cores or a network of 4 computers with a ssh connection with no password and same openmpi 1.3.3 installation # type at the terminal mpirun -np 4 octave --eval helloworld Modified: trunk/octave-forge/main/openmpi_ext/src/MPI_Barrier.cc =================================================================== --- trunk/octave-forge/main/openmpi_ext/src/MPI_Barrier.cc 2012-08-21 01:12:21 UTC (rev 10893) +++ trunk/octave-forge/main/openmpi_ext/src/MPI_Barrier.cc 2012-08-22 02:46:39 UTC (rev 10894) @@ -15,7 +15,7 @@ // You should have received a copy of the GNU General Public License along with // this program; if not, see <http://www.gnu.org/licenses/>. -#define NAME MPI_Barrier +#define NAME MPI_Barrier /* * ---------------------------------------------------- * Blocks until all processes in the communicator have reached this routine @@ -23,61 +23,64 @@ * ---------------------------------------------------- */ +#include "simple.h" -#include "simple.h" -DEFUN_DLD(NAME, args, ,"-*- texinfo -*-\n\ -@deftypefn {Loadable Function} {} @var{INFO} = MPI_Barrier (@var{COMM})\n\ -Blocks until all processes in the communicator have reached this routine.\n\ -If @var{COMM} octave comunicator object loaded with MPI_Comm_Load is omitted \n\ -returns an error. \n\ - @example\n\ - @group\n\ - @var{INFO} (int) return code\n\ - 0 MPI_SUCCESS No error\n\ - 5 MPI_ERR_COMM Invalid communicator (NULL?)\n\ - 13 MPI_ERR_ARG Invalid argument (typically a NULL pointer?)\n\ -@end group\n\ -@end example\n\ +DEFUN_DLD (NAME, args, , +"-*- texinfo -*-\n\ +@deftypefn {Loadable Function} {} @var{INFO} = MPI_Barrier (@var{COMM})\n \ +Blocks until all processes in the communicator have reached this routine.\n \ +If @var{COMM} octave comunicator object loaded with MPI_Comm_Load is omitted \n \ +returns an error. \n \ + @example\n \ + @group\n \ + @var{INFO} (int) return code\n \ + 0 MPI_SUCCESS No error\n \ + 5 MPI_ERR_COMM Invalid communicator (NULL?)\n \ + 13 MPI_ERR_ARG Invalid argument (typically a NULL pointer?)\n \ +@end group\n \ +@end example\n \ @end deftypefn") { - octave_value results; - int nargin = args.length (); - if (nargin != 1) - { - error ("expecting 1 input argument"); - return results; - } + octave_value results; + int nargin = args.length (); - if (!simple_type_loaded) + if (nargin != 1) + print_usage (); + else { - simple::register_type (); - simple_type_loaded = true; - mlock (); + if((args.length () != 1) + || args(0).type_id () != simple::static_type_id ()) + { + error ("MPI_Barrier: Please enter octave comunicator object"); + results(0) = octave_value(-1); + } + else + { + if (! simple_type_loaded) + { + simple::register_type (); + simple_type_loaded = true; + mlock (); + } + + const octave_base_value& rep = args(0).get_rep(); + const simple& B = ((const simple &)rep); + MPI_Comm comm = ((const simple&) B).comunicator_value (); + if (! error_state) + { + int my_size; + int info = MPI_Barrier (comm); + + results = info; + } + else + print_usage (); + } } - - if((args.length() != 1 ) - || args(0).type_id()!=simple::static_type_id()){ - - error("Please enter octave comunicator object!"); - return octave_value(-1); - } - - const octave_base_value& rep = args(0).get_rep(); - const simple& B = ((const simple &)rep); - MPI_Comm comm = ((const simple&) B).comunicator_value (); - if (! error_state) - { - int my_size; - int info = MPI_Barrier (comm); - - results = info; - } - else - print_usage (); - comm= NULL; - /* [info] = MPI_Barrier (comm) */ + comm= NULL; + /* [info] = MPI_Barrier (comm) */ - return results; + return results; } Modified: trunk/octave-forge/main/openmpi_ext/src/MPI_Comm_Load.cc =================================================================== --- trunk/octave-forge/main/openmpi_ext/src/MPI_Comm_Load.cc 2012-08-21 01:12:21 UTC (rev 10893) +++ trunk/octave-forge/main/openmpi_ext/src/MPI_Comm_Load.cc 2012-08-22 02:46:39 UTC (rev 10894) @@ -35,22 +35,19 @@ @end example\n\ @end deftypefn") { - if (!simple_type_loaded) - { - simple::register_type (); - simple_type_loaded = true; - mlock (); - } - octave_value retval; - if (args.length () != 1 || !args (0).is_string ()) + if (args.length () != 1 || ! args (0).is_string ()) + print_usage (); + else { - error ("MPI_Comm_Load: first argument must be a string"); - return retval; - } - - const std::string name = args (0).string_value (); - retval = new simple (name,MPI_COMM_WORLD); - + if (!simple_type_loaded) + { + simple::register_type (); + simple_type_loaded = true; + mlock (); + } + const std::string name = args (0).string_value (); + retval = new simple (name,MPI_COMM_WORLD); + } return retval; } Modified: trunk/octave-forge/main/openmpi_ext/src/MPI_Comm_Test.cc =================================================================== --- trunk/octave-forge/main/openmpi_ext/src/MPI_Comm_Test.cc 2012-08-21 01:12:21 UTC (rev 10893) +++ trunk/octave-forge/main/openmpi_ext/src/MPI_Comm_Test.cc 2012-08-22 02:46:39 UTC (rev 10894) @@ -33,24 +33,26 @@ @end example\n\ @end deftypefn") { - if (!simple_type_loaded) + octave_value retval; + if(args.length() != 1 + || args(0).type_id () != simple::static_type_id ()) { - simple::register_type (); - simple_type_loaded = true; - mlock (); + print_usage (); + results = octave_value (-1); } - - octave_value retval; - if(args.length() != 1 - || args(0).type_id()!=simple::static_type_id()){ - - error("usage: MPI_Comm_Test(octave_comunicator_object)"); - return octave_value(-1); - } - const octave_base_value& rep = args(0).get_rep(); - const simple& b = ((const simple &)rep); - octave_stdout << "MPI_Comm_Test has " << b.name_value() << " output arguments.\n"; - MPI_Comm res = b.comunicator_value(); - retval = b.name_value(); + else + { + if (! simple_type_loaded) + { + simple::register_type (); + simple_type_loaded = true; + mlock (); + } + const octave_base_value& rep = args(0).get_rep (); + const simple& b = ((const simple &)rep); + //octave_stdout << "MPI_Comm_Test has " << b.name_value() << " output arguments.\n"; + MPI_Comm res = b.comunicator_value (); + retval = b.name_value (); + } return retval; } Modified: trunk/octave-forge/main/openmpi_ext/src/MPI_Comm_rank.cc =================================================================== --- trunk/octave-forge/main/openmpi_ext/src/MPI_Comm_rank.cc 2012-08-21 01:12:21 UTC (rev 10893) +++ trunk/octave-forge/main/openmpi_ext/src/MPI_Comm_rank.cc 2012-08-22 02:46:39 UTC (rev 10894) @@ -15,7 +15,7 @@ // You should have received a copy of the GNU General Public License along with // this program; if not, see <http://www.gnu.org/licenses/>. -#define NAME MPI_Comm_rank +#define NAME MPI_Comm_rank /* * ---------------------------------------------------- * Determines the rank of the calling process in the communicator @@ -40,46 +40,40 @@ @end group\n\ @end example\n\ @end deftypefn") - { - octave_value_list results; - int nargin = args.length (); - if (nargin != 1) - { - error ("expecting 1 input argument"); - return results; - } + octave_value_list results; + int nargin = args.length (); - if (!simple_type_loaded) + if (nargin != 1) + print_usage (); + else { - simple::register_type (); - simple_type_loaded = true; - mlock (); - } + if (! simple_type_loaded) + { + simple::register_type (); + simple_type_loaded = true; + mlock (); + } - if((args.length() != 1 ) - || args(0).type_id()!=simple::static_type_id()){ - - error("Please enter octave comunicator object!"); - return octave_value(-1); - } + if (args(0).type_id () == simple::static_type_id ()) + { + const octave_base_value& rep = args(0).get_rep (); + const simple& B = ((const simple &)rep); + MPI_Comm comm = ((const simple&) B).comunicator_value (); + if (! error_state) + { + int my_rank; + int info = MPI_Comm_rank (comm, &my_rank); + if (nargout > 1) + results(1) = info; - const octave_base_value& rep = args(0).get_rep(); - const simple& B = ((const simple &)rep); - MPI_Comm comm = ((const simple&) B).comunicator_value (); - if (! error_state) - { - int my_rank; - int info = MPI_Comm_rank (comm, &my_rank); - if (nargout > 1) - results(1) = info; - results(0) = my_rank; - } - else - print_usage (); - comm= NULL; - /* [rank info] = MPI_Comm_rank (comm) */ - - return results; - + results(0) = my_rank; + } + else + print_usage (); + } + else + error ("MPI_Comm_rank: Please enter octave comunicator object"); + } + return results; } Modified: trunk/octave-forge/main/openmpi_ext/src/MPI_Comm_size.cc =================================================================== --- trunk/octave-forge/main/openmpi_ext/src/MPI_Comm_size.cc 2012-08-21 01:12:21 UTC (rev 10893) +++ trunk/octave-forge/main/openmpi_ext/src/MPI_Comm_size.cc 2012-08-22 02:46:39 UTC (rev 10894) @@ -15,7 +15,7 @@ // You should have received a copy of the GNU General Public License along with // this program; if not, see <http://www.gnu.org/licenses/>. -#define NAME MPI_Comm_size +#define NAME MPI_Comm_size /* * ---------------------------------------------------- * Determines the size of the calling process in the communicator @@ -42,46 +42,45 @@ @end deftypefn") { - octave_value_list results; - int nargin = args.length (); - if (nargin != 1) - { - error ("expecting 1 input argument"); - return results; - } - - if (!simple_type_loaded) + octave_value_list results; + int nargin = args.length (); + if (nargin != 1) + print_usage (); + else { - simple::register_type (); - simple_type_loaded = true; - mlock (); - } + if (! simple_type_loaded) + { + simple::register_type (); + simple_type_loaded = true; + mlock (); + } - if((args.length() != 1 ) - || args(0).type_id()!=simple::static_type_id()){ - - error("Please enter octave comunicator object!"); - return octave_value(-1); + if ((args.length() != 1 ) + || args(0).type_id () != simple::static_type_id ()) + { + error("MPI_Comm_size: Please enter octave comunicator object"); + results(0) = octave_value(-1); } - - const octave_base_value& rep = args(0).get_rep(); - const simple& B = ((const simple &)rep); - MPI_Comm comm = ((const simple&) B).comunicator_value (); - - - if (! error_state) - { - int my_size; - int info = MPI_Comm_size (comm, &my_size); - if (nargout > 1) - results(1) = info; - results(0) = my_size; - } - else - print_usage (); - comm= NULL; - /* [size info] = MPI_Comm_size (comm) */ - - return results; + else + { + const octave_base_value& rep = args(0).get_rep (); + const simple& B = ((const simple &)rep); + MPI_Comm comm = ((const simple&) B).comunicator_value (); + + if (! error_state) + { + int my_size; + int info = MPI_Comm_size (comm, &my_size); + if (nargout > 1) + results(1) = info; + results(0) = my_size; + } + else + print_usage (); + } + comm = NULL; + /* [size info] = MPI_Comm_size (comm) */ + } + return results; } Modified: trunk/octave-forge/main/openmpi_ext/src/MPI_Finalize.cc =================================================================== --- trunk/octave-forge/main/openmpi_ext/src/MPI_Finalize.cc 2012-08-21 01:12:21 UTC (rev 10893) +++ trunk/octave-forge/main/openmpi_ext/src/MPI_Finalize.cc 2012-08-22 02:46:39 UTC (rev 10894) @@ -14,13 +14,15 @@ // You should have received a copy of the GNU General Public License along with // this program; if not, see <http://www.gnu.org/licenses/>. -#define NAME MPI_Finalize +#define NAME MPI_Finalize + /* * ---------------------------------------------------- * Terminates MPI execution environment * info = MPI_Finalize * ---------------------------------------------------- */ + #include "mpi.h" #include <octave/oct.h> @@ -39,8 +41,6 @@ @end example\n\ @end deftypefn") { - - int info = MPI_Finalize(); - - return octave_value(info); + int info = MPI_Finalize (); + return octave_value (info); } Modified: trunk/octave-forge/main/openmpi_ext/src/MPI_Finalized.cc =================================================================== --- trunk/octave-forge/main/openmpi_ext/src/MPI_Finalized.cc 2012-08-21 01:12:21 UTC (rev 10893) +++ trunk/octave-forge/main/openmpi_ext/src/MPI_Finalized.cc 2012-08-22 02:46:39 UTC (rev 10894) @@ -14,7 +14,7 @@ // You should have received a copy of the GNU General Public License along with // this program; if not, see <http://www.gnu.org/licenses/>. -#define NAME MPI_Finalized +#define NAME MPI_Finalized /* * ---------------------------------------------------- * Indicates whether MPI_Finalize has completed @@ -39,14 +39,15 @@ @end example\n\ @end deftypefn") { - octave_value_list results; - int flag; + octave_value_list results; + int flag; + + int info = MPI_Finalized (&flag); + if (nargout > 1) + results(1) = info; - int info = MPI_Finalized(&flag); - if (nargout > 1) - results(1) = info; - results(0) = flag != 0; - return results; + results(0) = flag != 0; + return results; - /* [flag info] = MPI_Finalized */ + /* [flag info] = MPI_Finalized */ } Modified: trunk/octave-forge/main/openmpi_ext/src/MPI_Get_processor_name.cc =================================================================== --- trunk/octave-forge/main/openmpi_ext/src/MPI_Get_processor_name.cc 2012-08-21 01:12:21 UTC (rev 10893) +++ trunk/octave-forge/main/openmpi_ext/src/MPI_Get_processor_name.cc 2012-08-22 02:46:39 UTC (rev 10894) @@ -17,6 +17,7 @@ #include "mpi.h" #include <octave/oct.h> + DEFUN_DLD(MPI_Get_processor_name, args, nargout,"-*- texinfo -*-\n\ @deftypefn {Loadable Function} {} @var{name,resultlen,INFO} = MPI_Get_processor_name()\n\ Get the name of the processor that is using MPI\n\ @@ -33,24 +34,26 @@ @end example\n\ @end deftypefn") { - int info; - int nargin = args.length(); - for (int i=0; i<nargin; i++){ - if( nargin != 0 ) { - error("MPI_Get_processor_name: please do not enter arguments"); - return octave_value (MPI_ERR_ARG); // error returns nothing + int info; + int nargin = args.length (); + octave_value_list results; + if (nargin != 0) + { + print_usage (); + results(0) = octave_value (MPI_ERR_ARG); } + else + { + std::string cpp_string; + char argv[MPI_MAX_PROCESSOR_NAME]; + int resultlen = 0; + + info = MPI_Get_processor_name (argv, &resultlen); + cpp_string = argv; + results(0) = cpp_string; + results(1) = resultlen; + results(2) = info; } - octave_value_list results; - std::string cpp_string; - char argv[MPI_MAX_PROCESSOR_NAME]; - int resultlen=0; - - info = MPI_Get_processor_name(argv, &resultlen); - cpp_string = argv; - results(0) = cpp_string; - results(1) = resultlen; - results(2) = info; - return results; + return results; } Modified: trunk/octave-forge/main/openmpi_ext/src/MPI_Init.cc =================================================================== --- trunk/octave-forge/main/openmpi_ext/src/MPI_Init.cc 2012-08-21 01:12:21 UTC (rev 10893) +++ trunk/octave-forge/main/openmpi_ext/src/MPI_Init.cc 2012-08-22 02:46:39 UTC (rev 10894) @@ -21,10 +21,11 @@ * ---------------------------------------------------- */ -#define NAME MPI_Init +#define NAME MPI_Init #include "mpi.h" // mpi.h, oct.h #include <octave/oct.h> + DEFUN_DLD(NAME, args, nargout,"-*- texinfo -*-\n\ @deftypefn {Loadable Function} {} @var{INFO} = MPI_Init()\n\ Initialize the MPI execution environment\n\ @@ -41,22 +42,21 @@ @end example\n\ @end deftypefn") { - int nargin = args.length(); - for (int i=0; i<nargin; i++){ - if( ! args(i).is_string() ) { - error("MPI_Init: args must be strings"); - return octave_value (MPI_ERR_ARG); // error returns nothing + int nargin = args.length(); + for (int i = 0; i < nargin; i++) + { + if (! args(i).is_string ()) + { + error ("MPI_Init: args must be strings"); + return octave_value (MPI_ERR_ARG); // error returns nothing + } } - } - string_vector argvec = args.make_argv("MPI_Init"); - char **argve= argvec.c_str_vec(); - char **argv =&argve[1]; - -// printf("args: "); for (int i=0; i<nargin; i++) printf("%s ",argv[i]); -// printf("\n"); - - int info = MPI_Init(&nargin, &argv); + string_vector argvec = args.make_argv ("MPI_Init"); + char **argve= argvec.c_str_vec (); + char **argv = &argve[1]; + + int info = MPI_Init (&nargin, &argv); free(argve); return octave_value (info); } Modified: trunk/octave-forge/main/openmpi_ext/src/MPI_Initialized.cc =================================================================== --- trunk/octave-forge/main/openmpi_ext/src/MPI_Initialized.cc 2012-08-21 01:12:21 UTC (rev 10893) +++ trunk/octave-forge/main/openmpi_ext/src/MPI_Initialized.cc 2012-08-22 02:46:39 UTC (rev 10894) @@ -14,15 +14,17 @@ // You should have received a copy of the GNU General Public License along with // this program; if not, see <http://www.gnu.org/licenses/>. -#define NAME MPI_Initialized +#define NAME MPI_Initialized /* * ---------------------------------------------------- * Indicates whether MPI_Initialize has been called * [info flag] = MPI_Initialized * ---------------------------------------------------- */ + #include "mpi.h" #include <octave/oct.h> + DEFUN_DLD(NAME, args, nargout,"-*- texinfo -*-\n\ @deftypefn {Loadable Function} {} [@var{FLAG} @var{INFO}] = MPI_Initialized\n\ Indicates whether MPI_Init has been called\n\ @@ -41,12 +43,12 @@ { octave_value_list results; int flag; + int info = MPI_Initialized (&flag); + if (nargout > 1) + results (1) = info; - int info = MPI_Initialized(&flag); - if (nargout > 1) - results(1) = info; - results(0) = flag != 0; + results(0) = octave_value (flag != 0); + return results; - /* [flag info] = MPI_Initialized */ } Modified: trunk/octave-forge/main/openmpi_ext/src/MPI_Iprobe.cc =================================================================== --- trunk/octave-forge/main/openmpi_ext/src/MPI_Iprobe.cc 2012-08-21 01:12:21 UTC (rev 10893) +++ trunk/octave-forge/main/openmpi_ext/src/MPI_Iprobe.cc 2012-08-22 02:46:39 UTC (rev 10894) @@ -14,37 +14,37 @@ // You should have received a copy of the GNU General Public License along with // this program; if not, see <http://www.gnu.org/licenses/>. -#define NAME MPI_Iprobe +#define NAME MPI_Iprobe /* * ---------------------------------------------------- * Nonblocking test for a message * [info flag stat] = MPI_Iprobe (src, tag, comm) * ---------------------------------------------------- */ + #include "simple.h" #include <octave/ov-struct.h> -Octave_map put_MPI_Stat (const MPI_Status &stat){ -/*---------------------------------------------*/ - Octave_map map; - octave_value tmp = stat.MPI_SOURCE; - map.assign("src", tmp); - tmp = stat.MPI_TAG; - map.assign("tag", tmp ); - tmp = stat.MPI_ERROR; - map.assign("err", tmp ); - tmp = stat._count; - map.assign("cnt", tmp); - tmp = stat._cancelled; - map.assign("can", tmp); +Octave_map put_MPI_Stat (const MPI_Status &stat) +{ + /*---------------------------------------------*/ + Octave_map map; + octave_value tmp = stat.MPI_SOURCE; + map.assign ("src", tmp); + tmp = stat.MPI_TAG; + map.assign ("tag", tmp ); + tmp = stat.MPI_ERROR; + map.assign ("err", tmp ); + tmp = stat._count; + map.assign ("cnt", tmp); + tmp = stat._cancelled; + map.assign ("can", tmp); - return map; + return map; } - - DEFUN_DLD(NAME, args, nargout,"-*- texinfo -*-\n\ -@deftypefn {Loadable Function} {} [@var{FLAG} @var{STAT} @var{INFO}] = MPI_Iprobe(@var{SRCRANK}, @var{TAG}, @var{COMM})\n\ +@deftypefn {Loadable Function} {} [@var{FLAG} @var{STAT} @var{INFO}] = MPI_Iprobe(@var{SRCRANK}, @var{TAG}, @var{COMM})\n \ Nonblocking test for a message\n\ @example\n\ @group\n\ @@ -70,58 +70,47 @@ SEE ALSO: MPI_Probe, MPI_Recv, MPI documentation for examples\n\ @end deftypefn") { - octave_value_list results; - int nargin = args.length (); - if (nargin != 3) - { - error ("expecting 3 input arguments"); - return results; - } - - - - - if (!simple_type_loaded) + octave_value_list results; + int nargin = args.length (); + if (nargin != 3) + print_usage (); + else { - simple::register_type (); - simple_type_loaded = true; - mlock (); - } + if (! simple_type_loaded) + { + simple::register_type (); + simple_type_loaded = true; + mlock (); + } - if( args(2).type_id()!=simple::static_type_id()){ - - error("Please enter octave comunicator object!"); - return octave_value(-1); - } - - const octave_base_value& rep = args(2).get_rep(); - const simple& B = ((const simple &)rep); - MPI_Comm comm = ((const simple&) B).comunicator_value (); - if (error_state) - return results; - - int src = args(0).int_value(); - if (error_state) - { - error ("expecting first argument to be an integer"); - return results; + if (args(2).type_id() != simple::static_type_id ()) + { + error ("MPI_Iprobe: Please enter octave comunicator object"); + results = octave_value (-1); + } + else + { + const octave_base_value& rep = args(2).get_rep(); + const simple& B = ((const simple &)rep); + MPI_Comm comm = ((const simple&) B).comunicator_value (); + int src = args(0).int_value(); + int tag = args(1).int_value(); + if (! error_state) + { + int flag; + MPI_Status stat = {0, 0, 0, 0}; + int info = MPI_Iprobe (src, tag, comm, &flag, &stat); + comm = NULL; + results(0) = flag; + results(1) = put_MPI_Stat (stat); + results(2) = info; + } + else + print_usage (); + } } - - int tag = args(1).int_value(); - if (error_state) - { - error ("expecting second argument to be an integer"); - return results; - } - int flag; - MPI_Status stat = {0,0,0,0}; - int info = MPI_Iprobe(src,tag,comm,&flag,&stat); - comm= NULL; - results(0) = flag; - results(1) = put_MPI_Stat(stat); - results(2) = info; - return results; - /* [flag stat info] = MPI_Iprobe (src, tag, comm) */ + return results; + /* [flag stat info] = MPI_Iprobe (src, tag, comm) */ } Modified: trunk/octave-forge/main/openmpi_ext/src/MPI_Op_Load.cc =================================================================== --- trunk/octave-forge/main/openmpi_ext/src/MPI_Op_Load.cc 2012-08-21 01:12:21 UTC (rev 10893) +++ trunk/octave-forge/main/openmpi_ext/src/MPI_Op_Load.cc 2012-08-22 02:46:39 UTC (rev 10894) @@ -17,23 +17,23 @@ DEFUN_DLD(MPI_Op_Load, args, ,"") { - if (!simpleop_type_loaded) + octave_value_list retval; + if (! simpleop_type_loaded) { simpleop::register_type (); simpleop_type_loaded = true; mlock (); } - + octave_value retval; - if (args.length () != 1 || !args (0).is_string ()) + if (args.length () != 1 + || ! args (0).is_string ()) + print_usage (); + else { - error ("simpleop: first argument must be a string"); - return retval; + const std::string name = args (0).string_value (); + MPI_Op OP; + retval = new simpleop (name, OP); } - - const std::string name = args (0).string_value (); - MPI_Op OP; - retval = new simpleop (name,OP); - return retval; } Modified: trunk/octave-forge/main/openmpi_ext/src/MPI_Op_Test.cc =================================================================== --- trunk/octave-forge/main/openmpi_ext/src/MPI_Op_Test.cc 2012-08-21 01:12:21 UTC (rev 10893) +++ trunk/octave-forge/main/openmpi_ext/src/MPI_Op_Test.cc 2012-08-22 02:46:39 UTC (rev 10894) @@ -17,7 +17,8 @@ DEFUN_DLD(MPI_Op_Test, args, ,"") { - if (!simpleop_type_loaded) + + if (! simpleop_type_loaded) { simpleop::register_type (); simpleop_type_loaded = true; @@ -25,16 +26,19 @@ } octave_value retval; - if(args.length() != 1 - || args(0).type_id()!=simpleop::static_type_id()){ - - error("usage: simpleoptest(simpleopobject)"); - return octave_value(-1); - } - const octave_base_value& rep = args(0).get_rep(); - const simpleop& b = ((const simpleop &)rep); - octave_stdout << "simpleoptest has " << b.name_value() << " output arguments.\n"; - MPI_Op res = b.operator_value(); - + if (args.length () != 1 + || args(0).type_id() != simpleop::static_type_id () + || error_state) + { + print_usage (); + retval = octave_value (-1); + } + else + { + const octave_base_value& rep = args(0).get_rep(); + const simpleop& b = ((const simpleop &)rep); + octave_stdout << "simpleoptest has " << b.name_value() << " output arguments.\n"; + MPI_Op res = b.operator_value(); + } return retval; } Modified: trunk/octave-forge/main/openmpi_ext/src/MPI_Probe.cc =================================================================== --- trunk/octave-forge/main/openmpi_ext/src/MPI_Probe.cc 2012-08-21 01:12:21 UTC (rev 10893) +++ trunk/octave-forge/main/openmpi_ext/src/MPI_Probe.cc 2012-08-22 02:46:39 UTC (rev 10894) @@ -14,7 +14,7 @@ // You should have received a copy of the GNU General Public License along with // this program; if not, see <http://www.gnu.org/licenses/>. -#define NAME MPI_Probe +#define NAME MPI_Probe /* * ---------------------------------------------------- * Blocking test for a message @@ -22,30 +22,28 @@ * ---------------------------------------------------- */ #include "simple.h" - #include <octave/ov-struct.h> - - -Octave_map put_MPI_Stat (const MPI_Status &stat){ -/*---------------------------------------------*/ - Octave_map map; - octave_value tmp = stat.MPI_SOURCE; - map.assign("src", tmp); - tmp = stat.MPI_TAG; - map.assign("tag", tmp ); - tmp = stat.MPI_ERROR; - map.assign("err", tmp ); - tmp = stat._count; - map.assign("cnt", tmp); - tmp = stat._cancelled; - map.assign("can", tmp); - - return map; +Octave_map put_MPI_Stat (const MPI_Status &stat) +{ + /*---------------------------------------------*/ + Octave_map map; + octave_value tmp = stat.MPI_SOURCE; + map.assign ("src", tmp); + tmp = stat.MPI_TAG; + map.assign ("tag", tmp); + tmp = stat.MPI_ERROR; + map.assign ("err", tmp); + tmp = stat._count; + map.assign("cnt", tmp); + tmp = stat._cancelled; + map.assign("can", tmp); + + return map; } DEFUN_DLD(NAME, args, nargout,"-*- texinfo -*-\n\ -@deftypefn {Loadable Function} {} [@var{STAT} @var{INFO}] = MPI_Probe(@var{SRCRANK}, @var{TAG}, @var{COMM})\n\ +@deftypefn {Loadable Function} {} [@var{STAT} @var{INFO}] = MPI_Probe(@var{SRCRANK}, @var{TAG}, @var{COMM})\n \ blocking test for a message\n\ @example\n\ @group\n\ @@ -68,57 +66,46 @@ SEE ALSO: MPI_Iprobe, MPI_Recv, and MPI documentation for C examples\n\ @end deftypefn") { - octave_value_list results; - int nargin = args.length (); - if (nargin != 3) - { - error ("expecting 3 input arguments"); - return results; - } - - - - - - - if (!simple_type_loaded) + octave_value_list results; + int nargin = args.length (); + if (nargin != 3) + print_usage (); + else { - simple::register_type (); - simple_type_loaded = true; - mlock (); - } + if (!simple_type_loaded) + { + simple::register_type (); + simple_type_loaded = true; + mlock (); + } - if( args(2).type_id()!=simple::static_type_id()){ - - error("Please enter octave comunicator object!"); - return octave_value(-1); - } + if (args(2).type_id () == simple::static_type_id ()) + { + const octave_base_value& rep = args(2).get_rep (); + const simple& B = ((const simple &)rep); + MPI_Comm comm = ((const simple&) B).comunicator_value (); + int src = args(0).int_value (); + int tag = args(1).int_value (); + + if (! error_status) + { + MPI_Status stat = {0, 0, 0, 0}; + int info = MPI_Probe (src, tag, comm, &stat); + comm= NULL; + results(0) = put_MPI_Stat (stat); + results(1) = info; + } + } + else + { + print_usage (); + results = octave_value (-1); + } - const octave_base_value& rep = args(2).get_rep(); - const simple& B = ((const simple &)rep); - MPI_Comm comm = ((const simple&) B).comunicator_value (); - int src = args(0).int_value(); - if (error_state) - { - error ("expecting first argument to be an integer"); return results; + + /* [ stat info ] = MPI_Probe (src, tag, comm) */ } - - int tag = args(1).int_value(); - if (error_state) - { - error ("expecting second argument to be an integer"); - return results; - } - MPI_Status stat = {0,0,0,0}; - int info = MPI_Probe(src,tag,comm,&stat); - comm= NULL; - results(0) = put_MPI_Stat(stat); - results(1) = info; - return results; - /* [ stat info ] = MPI_Probe (src, tag, comm) */ } - - Modified: trunk/octave-forge/main/openmpi_ext/src/MPI_Recv.cc =================================================================== --- trunk/octave-forge/main/openmpi_ext/src/MPI_Recv.cc 2012-08-21 01:12:21 UTC (rev 10893) +++ trunk/octave-forge/main/openmpi_ext/src/MPI_Recv.cc 2012-08-22 02:46:39 UTC (rev 10894) @@ -1,5 +1,6 @@ // Copyright (C) 2009 Riccardo Corradini <ric...@ya...> // Copyright (C) 2009 VZLU Prague +// Copyright (C) 2012 Carlo de Falco // // This program 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 @@ -18,38 +19,41 @@ #include <ov-cell.h> // avoid errmsg "cell -- incomplete datatype" #include <oct-map.h> // avoid errmsg "Oct.map -- invalid use undef type" +/*---------------------*/ +/* forward declaration */ +int recv_class (MPI_Comm comm, octave_value &ov, int source, int mytag); -/*----------------------------------*/ /* forward declaration */ +/*-----------------------------*/ +/* along the datatype */ +/* to receive any octave_value */ +int recv_cell (MPI_Comm comm, octave_value &ov, int source, int mytag); +int recv_struct ( MPI_Comm comm, octave_value &ov, int source, int mytag); +int recv_string ( MPI_Comm comm, octave_value &ov, int source, int mytag); +int recv_range (MPI_Comm comm, octave_value &ov, int source, int mytag); - -int recv_class( MPI_Comm comm, octave_value &ov, int source, int mytag); /* along the datatype */ -/*----------------------------------*/ /* to receive any octave_value */ - -int recv_cell(MPI_Comm comm,octave_value &ov, int source, int mytag); -int recv_struct( MPI_Comm comm, octave_value &ov, int source, int mytag); -int recv_string( MPI_Comm comm, octave_value &ov,int source, int mytag); -int recv_range(MPI_Comm comm, octave_value &ov,int source, int mytag); - template<class AnyElem> -int recv_vec(MPI_Comm comm, AnyElem &LBNDA, int nitem, MPI_Datatype TRCV ,int source, int mytag); +int recv_vec (MPI_Comm comm, AnyElem &LBNDA, int nitem, MPI_Datatype TRCV, int source, int mytag); -int recv_matrix(bool is_complex,MPI_Datatype TRcv, MPI_Comm comm, octave_value &ov,int source, int mytag); -int recv_sp_mat(bool is_complex,MPI_Datatype TRcv, MPI_Comm comm, octave_value &ov,int source, int mytag); +int recv_matrix (bool is_complex, MPI_Datatype TRcv, MPI_Comm comm, octave_value &ov, int source, int mytag); +int recv_sp_mat (bool is_complex, MPI_Datatype TRcv, MPI_Comm comm, octave_value &ov, int source, int mytag); template <class Any> int recv_scalar(MPI_Datatype TRcv, MPI_Comm comm, Any *d, int source, int mytag); + template <class Any> int recv_scalar(MPI_Datatype TRcv, MPI_Comm comm, std::complex<Any> *d, int source, int mytag); - - -int recv_range(MPI_Comm comm, octave_value &ov,int source, int mytag){ /* put base,limit,incr,nelem */ -/*-------------------------------*/ /* just 3 doubles + 1 int */ -// octave_range (double base, double limit, double inc) +int recv_range (MPI_Comm comm, octave_value &ov, int source, int mytag) +{ + /*---------------------------*/ + /* put base,limit,incr,nelem */ + /* just 3 doubles + 1 int */ + + // octave_range (double base, double limit, double inc) MPI_Status stat; OCTAVE_LOCAL_BUFFER(int,tanktag,3); tanktag[0] = mytag; @@ -58,578 +62,629 @@ OCTAVE_LOCAL_BUFFER(double,d,2); // first receive - int info = MPI_Recv(d, 3, MPI_DOUBLE, source, tanktag[1] , comm,&stat); - if (info !=MPI_SUCCESS) return info; - int nelem=0; - info = MPI_Recv(&nelem, 1, MPI_INT, source, tanktag[2] , comm,&stat); - if (info !=MPI_SUCCESS) return info; -// b = d[0]; -// l = d[1]; -// i = d[2]; - Range r(d[0],d[2],nelem); - ov =r; -return(info); + int info = MPI_Recv (d, 3, MPI_DOUBLE, source, tanktag[1], comm, &stat); + if (info != MPI_SUCCESS) + return info; + + int nelem = 0; + info = MPI_Recv (&nelem, 1, MPI_INT, source, tanktag[2], comm, &stat); + + if (info != MPI_SUCCESS) + return info; + + Range r (d[0], d[2], nelem); + ov = r; + + return info; } // This will get the fortran_vec vector for Any type Octave can handle template<class AnyElem> -int recv_vec(MPI_Comm comm, AnyElem &LBNDA, int nitem ,MPI_Datatype TRCV ,int source, int mytag) +int recv_vec (MPI_Comm comm, AnyElem &LBNDA, int nitem, MPI_Datatype TRCV, int source, int mytag) { - MPI_Datatype fortvec; - MPI_Type_contiguous(nitem,TRCV, &fortvec); - MPI_Type_commit(&fortvec); - MPI_Status stat; - int info = MPI_Recv((LBNDA), 1,fortvec, source, mytag , comm,&stat); - return(info); + MPI_Datatype fortvec; + MPI_Type_contiguous (nitem, TRCV, &fortvec); + MPI_Type_commit (&fortvec); + MPI_Status stat; + int info = MPI_Recv ((LBNDA), 1, fortvec, source, mytag, comm, &stat); + return (info); } - - // template specialization for complex case template <class Any> -int recv_scalar(MPI_Datatype TRcv ,MPI_Comm comm, std::complex<Any> &d, int source, int mytag){ +int recv_scalar (MPI_Datatype TRcv, MPI_Comm comm, std::complex<Any> &d, int source, int mytag) +{ int info; MPI_Status stat; OCTAVE_LOCAL_BUFFER(int,tanktag,2); tanktag[0] = mytag; tanktag[1] = mytag+1; OCTAVE_LOCAL_BUFFER(std::complex<Any>,Deco,2); - Deco[0] = real(d); - Deco[1] = imag(d); + Deco[0] = real (d); + Deco[1] = imag (d); - info = MPI_Recv((&Deco), 2,TRcv, source, tanktag[1] , comm,&stat); - if (info !=MPI_SUCCESS) return info; + info = MPI_Recv ((&Deco), 2, TRcv, source, tanktag[1], comm, &stat); - return(info); + return info; } template <class Any> -int recv_scalar(MPI_Datatype TRcv , MPI_Comm comm, Any &d, int source, int mytag){ /* directly MPI_Recv it, */ -/*-----------------------------*/ /* it's just a value */ -OCTAVE_LOCAL_BUFFER(int,tanktag,2); +int recv_scalar (MPI_Datatype TRcv, MPI_Comm comm, Any &d, int source, int mytag) +{ + /*-----------------------*/ + /* it's just a value */ + /* directly MPI_Recv it, */ + + OCTAVE_LOCAL_BUFFER(int,tanktag,2); tanktag[0]=mytag; tanktag[1]=mytag+1; int info; MPI_Status stat; - info = MPI_Recv((&d), 1,TRcv, source, tanktag[1] , comm,&stat); - if (info !=MPI_SUCCESS) return info; - return(info); + info = MPI_Recv (&d, 1, TRcv, source, tanktag[1], comm, &stat); + + return info; } -int recv_string( MPI_Comm comm, octave_value &ov,int source, int mytag){ -/*-----------------------------*/ /* it's just a string value */ -std::string cpp_string; -OCTAVE_LOCAL_BUFFER(int, tanktag, 2); -tanktag[0]=mytag; -tanktag[1]=mytag+1; -tanktag[2]=mytag+2; +int recv_string (MPI_Comm comm, octave_value &ov, int source, int mytag) +{ + /*---------------------------*/ + /* it's just a string value */ + std::string cpp_string; + OCTAVE_LOCAL_BUFFER(int, tanktag, 2); + tanktag[0]=mytag; + tanktag[1]=mytag+1; + tanktag[2]=mytag+2; + int info,nitem; MPI_Status stat; - info = MPI_Recv((&nitem), 1,MPI_INT, source, tanktag[1] , comm,&stat); -// printf("I have received number of elements %i \n",nitem); + info = MPI_Recv ((&nitem), 1, MPI_INT, source, tanktag[1], comm, &stat); OCTAVE_LOCAL_BUFFER(char,mess,nitem+1); - if (info !=MPI_SUCCESS) return info; + if (info != MPI_SUCCESS) + return info; MPI_Datatype fortvec; - MPI_Type_contiguous(nitem+1,MPI_CHAR, &fortvec); - MPI_Type_commit(&fortvec); + MPI_Type_contiguous (nitem + 1, MPI_CHAR, &fortvec); + MPI_Type_commit (&fortvec); - - info = MPI_Recv(mess, 1,fortvec, source, tanktag[2] , comm,&stat); -// printf("Flag for string received %i \n",info); - - cpp_string = mess; - ov = cpp_string; - if (info !=MPI_SUCCESS) return info; - return(MPI_SUCCESS); + info = MPI_Recv (mess, 1, fortvec, source, tanktag[2], comm, &stat); + if (info != MPI_SUCCESS) + return info; + + cpp_string = mess; + ov = cpp_string; + + return info; } -int recv_matrix( bool is_complex,MPI_Datatype TRCV,const MPI_Comm comm, octave_value &ov, int source, int mytag){ +int recv_matrix (bool is_complex, MPI_Datatype TRCV, const MPI_Comm comm, octave_value &ov, int source, int mytag) +{ -OCTAVE_LOCAL_BUFFER(int, tanktag, 6); -tanktag[0] = mytag; -tanktag[1] = mytag+1; -tanktag[2] = mytag+2; -tanktag[3] = mytag+3; -tanktag[4] = mytag+4; -tanktag[5] = mytag+5; + OCTAVE_LOCAL_BUFFER(int, tanktag, 6); + tanktag[0] = mytag; + tanktag[1] = mytag+1; + tanktag[2] = mytag+2; + tanktag[3] = mytag+3; + tanktag[4] = mytag+4; + tanktag[5] = mytag+5; int info; int nitem,nd; MPI_Status stat; dim_vector dv; - info = MPI_Recv((&nitem), 1,MPI_INT, source, tanktag[1] , comm,&stat); -// printf("info for nitem=%i\n",info); -// printf("nitem=%i\n",nitem); - if (info !=MPI_SUCCESS) return info; - info = MPI_Recv((&nd), 1,MPI_INT, source, tanktag[2] , comm,&stat); -// printf("info for nd=%i\n",info); -// printf("nd=%i\n",nd); - if (info !=MPI_SUCCESS) return info; + info = MPI_Recv ((&nitem), 1, MPI_INT, source, tanktag[1], comm, &stat); + if (info != MPI_SUCCESS) + return info; + + info = MPI_Recv (&nd, 1, MPI_INT, source, tanktag[2], comm, &stat); + if (info != MPI_SUCCESS) + return info; -// Now create contiguous datatype for dim vector - dv.resize(nd); + // Now create contiguous datatype for dim vector + dv.resize (nd); OCTAVE_LOCAL_BUFFER(int,dimV,nd); MPI_Datatype dimvec; - MPI_Type_contiguous(nd,MPI_INT, &dimvec); - MPI_Type_commit(&dimvec); + MPI_Type_contiguous (nd, MPI_INT, &dimvec); + MPI_Type_commit (&dimvec); - info = MPI_Recv((dimV), 1,dimvec, source, tanktag[3] , comm,&stat); -// printf("info for dim vector=%i\n",info); - if (info !=MPI_SUCCESS) return info; + info = MPI_Recv (dimV, 1, dimvec, source, tanktag[3], comm, &stat); + if (info != MPI_SUCCESS) + return info; -// Now reverse the content of int vector into dim vector - for (octave_idx_type i=0; i<nd; i++) - { - dv(i) = dimV[i] ; - } - if (TRCV == MPI_DOUBLE and is_complex == false ) - { - NDArray myNDA(dv); - OCTAVE_LOCAL_BUFFER(double, LBNDA,nitem); - info = recv_vec(comm, LBNDA,nitem ,TRCV ,source, tanktag[4]); - if (info !=MPI_SUCCESS) return info; - - for (octave_idx_type i=0; i<nitem; i++) - { - myNDA(i)=LBNDA[i]; - } - ov=myNDA; - } - - else if (TRCV == MPI_DOUBLE and is_complex== true ) - { - OCTAVE_LOCAL_BUFFER(double,LBNDA1,nitem); - info = recv_vec(comm, LBNDA1,nitem ,TRCV ,source, tanktag[4]); - if (info !=MPI_SUCCESS) return info; - ComplexNDArray myNDA(dv); - OCTAVE_LOCAL_BUFFER(double,LBNDA2,nitem); - info = recv_vec(comm, LBNDA2,nitem ,TRCV ,source, tanktag[5]); - if (info !=MPI_SUCCESS) return info; - for (octave_idx_type i=0; i<nitem; i++) - { - myNDA(i)=real(LBNDA1[i])+imag(LBNDA2[i]); - } - ov=myNDA; - } - else if (TRCV == MPI_INT) - { - OCTAVE_LOCAL_BUFFER(bool,LBNDA,nitem);// tested on Octave 3.2.4 - TRCV = MPI_INT; - info = recv_vec(comm, LBNDA,nitem ,TRCV ,source, tanktag[4]); - if (info !=MPI_SUCCESS) return info; - int32NDArray myNDA(dv); - for (octave_idx_type i=0; i<nitem; i++) - { - myNDA(i)=LBNDA[i]; - } - ov=myNDA; - } - else if (TRCV == MPI_FLOAT) - { - OCTAVE_LOCAL_BUFFER(float,LBNDA,nitem); - info = recv_vec(comm, LBNDA,nitem ,TRCV ,source, tanktag[4]); - if (info !=MPI_SUCCESS) return info; - FloatNDArray myNDA(dv); - for (octave_idx_type i=0; i<nitem; i++) - { - myNDA(i)=LBNDA[i]; - } - ov=myNDA; - } - else if (TRCV == MPI_FLOAT and is_complex == true) - { - OCTAVE_LOCAL_BUFFER(float,LBNDA1,nitem); - info = recv_vec(comm, LBNDA1,nitem ,TRCV ,source, tanktag[4]); - if (info !=MPI_SUCCESS) return info; - OCTAVE_LOCAL_BUFFER(float,LBNDA2,nitem); - info = recv_vec(comm, LBNDA2,nitem ,TRCV ,source, tanktag[5]); - if (info !=MPI_SUCCESS) return info; - FloatComplexNDArray myNDA(dv); - for (octave_idx_type i=0; i<nitem; i++) - { - myNDA(i)=real(LBNDA1[i])+imag(LBNDA2[i]); - } - ov=myNDA; - } - else if (TRCV == MPI_BYTE ) - { - OCTAVE_LOCAL_BUFFER(octave_int8,LBNDA1,nitem); - info = recv_vec(comm, LBNDA1,nitem ,TRCV ,source, tanktag[4]); - if (info !=MPI_SUCCESS) return info; - int8NDArray myNDA(dv); - for (octave_idx_type i=0; i<nitem; i++) - { - myNDA(i)=LBNDA1[i]; - } - ov=myNDA; - } - else if (TRCV == MPI_SHORT) - { - OCTAVE_LOCAL_BUFFER(octave_int16,LBNDA,nitem); - info = recv_vec(comm, LBNDA,nitem ,TRCV ,source, tanktag[4]); - if (info !=MPI_SUCCESS) return info; - int16NDArray myNDA(dv); - for (octave_idx_type i=0; i<nitem; i++) - { - myNDA(i)=LBNDA[i]; - } - ov=myNDA; - } - - else if (TRCV == MPI_LONG_LONG) - { - OCTAVE_LOCAL_BUFFER(octave_int64,LBNDA,nitem); - info = recv_vec(comm, LBNDA,nitem ,TRCV ,source, tanktag[4]); - int64NDArray myNDA(dv); - if (info !=MPI_SUCCESS) return info; - for (octave_idx_type i=0; i<nitem; i++) - { - myNDA(i)=LBNDA[i]; - } - ov=myNDA; - } - else if (TRCV == MPI_UNSIGNED_CHAR) - { - OCTAVE_LOCAL_BUFFER(octave_uint8,LBNDA,nitem); - info = recv_vec(comm, LBNDA,nitem ,TRCV ,source, tanktag[4]); - if (info !=MPI_SUCCESS) return info; - uint8NDArray myNDA(dv); - for (octave_idx_type i=0; i<nitem; i++) - { - myNDA(i)=LBNDA[i]; - } - ov=myNDA; - } - else if (TRCV == MPI_UNSIGNED_SHORT) - { - OCTAVE_LOCAL_BUFFER(octave_uint16,LBNDA,nitem); - info = recv_vec(comm, LBNDA,nitem ,TRCV ,source, tanktag[4]); - if (info !=MPI_SUCCESS) return info; - uint16NDArray myNDA(dv); - for (octave_idx_type i=0; i<nitem; i++) - { - myNDA(i)=LBNDA[i]; - } - ov=myNDA; - } - else if (TRCV == MPI_UNSIGNED) { - OCTAVE_LOCAL_BUFFER(octave_uint32,LBNDA,nitem); - info = recv_vec(comm, LBNDA,nitem ,TRCV ,source, tanktag[4]); - if (info !=MPI_SUCCESS) return info; - uint32NDArray myNDA(dv); - for (octave_idx_type i=0; i<nitem; i++) - { - myNDA(i)=LBNDA[i]; - } - ov = myNDA; - } - else if (TRCV == MPI_UNSIGNED_LONG_LONG) - { - OCTAVE_LOCAL_BUFFER(octave_uint64,LBNDA,nitem); - info = recv_vec(comm, LBNDA,nitem ,TRCV ,source, tanktag[4]); - if (info !=MPI_SUCCESS) return info; - uint64NDArray myNDA(dv); - for (octave_idx_type i=0; i<nitem; i++) - { - myNDA(i)=LBNDA[i]; - } - ov=myNDA; - } -return(info); + // Now reverse the content of int vector into dim vector + for (octave_idx_type i = 0; i < nd; i++) + dv(i) = dimV[i] ; + + if (is_complex) + { + // FIXME : it should be easy to avoid the extra memory allocation and copying +#define __MAKE_CMPLX_TYPE_BRANCH__(TMPI,T1,A1) \ + if (TRCV == TMPI) \ + { \ + OCTAVE_LOCAL_BUFFER(T1,LBNDA1,nitem); \ + info = recv_vec (comm, LBNDA1, nitem, TRCV, \ + source, tanktag[4]); \ + if (info != MPI_SUCCESS) \ + return info; \ + A1 myNDA (dv); \ + OCTAVE_LOCAL_BUFFER(T1,LBNDA2,nitem); \ + info = recv_vec (comm, LBNDA2, nitem, TRCV, \ + source, tanktag[5]); \ + if (info != MPI_SUCCESS) \ + return info; \ + for (octave_idx_type i = 0; i < nitem; i++) \ + myNDA(i) = real (LBNDA1[i]) + imag (LBNDA2[i]); \ + \ + ov=myNDA; \ + } + + __MAKE_CMPLX_TYPE_BRANCH__(MPI_DOUBLE,double,ComplexNDArray) + else __MAKE_CMPLX_TYPE_BRANCH__(MPI_FLOAT,float,FloatComplexNDArray) +#undef __MAKE_CMPLX_TYPE_BRANCH__ + } + else + { + // FIXME : it should be easy to avoid the extra memory allocation and copying +#define __MAKE_TYPE_BRANCH__(TMPI,T1,A1) \ + if (TRCV == TMPI) \ + { \ + A1 myNDA (dv); \ + OCTAVE_LOCAL_BUFFER(T1, LBNDA,nitem); \ + info = recv_vec(comm, LBNDA, nitem, TRCV, \ + source, tanktag[4]); \ + if (info != MPI_SUCCESS) \ + return info; \ + \ + for (octave_idx_type i=0; i<nitem; i++) \ + myNDA(i) = LBNDA[i]; \ + ov=myNDA; \ + } + + __MAKE_TYPE_BRANCH__(MPI_DOUBLE,double,NDArray) + else __MAKE_TYPE_BRANCH__(MPI_INT,bool,boolNDArray) + else __MAKE_TYPE_BRANCH__(MPI_FLOAT,float,FloatNDArray) + else __MAKE_TYPE_BRANCH__(MPI_BYTE,octave_int8,int8NDArray) + else __MAKE_TYPE_BRANCH__(MPI_SHORT,octave_int16,int16NDArray) + else __MAKE_TYPE_BRANCH__(MPI_INT,octave_int32,int32NDArray) + else __MAKE_TYPE_BRANCH__(MPI_LONG_LONG,octave_int64,int64NDArray) + else __MAKE_TYPE_BRANCH__(MPI_UNSIGNED_CHAR,octave_uint8,uint8NDArray) + else __MAKE_TYPE_BRANCH__(MPI_UNSIGNED_SHORT,octave_uint16,uint16NDArray) + else __MAKE_TYPE_BRANCH__(MPI_UNSIGNED,octave_uint32,uint32NDArray) + else __MAKE_TYPE_BRANCH__(MPI_UNSIGNED_LONG_LONG,octave_uint64,uint64NDArray) + +#undef __MAKE_TYPE_BRANCH__ + } + + return info; } -int recv_sp_mat(bool is_complex,MPI_Datatype TRcv, MPI_Comm comm, octave_value &ov,int source, int mytag){ -int info; +int recv_sp_mat (bool is_complex, MPI_Datatype TRcv, MPI_Comm comm, octave_value &ov, int source, int mytag) +{ + int info; -OCTAVE_LOCAL_BUFFER(int, tanktag,6); -tanktag[0] = mytag; -tanktag[1] = mytag+1; -tanktag[2] = mytag+2; -tanktag[3] = mytag+3; -tanktag[4] = mytag+4; -tanktag[5] = mytag+5; + OCTAVE_LOCAL_BUFFER(int, tanktag,6); + tanktag[0] = mytag; + tanktag[1] = mytag+1; + tanktag[2] = mytag+2; + tanktag[3] = mytag+3; + tanktag[4] = mytag+4; + tanktag[5] = mytag+5; -MPI_Status stat; + MPI_Status stat; -OCTAVE_LOCAL_BUFFER(int,s,3); + OCTAVE_LOCAL_BUFFER(int,s,3); + + // Create a contiguous derived datatype + MPI_Datatype sintsparse; + MPI_Type_contiguous (3, MPI_INT, &sintsparse); + MPI_Type_commit (&sintsparse); -// Create a contiguous derived datatype -MPI_Datatype sintsparse; -MPI_Type_contiguous(3,MPI_INT, &sintsparse); -MPI_Type_commit(&sintsparse); + // receive the sintsparse vector named s + info = MPI_Recv (s, 1, sintsparse, source, tanktag[1], comm, &stat); + if (info != MPI_SUCCESS) + return info; + // Create a contiguous derived datatype for row and column index + OCTAVE_LOCAL_BUFFER(int,sridx,s[2]); + MPI_Datatype rowindex; + MPI_Type_contiguous (s[2], MPI_INT, &rowindex); + MPI_Type_commit (&rowindex); + OCTAVE_LOCAL_BUFFER(int,scidx,s[1]+1); + MPI_Datatype columnindex; + MPI_Type_contiguous (s[1] + 1, MPI_INT, &columnindex); + MPI_Type_commit (&columnindex); -// receive the sintsparse vector named s -info = MPI_Recv(s, 1, sintsparse, source, tanktag[1], comm, &stat); -// printf("This is info for sintsparse %i\n",info); -if (info !=MPI_SUCCESS) return info; -// MPI_Datatype datavect1; -// MPI_Type_contiguous(s[2],TRcv, &datavect1); -// MPI_Type_commit(&datavect1); -// printf("This is info for sintsparse %i\n"); -// Create a contiguous derived datatype for row and column index - -OCTAVE_LOCAL_BUFFER(int,sridx,s[2]); -MPI_Datatype rowindex; -MPI_Type_contiguous(s[2],MPI_INT, &rowindex); -MPI_Type_commit(&rowindex); + info = MPI_Recv (sridx, 1, rowindex, source, tanktag[2], comm, &stat); -OCTAVE_LOCAL_BUFFER(int,scidx,s[1]+1); -MPI_Datatype columnindex; -MPI_Type_contiguous(s[1]+1,MPI_INT, &columnindex); -MPI_Type_commit(&columnindex); + if (info != MPI_SUCCESS) + return info; + // receive the vector with column indexes + info = MPI_Recv (scidx, 1, columnindex, source, tanktag[3], comm, &stat); - info = MPI_Recv(sridx,1,rowindex,source,tanktag[2],comm,&stat); -// printf("Hope everything is fine here with ridx %i =\n",info); - if (info !=MPI_SUCCESS) return info; + if (info != MPI_SUCCESS) + return info; -// receive the vector with column indexes - info = MPI_Recv(scidx,1,columnindex,source,tanktag[3],comm, &stat); -// printf("Hope everything is fine here with scidx %i =\n",info); - if (info !=MPI_SUCCESS) return info; + // Now we have a different vector of non zero elements according to datatype +#define __MAKE_TYPE_BRANCH__(TMPI,T1,A1) \ + if (TRcv == TMPI) \ + { \ + A1 m (s[0], s[1], s[2]); \ + OCTAVE_LOCAL_BUFFER(T1,LBNDA,s[2]); \ + info = recv_vec (comm, LBNDA,s[2] ,TRcv ,source, tanktag[4]); \ + if (info != MPI_SUCCESS) \ + return info; \ + for (octave_idx_type i = 0; i < s[1]+1; i++) \ + m.cidx(i) = scidx[i]; \ + for (octave_idx_type i = 0; i < s[2]; i++) \ + { \ + m.ridx(i) = sridx[i]; \ + m.data(i) = LBNDA[i]; \ + } \ + ov = m; \ + } -// Now we have a different vector of non zero elements according to datatype + if (is_complex) + { + if (TRcv == MPI_DOUBLE) + { + TRcv = MPI_DOUBLE; + SparseComplexMatrix m (s[0], s[1], s[2]); + OCTAVE_LOCAL_BUFFER(double,LBNDA1,s[2]); + OCTAVE_LOCAL_BUFFER(double,LBNDA2,s[2]); - if (TRcv == MPI_INT) - { - SparseBoolMatrix m(s[0],s[1],s[2]); - OCTAVE_LOCAL_BUFFER(bool,LBNDA,s[2]); - //Now receive the vector of non zero elements - info = recv_vec(comm, LBNDA,s[2] ,TRcv ,source, tanktag[4]); -// printf("This is info for vector of non zero elements %i\n",info); - if (info !=MPI_SUCCESS) return info; - for (octave_idx_type i = 0; i < s[1]+1; i++) - { - m.cidx(i) = scidx[i]; - } - for (octave_idx_type i = 0; i < s[2]; i++) - { - m.ridx(i) = sridx[i]; -// printf("LBNDA[i]= %f\n",LBNDA[i]); - m.data(i) = LBNDA[i]; - } - ov = m; - } - if (TRcv == MPI_DOUBLE and is_complex==false) - { - SparseMatrix m(s[0],s[1],s[2]); - OCTAVE_LOCAL_BUFFER(double,LBNDA,s[2]); - //Now receive the vector of non zero elements - info = recv_vec(comm, LBNDA,s[2] ,TRcv ,source, tanktag[4]); -// printf("This is info for receiving vector of non zero elements %i\n",info); - if (info !=MPI_SUCCESS) return info; - for (octave_idx_type i = 0; i < s[1]+1; i++) - { - m.cidx(i) = scidx[i]; - } - for (octave_idx_type i = 0; i < s[2]; i++) - { - m.ridx(i) = sridx[i]; -// printf("LBNDA[i]= %f\n",LBNDA[i]); - m.data(i) = LBNDA[i]; - } - ov = m; - } - if (TRcv == MPI_DOUBLE and is_complex==true) - { - TRcv = MPI_DOUBLE; - SparseComplexMatrix m(s[0],s[1],s[2]); - OCTAVE_LOCAL_BUFFER(double,LBNDA1,s[2]); - OCTAVE_LOCAL_BUFFER(double,LBNDA2,s[2]); - info = recv_vec(comm, LBNDA1,s[2] ,TRcv ,source, tanktag[4]); - if (info !=MPI_SUCCESS) return info; - info = recv_vec(comm, LBNDA2,s[2] ,TRcv ,source, tanktag[5]); - if (info !=MPI_SUCCESS) return info; - for (octave_idx_type i = 0; i < s[1]+1; i++) - { - m.cidx(i) = scidx[i]; - } - for (octave_idx_type i = 0; i < s[2]; i++) - { - m.ridx(i) = sridx[i]; - m.data(i) = real(LBNDA1[i])+imag(LBNDA2[i]); - } - ov = m; + info = recv_vec (comm, LBNDA1, s[2], TRcv, source, tanktag[4]); + if (info != MPI_SUCCESS) + return info; - } -return(info); + info = recv_vec (comm, LBNDA2, s[2], TRcv, source, tanktag[5]); + if (info != MPI_SUCCESS) + return info; + + for (octave_idx_type i = 0; i < s[1] + 1; i++) + m.cidx(i) = scidx[i]; + + for (octave_idx_type i = 0; i < s[2]; i++) + { + m.ridx(i) = sridx[i]; + m.data(i) = real(LBNDA1[i])+imag(LBNDA2[i]); + } + + ov = m; + } + } + else + { + __MAKE_TYPE_BRANCH__(MPI_INT,bool,SparseBoolMatrix) + else __MAKE_TYPE_BRANCH__(MPI_DOUBLE,double,SparseMatrix) + } +#undef __MAKE_TYPE_BRANCH__ + return info; } -int recv_cell(MPI_Comm comm,octave_value &ov, int source, int mytag){ -// Not tested yet -OCTAVE_LOCAL_BUFFER(int, tanktag, 5); -tanktag[0] = mytag; -tanktag[1] = mytag+1; -tanktag[2] = mytag+2; -tanktag[3] = mytag+3; -tanktag[4] = mytag+4; +int recv_cell (MPI_Comm comm, octave_value &ov, int source, int mytag) +{ + + OCTAVE_LOCAL_BUFFER(int, tanktag, 5); + tanktag[0] = mytag; + tanktag[1] = mytag+1; + tanktag[2] = mytag+2; + tanktag[3] = mytag+3; + tanktag[4] = mytag+4; + int ... [truncated message content] |
From: <car...@us...> - 2012-08-21 01:12:27
|
Revision: 10893 http://octave.svn.sourceforge.net/octave/?rev=10893&view=rev Author: carandraug Date: 2012-08-21 01:12:21 +0000 (Tue, 21 Aug 2012) Log Message: ----------- egolaydec/egolayenc: use egolaygen and avoid repeating code Modified Paths: -------------- trunk/octave-forge/main/comm/inst/egolaydec.m trunk/octave-forge/main/comm/inst/egolayenc.m Modified: trunk/octave-forge/main/comm/inst/egolaydec.m =================================================================== --- trunk/octave-forge/main/comm/inst/egolaydec.m 2012-08-21 00:59:49 UTC (rev 10892) +++ trunk/octave-forge/main/comm/inst/egolaydec.m 2012-08-21 01:12:21 UTC (rev 10893) @@ -56,25 +56,10 @@ error ("extended golay code is (24,12), use rx codeword of 24 bit column size"); endif - I = eye (12); - %P is 12x12 matrix - P = [1 0 0 0 1 1 1 0 1 1 0 1; - 0 0 0 1 1 1 0 1 1 0 1 1; - 0 0 1 1 1 0 1 1 0 1 0 1; - 0 1 1 1 0 1 1 0 1 0 0 1; - 1 1 1 0 1 1 0 1 0 0 0 1; - 1 1 0 1 1 0 1 0 0 0 1 1; - 1 0 1 1 0 1 0 0 0 1 1 1; - 0 1 1 0 1 0 0 0 1 1 1 1; - 1 1 0 1 0 0 0 1 1 1 0 1; - 1 0 1 0 0 0 1 1 1 0 1 1; - 0 1 0 0 0 1 1 1 0 1 1 1; - 1 1 1 1 1 1 1 1 1 1 1 0;]; - - H = [I; P]; %partiy check matrix transpose. - dec_error = []; - C = zeros (size (R)); + [~, P] = egolaygen (); + H = [eye(12); P]; # parity check matrix transpose + C = zeros (size (R)); for rspn = 1:rows (R) RR = R(rspn,:); Modified: trunk/octave-forge/main/comm/inst/egolayenc.m =================================================================== --- trunk/octave-forge/main/comm/inst/egolayenc.m 2012-08-21 00:59:49 UTC (rev 10892) +++ trunk/octave-forge/main/comm/inst/egolayenc.m 2012-08-21 01:12:21 UTC (rev 10893) @@ -43,20 +43,7 @@ error("extended golay code is (24,12), use message of column size 12"); endif - I = eye (12); - P = [1 0 0 0 1 1 1 0 1 1 0 1; - 0 0 0 1 1 1 0 1 1 0 1 1; - 0 0 1 1 1 0 1 1 0 1 0 1; - 0 1 1 1 0 1 1 0 1 0 0 1; - 1 1 1 0 1 1 0 1 0 0 0 1; - 1 1 0 1 1 0 1 0 0 0 1 1; - 1 0 1 1 0 1 0 0 0 1 1 1; - 0 1 1 0 1 0 0 0 1 1 1 1; - 1 1 0 1 0 0 0 1 1 1 0 1; - 1 0 1 0 0 0 1 1 1 0 1 1; - 0 1 0 0 0 1 1 1 0 1 1 1; - 1 1 1 1 1 1 1 1 1 1 1 0;]; - G = [P I]; %generator. + G = egolaygen (); # generator C = mod (M * repmat (G, [1, rows(M)]), 2); C = C(:, 1:24); This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <car...@us...> - 2012-08-21 00:59:55
|
Revision: 10892 http://octave.svn.sourceforge.net/octave/?rev=10892&view=rev Author: carandraug Date: 2012-08-21 00:59:49 +0000 (Tue, 21 Aug 2012) Log Message: ----------- egolayenc/egolaydec/egolaygen: follow some Octave coding standards Modified Paths: -------------- trunk/octave-forge/main/comm/inst/egolaydec.m trunk/octave-forge/main/comm/inst/egolayenc.m trunk/octave-forge/main/comm/inst/egolaygen.m Modified: trunk/octave-forge/main/comm/inst/egolaydec.m =================================================================== --- trunk/octave-forge/main/comm/inst/egolaydec.m 2012-08-21 00:32:36 UTC (rev 10891) +++ trunk/octave-forge/main/comm/inst/egolaydec.m 2012-08-21 00:59:49 UTC (rev 10892) @@ -14,23 +14,24 @@ ## this program; if not, see <http://www.gnu.org/licenses/>. ## -*- texinfo -*- -## @deftypefn {Function File} {} egolaydec (@var{R}) +## @deftypefn {Function File} {[@var{C}, @var{err}] =} egolaydec (@var{R}) +## Decode Extended Golay code. ## ## Given @var{R}, the received Extended Golay code, this function tries to -## decode @var{R} using the Extended Golay code parity check matrix. -## Extended Golay code (24,12) which can correct upto 3 errors. +## decode it using the Extended Golay code parity check matrix. +## Extended Golay code (24,12) which can correct up to 3 errors. ## ## The received code @var{R}, needs to be of length Nx24, for encoding. We can -## decode several codes at once, if they are stacked as a matrix of 24columns, +## decode several codes at once, if they are stacked as a matrix of 24 columns, ## each code in a separate row. ## -## The generator G used in here is same as obtained from the -## function egolaygen. +## The generator used in here is same as obtained from the function +## @code{egolaygen}. ## -## The function returns the error-corrected code word from the received -## word. If decoding failed, the second return value is 1, otherwise it is 0. +## The function returns @var{C}, the error-corrected code word from the received +## word. If decoding failed, @var{err} value is 1, otherwise it is 0. ## -## Extended Golay code (24,12) which can correct upto 3 +## Extended Golay code (24,12) which can correct up to 3 ## errors. Decoding algorithm follows from Lin & Costello. ## ## Ref: Lin & Costello, pg 128, Ch4, 'Error Control Coding', 2nd ed, Pearson. @@ -44,80 +45,82 @@ ## @end group ## @end example ## +## @seealso{egolaygen,egolayenc} ## @end deftypefn -## @seealso{egolaygen,egolayenc} -function [C,dec_error]=egolaydec(R) +function [C, dec_error] = egolaydec (R) - if ( nargin < 1 ) - error('usage: C=egolaydec(R)'); - elseif ( columns(R) ~= 24 ) - error('extended golay code is (24,12), use rx codeword of 24 bit column size'); - end + if (nargin != 1) + print_usage; + elseif (columns (R) != 24) + error ("extended golay code is (24,12), use rx codeword of 24 bit column size"); + endif - I=eye(12); + I = eye (12); %P is 12x12 matrix - P=[1 0 0 0 1 1 1 0 1 1 0 1; - 0 0 0 1 1 1 0 1 1 0 1 1; - 0 0 1 1 1 0 1 1 0 1 0 1; - 0 1 1 1 0 1 1 0 1 0 0 1; - 1 1 1 0 1 1 0 1 0 0 0 1; - 1 1 0 1 1 0 1 0 0 0 1 1; - 1 0 1 1 0 1 0 0 0 1 1 1; - 0 1 1 0 1 0 0 0 1 1 1 1; - 1 1 0 1 0 0 0 1 1 1 0 1; - 1 0 1 0 0 0 1 1 1 0 1 1; - 0 1 0 0 0 1 1 1 0 1 1 1; - 1 1 1 1 1 1 1 1 1 1 1 0;]; + P = [1 0 0 0 1 1 1 0 1 1 0 1; + 0 0 0 1 1 1 0 1 1 0 1 1; + 0 0 1 1 1 0 1 1 0 1 0 1; + 0 1 1 1 0 1 1 0 1 0 0 1; + 1 1 1 0 1 1 0 1 0 0 0 1; + 1 1 0 1 1 0 1 0 0 0 1 1; + 1 0 1 1 0 1 0 0 0 1 1 1; + 0 1 1 0 1 0 0 0 1 1 1 1; + 1 1 0 1 0 0 0 1 1 1 0 1; + 1 0 1 0 0 0 1 1 1 0 1 1; + 0 1 0 0 0 1 1 1 0 1 1 1; + 1 1 1 1 1 1 1 1 1 1 1 0;]; - H=[I; P]; %partiy check matrix transpose. + H = [I; P]; %partiy check matrix transpose. - dec_error=[]; - C=zeros(size(R)); + dec_error = []; + C = zeros (size (R)); - for rspn=1:rows(R) - RR=R(rspn,:); - S=mod(RR*H,2); - wt=sum(S); - done=0; - E=[S, zeros(1,12)]; + for rspn = 1:rows (R) + RR = R(rspn,:); + S = mod (RR*H, 2); + wt = sum (S); + done = 0; + E = [S, zeros(1, 12)]; if (wt <= 3) - E=[S, zeros(1,12)]; - done=1; + E = [S, zeros(1, 12)]; + done = 1; else - SP = mod(repmat(S,[12, 1])+P,2); - idx = find( sum(SP,2) <= 2 ); - if ( idx ) - idx=idx(1); %pick first of matches. - Ui=zeros(1,12); Ui(idx)=1; - E=[SP(idx,:),Ui]; - done=1; - end - end + SP = mod (repmat (S, [12, 1]) + P, 2); + idx = find (sum (SP, 2) <= 2); + if (idx) + idx = idx(1); %pick first of matches. + Ui = zeros (1, 12); + Ui(idx) = 1; + E = [SP(idx, :), Ui]; + done = 1; + endif + endif - if ( ~done ) - X=mod(S*P,2); - wt=sum(X); + if (!done) + X = mod (S*P, 2); + wt = sum (X); if (wt==2 || wt==3) - E=[zeros(1,12), X]; - done=1; + E = [zeros(1, 12), X]; + done = 1; else - SP = mod(repmat(X,[12, 1])+P,2); - idx = find( sum(SP,2) == 2 ); - if ( idx ) - idx=idx(1); - Ui=zeros(1,12); Ui(idx)=1; - E=[Ui,SP(idx,:)]; - done=1; - end - end - end + SP = mod (repmat(X, [12, 1]) + P, 2); + idx = find (sum(SP, 2) == 2); + if (idx) + idx = idx(1); + Ui = zeros (1, 12); + Ui(idx) = 1; + E = [Ui, SP(idx, :)]; + done = 1; + endif + endif + endif - dec_error=[dec_error; 1-done]; - C(rspn,:)=mod(E+RR,2); - end + dec_error = [dec_error; 1-done]; + C(rspn, :) = mod (E+RR, 2); + endfor - return; -end +endfunction + %!assert(egolaydec([1 1 1 zeros(1,21)]),zeros(1,24)) %!assert(egolaydec([1 0 1 zeros(1,20) 1]),zeros(1,24)) Modified: trunk/octave-forge/main/comm/inst/egolayenc.m =================================================================== --- trunk/octave-forge/main/comm/inst/egolayenc.m 2012-08-21 00:32:36 UTC (rev 10891) +++ trunk/octave-forge/main/comm/inst/egolayenc.m 2012-08-21 00:59:49 UTC (rev 10892) @@ -14,57 +14,51 @@ ## this program; if not, see <http://www.gnu.org/licenses/>. ## -*- texinfo -*- -## @deftypefn {Function File} {} egolayenc (@var{M}) +## @deftypefn {Function File} {@var{C} =} egolayenc (@var{M}) +## Encode with Extended Golay code. ## -## -## Given @var{M}, encode M using the Extended Golay code. -## ## The message @var{M}, needs to be of size Nx12, for encoding. ## We can encode several messages, into codes at once, if they ## are stacked in the order suggested. ## -## The generator G used in here is same as obtained from the -## function egolaygen. Extended Golay code (24,12) which can correct +## The generator used in here is same as obtained from the +## function @code{egolaygen}. Extended Golay code (24,12) which can correct ## upto 3 errors. ## ## @example ## @group ## M=(rand(10,12)>0.5); ## C=egolayenc(M) -## ## @end group ## @end example ## -## @end deftypefn ## @seealso{egolaygen,egolaydec} +## @end deftypefn -function C=egolayenc(M) - if ( nargin < 1 ) - error('usage: C=egolayenc(M)'); - elseif ( columns(M) ~= 12 ) - error('extended golay code is (24,12), use message of column size 12'); - end +function C = egolayenc (M) - I=eye(12); - P=[1 0 0 0 1 1 1 0 1 1 0 1; - 0 0 0 1 1 1 0 1 1 0 1 1; - 0 0 1 1 1 0 1 1 0 1 0 1; - 0 1 1 1 0 1 1 0 1 0 0 1; - 1 1 1 0 1 1 0 1 0 0 0 1; - 1 1 0 1 1 0 1 0 0 0 1 1; - 1 0 1 1 0 1 0 0 0 1 1 1; - 0 1 1 0 1 0 0 0 1 1 1 1; - 1 1 0 1 0 0 0 1 1 1 0 1; - 1 0 1 0 0 0 1 1 1 0 1 1; - 0 1 0 0 0 1 1 1 0 1 1 1; - 1 1 1 1 1 1 1 1 1 1 1 0;]; - G=[P I]; %generator. + if (nargin < 1) + print_usage; + elseif (columns (M) != 12) + error("extended golay code is (24,12), use message of column size 12"); + endif - ##for rowi=1:rows(M) - ## C(rowi,:)=mod(M(rowi,:)*G,2); %code. - ##end + I = eye (12); + P = [1 0 0 0 1 1 1 0 1 1 0 1; + 0 0 0 1 1 1 0 1 1 0 1 1; + 0 0 1 1 1 0 1 1 0 1 0 1; + 0 1 1 1 0 1 1 0 1 0 0 1; + 1 1 1 0 1 1 0 1 0 0 0 1; + 1 1 0 1 1 0 1 0 0 0 1 1; + 1 0 1 1 0 1 0 0 0 1 1 1; + 0 1 1 0 1 0 0 0 1 1 1 1; + 1 1 0 1 0 0 0 1 1 1 0 1; + 1 0 1 0 0 0 1 1 1 0 1 1; + 0 1 0 0 0 1 1 1 0 1 1 1; + 1 1 1 1 1 1 1 1 1 1 1 0;]; + G = [P I]; %generator. - C=mod(M*repmat(G,[1,rows(M)]),2); - C=C(:,1:24); + C = mod (M * repmat (G, [1, rows(M)]), 2); + C = C(:, 1:24); -end +endfunction Modified: trunk/octave-forge/main/comm/inst/egolaygen.m =================================================================== --- trunk/octave-forge/main/comm/inst/egolaygen.m 2012-08-21 00:32:36 UTC (rev 10891) +++ trunk/octave-forge/main/comm/inst/egolaygen.m 2012-08-21 00:59:49 UTC (rev 10892) @@ -14,28 +14,34 @@ ## this program; if not, see <http://www.gnu.org/licenses/>. ## -*- texinfo -*- -## @deftypefn {Function File} {} egolaygen () +## @deftypefn {Function File} {[@var{G}, @var{P}]} = egolaygen () +## Extended Golay code generator matrix. ## -## Returns the Extended Golay code (24,12) generator matrix, -## which can correct upto 3 errors. The second argument is the partiy +## Returns @var{G}, the Extended Golay code (24,12) generator matrix, +## which can correct up to 3 errors. @var{P} is the partiy ## check matrix, for this code. ## +## @seealso{egolaydec,egolayenc} ## @end deftypefn -## @seealso{egolaydec,egolayenc} -function [G,P]=egolaygen() - I=eye(12); - P=[1 0 0 0 1 1 1 0 1 1 0 1; - 0 0 0 1 1 1 0 1 1 0 1 1; - 0 0 1 1 1 0 1 1 0 1 0 1; - 0 1 1 1 0 1 1 0 1 0 0 1; - 1 1 1 0 1 1 0 1 0 0 0 1; - 1 1 0 1 1 0 1 0 0 0 1 1; - 1 0 1 1 0 1 0 0 0 1 1 1; - 0 1 1 0 1 0 0 0 1 1 1 1; - 1 1 0 1 0 0 0 1 1 1 0 1; - 1 0 1 0 0 0 1 1 1 0 1 1; - 0 1 0 0 0 1 1 1 0 1 1 1; - 1 1 1 1 1 1 1 1 1 1 1 0;]; - G=[P I]; %generator. -end +function [G, P] = egolaygen () + + if (nargin != 0) + print_usage; + endif + + I = eye (12); + P = [1 0 0 0 1 1 1 0 1 1 0 1; + 0 0 0 1 1 1 0 1 1 0 1 1; + 0 0 1 1 1 0 1 1 0 1 0 1; + 0 1 1 1 0 1 1 0 1 0 0 1; + 1 1 1 0 1 1 0 1 0 0 0 1; + 1 1 0 1 1 0 1 0 0 0 1 1; + 1 0 1 1 0 1 0 0 0 1 1 1; + 0 1 1 0 1 0 0 0 1 1 1 1; + 1 1 0 1 0 0 0 1 1 1 0 1; + 1 0 1 0 0 0 1 1 1 0 1 1; + 0 1 0 0 0 1 1 1 0 1 1 1; + 1 1 1 1 1 1 1 1 1 1 1 0;]; + G = [P I]; %generator. +endfunction This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <car...@us...> - 2012-08-21 00:32:42
|
Revision: 10891 http://octave.svn.sourceforge.net/octave/?rev=10891&view=rev Author: carandraug Date: 2012-08-21 00:32:36 +0000 (Tue, 21 Aug 2012) Log Message: ----------- egolaydec: bug fix where the error flag was not given for more than 3 erroneous bits Modified Paths: -------------- trunk/octave-forge/main/comm/NEWS trunk/octave-forge/main/comm/inst/egolaydec.m Modified: trunk/octave-forge/main/comm/NEWS =================================================================== --- trunk/octave-forge/main/comm/NEWS 2012-08-20 17:15:30 UTC (rev 10890) +++ trunk/octave-forge/main/comm/NEWS 2012-08-21 00:32:36 UTC (rev 10891) @@ -5,6 +5,10 @@ istrellis poly2trellis + ** Fixed bug in `egolaydec' which gave an error when there were more + than the three allowed erroneous bits, rather than setting the + error flag. + Summary of important user-visible changes for communications 1.1.1: ------------------------------------------------------------------- Modified: trunk/octave-forge/main/comm/inst/egolaydec.m =================================================================== --- trunk/octave-forge/main/comm/inst/egolaydec.m 2012-08-20 17:15:30 UTC (rev 10890) +++ trunk/octave-forge/main/comm/inst/egolaydec.m 2012-08-21 00:32:36 UTC (rev 10891) @@ -14,7 +14,7 @@ ## this program; if not, see <http://www.gnu.org/licenses/>. ## -*- texinfo -*- -## @deftypefn {Function File} {} egolaydec (@var{R}) +## @deftypefn {Function File} {} egolaydec (@var{R}) ## ## Given @var{R}, the received Extended Golay code, this function tries to ## decode @var{R} using the Extended Golay code parity check matrix. @@ -37,7 +37,7 @@ ## ## @example ## @group -## M=[rand(10,12)>0.5]; +## M=[rand(10,12)>0.5]; ## C1=egolayenc(M); ## C1(:,1)=mod(C1(:,1)+1,2) ## C2=egolaydec(C1) @@ -80,12 +80,13 @@ S=mod(RR*H,2); wt=sum(S); done=0; + E=[S, zeros(1,12)]; if (wt <= 3) E=[S, zeros(1,12)]; done=1; else SP = mod(repmat(S,[12, 1])+P,2); - idx = find( sum(SP,2) <= 2 ); + idx = find( sum(SP,2) <= 2 ); if ( idx ) idx=idx(1); %pick first of matches. Ui=zeros(1,12); Ui(idx)=1; @@ -118,9 +119,5 @@ return; end -%! %!assert(egolaydec([1 1 1 zeros(1,21)]),zeros(1,24)) %!assert(egolaydec([1 0 1 zeros(1,20) 1]),zeros(1,24)) -%! - - This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <jo...@us...> - 2012-08-20 17:15:36
|
Revision: 10890 http://octave.svn.sourceforge.net/octave/?rev=10890&view=rev Author: jordigh Date: 2012-08-20 17:15:30 +0000 (Mon, 20 Aug 2012) Log Message: ----------- firls.m: fix docstring Modified Paths: -------------- trunk/octave-forge/main/signal/inst/firls.m Modified: trunk/octave-forge/main/signal/inst/firls.m =================================================================== --- trunk/octave-forge/main/signal/inst/firls.m 2012-08-20 17:10:59 UTC (rev 10889) +++ trunk/octave-forge/main/signal/inst/firls.m 2012-08-20 17:15:30 UTC (rev 10890) @@ -13,12 +13,12 @@ ## You should have received a copy of the GNU General Public License along with ## this program; if not, see <http://www.gnu.org/licenses/>. -## b = firls(N, F, A); b = firls(N, F, A, W); +## b = firls(N, F, A); +## b = firls(N, F, A, W); ## ## FIR filter design using least squares method. Returns a length N+1 ## linear phase filter such that the integral of the weighted mean -## squared error in the specified bands is minimized. N must be an even -## integer or +## squared error in the specified bands is minimized. ## ## F specifies the frequencies of the band edges, normalized so that ## half the sample frequency is equal to 1. Each band is specified by @@ -29,7 +29,7 @@ ## W is an optional weighting function that contains one value for each ## band that weights the mean squared error in that band. A must be the ## same length as F, and W must be half the length of F. N must be -## even. If you specify an odd value, firls increments it by 1. +## even. If given an odd value, firls increments it by 1. ## ## The least squares optimization algorithm for computing FIR filter ## coefficients is derived in detail in: This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <jo...@us...> - 2012-08-20 17:11:06
|
Revision: 10889 http://octave.svn.sourceforge.net/octave/?rev=10889&view=rev Author: jordigh Date: 2012-08-20 17:10:59 +0000 (Mon, 20 Aug 2012) Log Message: ----------- firls.m: ensure N is even Modified Paths: -------------- trunk/octave-forge/main/signal/inst/firls.m Modified: trunk/octave-forge/main/signal/inst/firls.m =================================================================== --- trunk/octave-forge/main/signal/inst/firls.m 2012-08-20 17:05:50 UTC (rev 10888) +++ trunk/octave-forge/main/signal/inst/firls.m 2012-08-20 17:10:59 UTC (rev 10889) @@ -13,12 +13,12 @@ ## You should have received a copy of the GNU General Public License along with ## this program; if not, see <http://www.gnu.org/licenses/>. -## b = firls(N, F, A); -## b = firls(N, F, A, W); +## b = firls(N, F, A); b = firls(N, F, A, W); ## ## FIR filter design using least squares method. Returns a length N+1 ## linear phase filter such that the integral of the weighted mean -## squared error in the specified bands is minimized. +## squared error in the specified bands is minimized. N must be an even +## integer or ## ## F specifies the frequencies of the band edges, normalized so that ## half the sample frequency is equal to 1. Each band is specified by @@ -28,7 +28,8 @@ ## ## W is an optional weighting function that contains one value for each ## band that weights the mean squared error in that band. A must be the -## same length as F, and W must be half the length of F. +## same length as F, and W must be half the length of F. N must be +## even. If you specify an odd value, firls increments it by 1. ## ## The least squares optimization algorithm for computing FIR filter ## coefficients is derived in detail in: @@ -59,6 +60,8 @@ error("This feature is implemented yet"); else + N += mod (N, 2); + M = N/2; w = kron (weight(:), [-1; 1]); omega = frequencies * pi; This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <jo...@us...> - 2012-08-20 17:05:57
|
Revision: 10888 http://octave.svn.sourceforge.net/octave/?rev=10888&view=rev Author: jordigh Date: 2012-08-20 17:05:50 +0000 (Mon, 20 Aug 2012) Log Message: ----------- Style fixes in firls.m Modified Paths: -------------- trunk/octave-forge/main/signal/inst/firls.m Modified: trunk/octave-forge/main/signal/inst/firls.m =================================================================== --- trunk/octave-forge/main/signal/inst/firls.m 2012-08-19 22:32:59 UTC (rev 10887) +++ trunk/octave-forge/main/signal/inst/firls.m 2012-08-20 17:05:50 UTC (rev 10888) @@ -38,32 +38,32 @@ function coef = firls(N, frequencies, pass, weight, str); - if nargin<3 || nargin>6 + if (nargin < 3 || nargin > 6) print_usage; - elseif nargin==3 - weight = ones(1, length(pass)/2); + elseif (nargin == 3) + weight = ones (1, length(pass)/2); str = []; - elseif nargin==4 - if ischar(weight) + elseif (nargin == 4) + if ischar (weight) str = weight; weight = ones (size (pass)); else str = []; - end - end + endif + endif if length (frequencies) ~= length (pass) error("F and A must have equal lengths."); elseif 2 * length (weight) ~= length (pass) error("W must contain one weight per band."); - elseif ischar(str) + elseif ischar (str) error("This feature is implemented yet"); else M = N/2; - w = kron(weight(:), [-1; 1]); + w = kron (weight(:), [-1; 1]); omega = frequencies * pi; - i1 = 1:2:length(omega); - i2 = 2:2:length(omega); + i1 = 1:2:length (omega); + i2 = 2:2:length (omega); ## Generate the matrix Q ## As illustrated in the above-cited reference, the matrix can be @@ -94,8 +94,8 @@ ## - n ## cos_ints2 = [omega(i1).^2 - omega(i2).^2; ... - cos((1:M)' * omega(i2)) - cos((1:M)' * omega(i1))] ./ ... - ([2, 1:M]' * (omega(i2) - omega(i1))); + cos((1:M)' * omega(i2)) - cos((1:M)' * omega(i1))] ./ ... + ([2, 1:M]' * (omega(i2) - omega(i1))); d = [-weight .* pass(i1); weight .* pass(i2)] (:); b = [1, 1./(1:M)]' .* ((kron (cos_ints2, [1, 1]) + cos_ints(1:M+1,:)) * d); @@ -104,6 +104,6 @@ a = Q \ b; coef = [ a(end:-1:2); 2 * a(1); a(2:end) ]; - end + endif endfunction This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <ean...@us...> - 2012-08-19 22:33:06
|
Revision: 10887 http://octave.svn.sourceforge.net/octave/?rev=10887&view=rev Author: eandrius Date: 2012-08-19 22:32:59 +0000 (Sun, 19 Aug 2012) Log Message: ----------- i2c: initial commit \nserial: small changes to error reporting Modified Paths: -------------- trunk/octave-forge/main/serial/DESCRIPTION trunk/octave-forge/main/serial/src/serial.h trunk/octave-forge/main/serial/src/srl_baudrate.cc trunk/octave-forge/main/serial/src/srl_read.cc trunk/octave-forge/main/serial/src/srl_write.cc Added Paths: ----------- trunk/octave-forge/main/i2c/ trunk/octave-forge/main/i2c/COPYING trunk/octave-forge/main/i2c/DESCRIPTION trunk/octave-forge/main/i2c/INDEX trunk/octave-forge/main/i2c/NEWS trunk/octave-forge/main/i2c/src/ trunk/octave-forge/main/i2c/src/Makefile trunk/octave-forge/main/i2c/src/i2c.cc trunk/octave-forge/main/i2c/src/i2c.h trunk/octave-forge/main/i2c/src/i2c_addr.cc trunk/octave-forge/main/i2c/src/i2c_close.cc trunk/octave-forge/main/i2c/src/i2c_read.cc trunk/octave-forge/main/i2c/src/i2c_write.cc Added: trunk/octave-forge/main/i2c/COPYING =================================================================== --- trunk/octave-forge/main/i2c/COPYING (rev 0) +++ trunk/octave-forge/main/i2c/COPYING 2012-08-19 22:32:59 UTC (rev 10887) @@ -0,0 +1,165 @@ + GNU LESSER GENERAL PUBLIC LICENSE + Version 3, 29 June 2007 + + Copyright (C) 2007 Free Software Foundation, Inc. <http://fsf.org/> + Everyone is permitted to copy and distribute verbatim copies + of this license document, but changing it is not allowed. + + + This version of the GNU Lesser General Public License incorporates +the terms and conditions of version 3 of the GNU General Public +License, supplemented by the additional permissions listed below. + + 0. Additional Definitions. + + As used herein, "this License" refers to version 3 of the GNU Lesser +General Public License, and the "GNU GPL" refers to version 3 of the GNU +General Public License. + + "The Library" refers to a covered work governed by this License, +other than an Application or a Combined Work as defined below. + + An "Application" is any work that makes use of an interface provided +by the Library, but which is not otherwise based on the Library. +Defining a subclass of a class defined by the Library is deemed a mode +of using an interface provided by the Library. + + A "Combined Work" is a work produced by combining or linking an +Application with the Library. The particular version of the Library +with which the Combined Work was made is also called the "Linked +Version". + + The "Minimal Corresponding Source" for a Combined Work means the +Corresponding Source for the Combined Work, excluding any source code +for portions of the Combined Work that, considered in isolation, are +based on the Application, and not on the Linked Version. + + The "Corresponding Application Code" for a Combined Work means the +object code and/or source code for the Application, including any data +and utility programs needed for reproducing the Combined Work from the +Application, but excluding the System Libraries of the Combined Work. + + 1. Exception to Section 3 of the GNU GPL. + + You may convey a covered work under sections 3 and 4 of this License +without being bound by section 3 of the GNU GPL. + + 2. Conveying Modified Versions. + + If you modify a copy of the Library, and, in your modifications, a +facility refers to a function or data to be supplied by an Application +that uses the facility (other than as an argument passed when the +facility is invoked), then you may convey a copy of the modified +version: + + a) under this License, provided that you make a good faith effort to + ensure that, in the event an Application does not supply the + function or data, the facility still operates, and performs + whatever part of its purpose remains meaningful, or + + b) under the GNU GPL, with none of the additional permissions of + this License applicable to that copy. + + 3. Object Code Incorporating Material from Library Header Files. + + The object code form of an Application may incorporate material from +a header file that is part of the Library. You may convey such object +code under terms of your choice, provided that, if the incorporated +material is not limited to numerical parameters, data structure +layouts and accessors, or small macros, inline functions and templates +(ten or fewer lines in length), you do both of the following: + + a) Give prominent notice with each copy of the object code that the + Library is used in it and that the Library and its use are + covered by this License. + + b) Accompany the object code with a copy of the GNU GPL and this license + document. + + 4. Combined Works. + + You may convey a Combined Work under terms of your choice that, +taken together, effectively do not restrict modification of the +portions of the Library contained in the Combined Work and reverse +engineering for debugging such modifications, if you also do each of +the following: + + a) Give prominent notice with each copy of the Combined Work that + the Library is used in it and that the Library and its use are + covered by this License. + + b) Accompany the Combined Work with a copy of the GNU GPL and this license + document. + + c) For a Combined Work that displays copyright notices during + execution, include the copyright notice for the Library among + these notices, as well as a reference directing the user to the + copies of the GNU GPL and this license document. + + d) Do one of the following: + + 0) Convey the Minimal Corresponding Source under the terms of this + License, and the Corresponding Application Code in a form + suitable for, and under terms that permit, the user to + recombine or relink the Application with a modified version of + the Linked Version to produce a modified Combined Work, in the + manner specified by section 6 of the GNU GPL for conveying + Corresponding Source. + + 1) Use a suitable shared library mechanism for linking with the + Library. A suitable mechanism is one that (a) uses at run time + a copy of the Library already present on the user's computer + system, and (b) will operate properly with a modified version + of the Library that is interface-compatible with the Linked + Version. + + e) Provide Installation Information, but only if you would otherwise + be required to provide such information under section 6 of the + GNU GPL, and only to the extent that such information is + necessary to install and execute a modified version of the + Combined Work produced by recombining or relinking the + Application with a modified version of the Linked Version. (If + you use option 4d0, the Installation Information must accompany + the Minimal Corresponding Source and Corresponding Application + Code. If you use option 4d1, you must provide the Installation + Information in the manner specified by section 6 of the GNU GPL + for conveying Corresponding Source.) + + 5. Combined Libraries. + + You may place library facilities that are a work based on the +Library side by side in a single library together with other library +facilities that are not Applications and are not covered by this +License, and convey such a combined library under terms of your +choice, if you do both of the following: + + a) Accompany the combined library with a copy of the same work based + on the Library, uncombined with any other library facilities, + conveyed under the terms of this License. + + b) Give prominent notice with the combined library that part of it + is a work based on the Library, and explaining where to find the + accompanying uncombined form of the same work. + + 6. Revised Versions of the GNU Lesser General Public License. + + The Free Software Foundation may publish revised and/or new versions +of the GNU Lesser General Public License from time to time. Such new +versions will be similar in spirit to the present version, but may +differ in detail to address new problems or concerns. + + Each version is given a distinguishing version number. If the +Library as you received it specifies that a certain numbered version +of the GNU Lesser General Public License "or any later version" +applies to it, you have the option of following the terms and +conditions either of that published version or of any later version +published by the Free Software Foundation. If the Library as you +received it does not specify a version number of the GNU Lesser +General Public License, you may choose any version of the GNU Lesser +General Public License ever published by the Free Software Foundation. + + If the Library as you received it specifies that a proxy can decide +whether future versions of the GNU Lesser General Public License shall +apply, that proxy's public statement of acceptance of any version is +permanent authorization for you to choose that version for the +Library. Added: trunk/octave-forge/main/i2c/DESCRIPTION =================================================================== --- trunk/octave-forge/main/i2c/DESCRIPTION (rev 0) +++ trunk/octave-forge/main/i2c/DESCRIPTION 2012-08-19 22:32:59 UTC (rev 10887) @@ -0,0 +1,11 @@ +Name: i2c +Version: 0.1.0 +Date: 2012-08-19 +Author: Andrius Sutas <and...@gm...> +Maintainer: Andrius Sutas <and...@gm...> +Title: i2c +Description: i2c functions for communicating from within octave. +Categories: i2c +Depends: octave (>= 3.4.0) +Autoload: no +License: LGPLv3+ Added: trunk/octave-forge/main/i2c/INDEX =================================================================== --- trunk/octave-forge/main/i2c/INDEX (rev 0) +++ trunk/octave-forge/main/i2c/INDEX 2012-08-19 22:32:59 UTC (rev 10887) @@ -0,0 +1,8 @@ +i2c >> i2c +i2c + i2c + i2c_addr + i2c_read + i2c_write + i2c_close + Added: trunk/octave-forge/main/i2c/NEWS =================================================================== --- trunk/octave-forge/main/i2c/NEWS (rev 0) +++ trunk/octave-forge/main/i2c/NEWS 2012-08-19 22:32:59 UTC (rev 10887) @@ -0,0 +1,12 @@ +Summary of important user-visible changes for i2c 0.1.0: +------------------------------------------------------------------- + + ** Initial release + + ** The following functions are new: + i2c + i2c_addr + i2c_read + i2c_write + i2c_close + Added: trunk/octave-forge/main/i2c/src/Makefile =================================================================== --- trunk/octave-forge/main/i2c/src/Makefile (rev 0) +++ trunk/octave-forge/main/i2c/src/Makefile 2012-08-19 22:32:59 UTC (rev 10887) @@ -0,0 +1,19 @@ +OCT = i2c.oct +OBJ := i2c.o i2c_close.o i2c_addr.o i2c_write.o i2c_read.o + + +MKOCTFILE ?= mkoctfile + +all: $(OCT) + +%.oct: $(OBJ) + $(MKOCTFILE) $^ + +%.o: %.cc + $(MKOCTFILE) -c -s $< + +clean: + rm -f *.oct *.o + + +.PHONY: all clean Added: trunk/octave-forge/main/i2c/src/i2c.cc =================================================================== --- trunk/octave-forge/main/i2c/src/i2c.cc (rev 0) +++ trunk/octave-forge/main/i2c/src/i2c.cc 2012-08-19 22:32:59 UTC (rev 10887) @@ -0,0 +1,109 @@ +// Copyright (C) 2012 Andrius Sutas <and...@gm...> +// +// This program 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. +// +// This program 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 this program; if not, see <http://www.gnu.org/licenses/>. + +#include <octave/oct.h> +#include <octave/ov-int32.h> +//#include <octave/ops.h> +//#include <octave/ov-typeinfo.h> + +#include <iostream> +#include <string> +#include <algorithm> + +#ifndef __WIN32__ +#include <errno.h> +#include <string.h> +#include <stdio.h> +#include <stdlib.h> +#include <unistd.h> +#include <linux/i2c-dev.h> +#include <sys/ioctl.h> +#include <sys/types.h> +#include <sys/stat.h> +#include <fcntl.h> +#endif + +using std::string; + +#include "i2c.h" + +DEFINE_OCTAVE_ALLOCATOR (octave_i2c); +DEFINE_OV_TYPEID_FUNCTIONS_AND_DATA (octave_i2c, "octave_i2c", "octave_i2c"); + +static bool type_loaded = false; + +octave_i2c::octave_i2c() +{ + this->fd = -1; +} + +octave_i2c::octave_i2c(string path, int flags) +{ + this->fd = open(path.c_str(), flags, 0); +} + +octave_i2c::~octave_i2c() +{ + this->i2c_close(); +} + +int octave_i2c::i2c_get_fd() +{ + return this->fd; +} + +void octave_i2c::print (std::ostream& os, bool pr_as_read_syntax ) const +{ + print_raw(os, pr_as_read_syntax); + newline(os); +} + +void octave_i2c::print_raw (std::ostream& os, bool pr_as_read_syntax) const +{ + os << this->fd; +} + +// PKG_ADD: autoload ("i2c", "i2c.oct"); +DEFUN_DLD (i2c, args, nargout, "i2c() function has one mandatory output argument") +{ +#ifdef __WIN32__ + error("i2c: Windows platform support is not yet implemented, go away..."); + return octave_value(); +#endif + + int nargin = args.length(); + + // Default values + int oflags = O_RDWR; + string path("/dev/i2c-0"); + + // Do not open interface if return value is not assigned + if (nargout != 1) + { + print_usage(); + return octave_value(); + } + + // Open the interface + octave_i2c* retval = new octave_i2c(path, oflags); + + if (retval->i2c_get_fd() < 0) + { + error("i2c: Error opening the interface: %s\n", strerror(errno)); + return octave_value(); + } + + return octave_value(retval); +} Added: trunk/octave-forge/main/i2c/src/i2c.h =================================================================== --- trunk/octave-forge/main/i2c/src/i2c.h (rev 0) +++ trunk/octave-forge/main/i2c/src/i2c.h 2012-08-19 22:32:59 UTC (rev 10887) @@ -0,0 +1,72 @@ +// Copyright (C) 2012 Andrius Sutas <and...@gm...> +// +// This program 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. +// +// This program 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 this program; if not, see <http://www.gnu.org/licenses/>. + +#ifndef i2c_H +#define i2c_H + +#include <octave/oct.h> +#include <octave/ov-int32.h> + +#include <string> + +using std::string; + +class octave_i2c : public octave_base_value +{ +public: + octave_i2c(); + octave_i2c(string, int); + ~octave_i2c(); + + int i2c_get_fd(); + int i2c_close(); + + int i2c_set_addr(int); + int i2c_get_addr(); + + // Simple i2c commands + int i2c_write(unsigned char*, int); + int i2c_read(char*, unsigned int); + + + // Overloaded base functions + double i2c_value() const + { + return (double)this->fd; + } + + virtual double scalar_value (bool frc_str_conv = false) const + { + return (double)this->fd; + } + + void print (std::ostream& os, bool pr_as_read_syntax = false) const; + void print_raw (std::ostream& os, bool pr_as_read_syntax) const; + + // Properties + bool is_constant (void) const { return true;} + bool is_defined (void) const { return true;} + bool print_as_scalar (void) const { return true;} + +private: + int fd; + int addr; + + DECLARE_OCTAVE_ALLOCATOR + DECLARE_OV_TYPEID_FUNCTIONS_AND_DATA +}; + + +#endif Added: trunk/octave-forge/main/i2c/src/i2c_addr.cc =================================================================== --- trunk/octave-forge/main/i2c/src/i2c_addr.cc (rev 0) +++ trunk/octave-forge/main/i2c/src/i2c_addr.cc 2012-08-19 22:32:59 UTC (rev 10887) @@ -0,0 +1,89 @@ +// Copyright (C) 2012 Andrius Sutas <and...@gm...> +// +// This program 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. +// +// This program 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 this program; if not, see <http://www.gnu.org/licenses/>. + +#include <octave/oct.h> +#include <octave/ov-int32.h> +//#include <octave/ops.h> +//#include <octave/ov-typeinfo.h> + +#include <iostream> +#include <string> +#include <algorithm> + +#ifndef __WIN32__ +#include <errno.h> +#include <string.h> +#include <stdio.h> +#include <stdlib.h> +#include <unistd.h> +#include <linux/i2c-dev.h> +#include <sys/ioctl.h> +#include <sys/types.h> +#include <sys/stat.h> +#include <fcntl.h> +#endif + +#include "i2c.h" + +// PKG_ADD: autoload ("i2c_addr", "i2c.oct"); +DEFUN_DLD (i2c_addr, args, nargout, "Hello World Help String") +{ + if (args.length() > 2 || + args(0).type_id() != octave_i2c::static_type_id()) + { + print_usage(); + return octave_value(-1); + } + + octave_i2c* i2c = NULL; + + const octave_base_value& rep = args(0).get_rep(); + i2c = &((octave_i2c &)rep); + + + // Setting new slave address + if (args.length() > 1) + { + if ( !(args(1).is_integer_type() || args(1).is_float_type()) ) + { + print_usage(); + return octave_value(-1); + } + + i2c->i2c_set_addr(args(1).int_value()); + + return octave_value(); + } + + // Returning current slave address + return octave_value(i2c->i2c_get_addr()); +} + +int octave_i2c::i2c_set_addr(int addr) +{ + + if (::ioctl(i2c_get_fd(), I2C_SLAVE, addr) < 0) + { + error("i2c: Error setting slave address: %s\n", strerror(errno)); + return false; + } + + return true; +} + +int octave_i2c::i2c_get_addr() +{ + return this->addr; +} \ No newline at end of file Added: trunk/octave-forge/main/i2c/src/i2c_close.cc =================================================================== --- trunk/octave-forge/main/i2c/src/i2c_close.cc (rev 0) +++ trunk/octave-forge/main/i2c/src/i2c_close.cc 2012-08-19 22:32:59 UTC (rev 10887) @@ -0,0 +1,66 @@ +// Copyright (C) 2012 Andrius Sutas <and...@gm...> +// +// This program 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. +// +// This program 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 this program; if not, see <http://www.gnu.org/licenses/>. + +#include <octave/oct.h> +#include <octave/ov-int32.h> +//#include <octave/ops.h> +//#include <octave/ov-typeinfo.h> + +#include <iostream> +#include <string> +#include <algorithm> + +#ifndef __WIN32__ +#include <errno.h> +#include <string.h> +#include <stdio.h> +#include <stdlib.h> +#include <unistd.h> +#include <linux/i2c-dev.h> +#include <sys/ioctl.h> +#include <sys/types.h> +#include <sys/stat.h> +#include <fcntl.h> +#endif + +using std::string; + +#include "i2c.h" + +// PKG_ADD: autoload ("i2c_close", "i2c.oct"); +DEFUN_DLD (i2c_close, args, nargout, "Hello World Help String") +{ + if (args.length() != 1 || args(0).type_id() != octave_i2c::static_type_id()) + { + print_usage(); + return octave_value(-1); + } + + octave_i2c* i2c = NULL; + + const octave_base_value& rep = args(0).get_rep(); + i2c = &((octave_i2c &)rep); + + i2c->i2c_close(); + + return octave_value(); +} + +int octave_i2c::i2c_close() +{ + int retval = ::close(this->i2c_get_fd()); + this->fd = -1; + return retval; +} \ No newline at end of file Added: trunk/octave-forge/main/i2c/src/i2c_read.cc =================================================================== --- trunk/octave-forge/main/i2c/src/i2c_read.cc (rev 0) +++ trunk/octave-forge/main/i2c/src/i2c_read.cc 2012-08-19 22:32:59 UTC (rev 10887) @@ -0,0 +1,101 @@ +// Copyright (C) 2012 Andrius Sutas <and...@gm...> +// +// This program 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. +// +// This program 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 this program; if not, see <http://www.gnu.org/licenses/>. + +#include <octave/oct.h> +#include <octave/ov-int32.h> + +#include <iostream> +#include <string> +#include <algorithm> + +#ifndef __WIN32__ +#include <errno.h> +#include <string.h> +#include <stdio.h> +#include <stdlib.h> +#include <unistd.h> +#include <linux/i2c-dev.h> +#include <sys/ioctl.h> +#include <sys/types.h> +#include <sys/stat.h> +#include <fcntl.h> +#endif + + +#include "i2c.h" + +// PKG_ADD: autoload ("i2c_read", "i2c.oct"); +DEFUN_DLD (i2c_read, args, nargout, "Hello World Help String") +{ + if (args.length() < 1 || args.length() > 2 || args(0).type_id() != octave_i2c::static_type_id()) + { + print_usage(); + return octave_value(-1); + } + + char *buffer = NULL; + unsigned int buffer_len = 1; + + if (args.length() > 1) + { + if ( !(args(1).is_integer_type() || args(1).is_float_type()) ) + { + print_usage(); + return octave_value(-1); + } + + buffer_len = args(1).int_value(); + } + + buffer = new char [buffer_len + 1]; + + if (buffer == NULL) + { + error("i2c_read: cannot allocate requested memory..."); + return octave_value(-1); + } + + octave_i2c* i2c = NULL; + + const octave_base_value& rep = args(0).get_rep(); + i2c = &((octave_i2c &)rep); + + int retval; + + retval = i2c->i2c_read(buffer, buffer_len); + + octave_value_list return_list; + uint8NDArray data(retval); + + for (int i = 0; i < retval; i++) + data(i) = buffer[i]; + + return_list(1) = retval; + return_list(0) = data; + + delete[] buffer; + + return return_list; +} + +int octave_i2c::i2c_read(char *buf, unsigned int len) +{ + int retval = ::read(i2c_get_fd(), buf, len); + + if (retval != len) + error("i2c: Failed to read from the i2c bus: %s\n", strerror(errno)); + + return retval; +} \ No newline at end of file Added: trunk/octave-forge/main/i2c/src/i2c_write.cc =================================================================== --- trunk/octave-forge/main/i2c/src/i2c_write.cc (rev 0) +++ trunk/octave-forge/main/i2c/src/i2c_write.cc 2012-08-19 22:32:59 UTC (rev 10887) @@ -0,0 +1,90 @@ +// Copyright (C) 2012 Andrius Sutas <and...@gm...> +// +// This program 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. +// +// This program 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 this program; if not, see <http://www.gnu.org/licenses/>. + +#include <octave/oct.h> +#include <octave/ov-int32.h> + +#include <iostream> +#include <string> +#include <algorithm> + +#ifndef __WIN32__ +#include <errno.h> +#include <string.h> +#include <stdio.h> +#include <stdlib.h> +#include <unistd.h> +#include <linux/i2c-dev.h> +#include <sys/ioctl.h> +#include <sys/types.h> +#include <sys/stat.h> +#include <fcntl.h> +#endif + + +#include "i2c.h" + +// PKG_ADD: autoload ("i2c_write", "i2c.oct"); +DEFUN_DLD (i2c_write, args, nargout, "Hello World Help String") +{ + if (args.length() != 2 || args(0).type_id() != octave_i2c::static_type_id()) + { + print_usage(); + return octave_value(-1); + } + + octave_i2c* i2c = NULL; + + const octave_base_value& rep = args(0).get_rep(); + i2c = &((octave_i2c &)rep); + + const octave_base_value& data = args(1).get_rep(); + int retval; + + if (data.is_string()) + { + string buf = data.string_value(); + retval = i2c->i2c_write((unsigned char*)buf.c_str(), buf.length()); + } + else if (data.byte_size() == data.numel()) + { + NDArray dtmp = data.array_value(); + unsigned char* buf = new unsigned char [dtmp.length()]; + + for (int i = 0; i < dtmp.length(); i++) + buf[i] = (unsigned char)dtmp(i); + + retval = i2c->i2c_write(buf, data.byte_size()); + + delete[] buf; + } + else + { + print_usage(); + return octave_value(-1); + } + + return octave_value(retval); +} + +int octave_i2c::i2c_write(unsigned char *buf, int len) +{ + int retval = ::write(i2c_get_fd(), buf, len); + + if (retval < 0) + error("i2c: Failed to write to the i2c bus: %s\n", strerror(errno)); + + return retval; +} \ No newline at end of file Modified: trunk/octave-forge/main/serial/DESCRIPTION =================================================================== --- trunk/octave-forge/main/serial/DESCRIPTION 2012-08-19 04:30:38 UTC (rev 10886) +++ trunk/octave-forge/main/serial/DESCRIPTION 2012-08-19 22:32:59 UTC (rev 10887) @@ -6,6 +6,6 @@ Title: Serial Description: Serial functions for communicating from within octave. Categories: Serial -Depends: octave (>= 3.6.2) +Depends: octave (>= 3.2.0) Autoload: no License: LGPLv3+ Modified: trunk/octave-forge/main/serial/src/serial.h =================================================================== --- trunk/octave-forge/main/serial/src/serial.h 2012-08-19 04:30:38 UTC (rev 10886) +++ trunk/octave-forge/main/serial/src/serial.h 2012-08-19 22:32:59 UTC (rev 10887) @@ -23,12 +23,6 @@ #include <string> -/* a=target variable, b=bit number to act upon 0-n */ -#define BIT_SET(a,b) ((a) |= (1<<(b))) -#define BIT_CLEAR(a,b) ((a) &= ~(1<<(b))) -#define BIT_FLIP(a,b) ((a) ^= (1<<(b))) -#define BIT_CHECK(a,b) ((a) & (1<<(b))) - #define BITMASK_SET(x,y) ((x) |= (y)) #define BITMASK_CLEAR(x,y) ((x) &= (~(y))) #define BITMASK_TOGGLE(x,y) ((x) ^= (y)) Modified: trunk/octave-forge/main/serial/src/srl_baudrate.cc =================================================================== --- trunk/octave-forge/main/serial/src/srl_baudrate.cc 2012-08-19 04:30:38 UTC (rev 10886) +++ trunk/octave-forge/main/serial/src/srl_baudrate.cc 2012-08-19 22:32:59 UTC (rev 10887) @@ -38,19 +38,13 @@ // PKG_ADD: autoload ("srl_baudrate", "serial.oct"); DEFUN_DLD (srl_baudrate, args, nargout, "Hello World Help String") { - if (args.length() < 1 || args.length() > 2) + if (args.length() < 1 || args.length() > 2 || + args(0).type_id() != octave_serial::static_type_id()) { - error("srl_baudrate: expecting one or two arguments..."); + print_usage(); return octave_value(-1); } - - if (args(0).type_id() != octave_serial::static_type_id()) - { - error("srl_baudrate: expecting first argument of type octave_serial..."); - return octave_value(-1); - } - // Setting new baudrate if (args.length() > 1) { Modified: trunk/octave-forge/main/serial/src/srl_read.cc =================================================================== --- trunk/octave-forge/main/serial/src/srl_read.cc 2012-08-19 04:30:38 UTC (rev 10886) +++ trunk/octave-forge/main/serial/src/srl_read.cc 2012-08-19 22:32:59 UTC (rev 10887) @@ -88,9 +88,8 @@ } octave_value_list return_list; - uint8NDArray data; - data.resize(buffer_read); - + uint8NDArray data(buffer_read); + // TODO: clean this up for (int i = 0; i < buffer_read; i++) { Modified: trunk/octave-forge/main/serial/src/srl_write.cc =================================================================== --- trunk/octave-forge/main/serial/src/srl_write.cc 2012-08-19 04:30:38 UTC (rev 10886) +++ trunk/octave-forge/main/serial/src/srl_write.cc 2012-08-19 22:32:59 UTC (rev 10887) @@ -39,24 +39,14 @@ // PKG_ADD: autoload ("srl_write", "serial.oct"); DEFUN_DLD (srl_write, args, nargout, "Hello World Help String") { - if (args.length() != 2) + if (args.length() != 2) || + args(0).type_id() != octave_serial::static_type_id() || + !args(1).is_string()) { - error("srl_write: expecting two arguments..."); + print_usage(); return octave_value(-1); } - - if (args(0).type_id() != octave_serial::static_type_id()) - { - error("srl_write: expecting first argument of type octave_serial..."); - return octave_value(-1); - } - - if (!args(1).is_string()) - { - error("srl_write: expecting second argument of type string..."); - return octave_value(-1); - } - + octave_serial* serial = NULL; const octave_base_value& rep = args(0).get_rep(); This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <par...@us...> - 2012-08-19 04:30:44
|
Revision: 10886 http://octave.svn.sourceforge.net/octave/?rev=10886&view=rev Author: paramaniac Date: 2012-08-19 04:30:38 +0000 (Sun, 19 Aug 2012) Log Message: ----------- control: support delay parameter nk in arx identification Modified Paths: -------------- trunk/octave-forge/main/control/inst/arx.m Modified: trunk/octave-forge/main/control/inst/arx.m =================================================================== --- trunk/octave-forge/main/control/inst/arx.m 2012-08-18 14:16:50 UTC (rev 10885) +++ trunk/octave-forge/main/control/inst/arx.m 2012-08-19 04:30:38 UTC (rev 10886) @@ -91,6 +91,9 @@ error ("arx: first argument must be a time-domain iddata dataset"); endif + ## p: outputs, m: inputs, ex: experiments + [~, p, m, ex] = size (dat); # dataset dimensions + if (is_real_scalar (varargin{1})) # arx (dat, n, ...) varargin = horzcat (varargin(2:end), {"na"}, varargin(1), {"nb"}, varargin(1)); endif @@ -105,27 +108,10 @@ error ("arx: keys and values must come in pairs"); endif - - ## p: outputs, m: inputs, ex: experiments - [~, p, m, ex] = size (dat); # dataset dimensions - - ## extract data - Y = dat.y; - U = dat.u; - tsam = dat.tsam; - - ## multi-experiment data requires equal sampling times - if (ex > 1 && ! isequal (tsam{:})) - error ("arx: require equally sampled experiments"); - else - tsam = tsam{1}; - endif - - ## default arguments na = []; - nb = []; % ??? - nk = []; + nb = []; + nk = 0; ## handle keys and values for k = 1 : 2 : nkv @@ -138,13 +124,32 @@ case "nb" nb = val; case "nk" - error ("nk"); + if (issample (val, 0) && fix (val) == val) # individual, channel-wise nk not supported yet + nk = val; + else + error ("arx: argument 'nk' must be a positive integer"); + endif otherwise warning ("arx: invalid property name '%s' ignored", key); endswitch endfor + if (any (nk(:) != 0)) + dat = nkshift (dat, nk); + endif + ## extract data + Y = dat.y; + U = dat.u; + tsam = dat.tsam; + + ## multi-experiment data requires equal sampling times + if (ex > 1 && ! isequal (tsam{:})) + error ("arx: require equally sampled experiments"); + else + tsam = tsam{1}; + endif + if (is_real_scalar (na, nb)) na = repmat (na, p, 1); # na(p-by-1) nb = repmat (nb, p, m); # nb(p-by-m) @@ -184,11 +189,11 @@ ThetaB = Theta(na(i)+1:end); # all polynomials from B are in one column vector B = mat2cell (ThetaB, nb(i,:)); # now separate the polynomials, one for each input B = reshape (B, 1, []); # make B a row cell (1-by-m) - B = cellfun (@(x) [0; x], B, "uniformoutput", false); # b0 = 0 (leading zero required by filt) + B = cellfun (@(B) [zeros(1+nk, 1); B], B, "uniformoutput", false); # b0 = 0 (leading zero required by filt) ## add error inputs Be = repmat ({0}, 1, p); # there are as many error inputs as system outputs (p) - Be(i) = 1; # inputs m+1:m+p are zero, except m+i which is one + Be(i) = [zeros(1,nk), 1]; # inputs m+1:m+p are zero, except m+i which is one num(i, :) = [B, Be]; # numerator polynomials for output i, individual for each input den(i, :) = repmat ({A}, 1, m+p); # in a row (output i), all inputs have the same denominator polynomial endfor @@ -218,33 +223,33 @@ endfunction -function theta = __theta__ (phi, y, i, n) +function Theta = __theta__ (Phi, Y, i, n) - if (numel (phi) == 1) # single-experiment dataset + if (numel (Phi) == 1) # single-experiment dataset ## use "square-root algorithm" - A = horzcat (phi{1}, y{1}(n(i)+1:end, i)); # [Phi, Y] + A = horzcat (Phi{1}, Y{1}(n(i)+1:end, i)); # [Phi, Y] R0 = triu (qr (A, 0)); # 0 for economy-size R (without zero rows) R1 = R0(1:end-1, 1:end-1); # R1 is triangular - can we exploit this in R1\R2? R2 = R0(1:end-1, end); - theta = __ls_svd__ (R1, R2); # R1 \ R2 + Theta = __ls_svd__ (R1, R2); # R1 \ R2 ## Theta = Phi \ Y(n+1:end, :); # naive formula - ## theta = __ls_svd__ (phi{1}, y{1}(n(i)+1:end, i)); + ## Theta = __ls_svd__ (Phi{1}, Y{1}(n(i)+1:end, i)); else # multi-experiment dataset ## TODO: find more sophisticated formula than ## Theta = (Phi1' Phi1 + Phi2' Phi2 + ...) \ (Phi1' Y1 + Phi2' Y2 + ...) ## covariance matrix C = (Phi1' Phi + Phi2' Phi2 + ...) - tmp = cellfun (@(Phi) Phi.' * Phi, phi, "uniformoutput", false); - rc = cellfun (@rcond, tmp); # C auch noch testen? QR oder SVD? + tmp = cellfun (@(Phi) Phi.' * Phi, Phi, "uniformoutput", false); + ## rc = cellfun (@rcond, tmp); # also test C? QR or SVD? C = plus (tmp{:}); ## PhiTY = (Phi1' Y1 + Phi2' Y2 + ...) - tmp = cellfun (@(Phi, Y) Phi.' * Y(n(i)+1:end, i), phi, y, "uniformoutput", false); + tmp = cellfun (@(Phi, Y) Phi.' * Y(n(i)+1:end, i), Phi, Y, "uniformoutput", false); PhiTY = plus (tmp{:}); ## pseudoinverse Theta = C \ Phi'Y - theta = __ls_svd__ (C, PhiTY); + Theta = __ls_svd__ (C, PhiTY); endif endfunction This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <par...@us...> - 2012-08-18 14:16:58
|
Revision: 10885 http://octave.svn.sourceforge.net/octave/?rev=10885&view=rev Author: paramaniac Date: 2012-08-18 14:16:50 +0000 (Sat, 18 Aug 2012) Log Message: ----------- control: minor doc fixes Modified Paths: -------------- trunk/octave-forge/main/control/devel/PROJECTS trunk/octave-forge/main/control/devel/pdfdoc/control.tex trunk/octave-forge/main/control/inst/arx.m Modified: trunk/octave-forge/main/control/devel/PROJECTS =================================================================== --- trunk/octave-forge/main/control/devel/PROJECTS 2012-08-17 19:29:27 UTC (rev 10884) +++ trunk/octave-forge/main/control/devel/PROJECTS 2012-08-18 14:16:50 UTC (rev 10885) @@ -15,7 +15,8 @@ * Improve @lti/subsasgn.m - * Improve @lti/parallel.m + * Improve @lti/parallel.m by implementing "complicated" case + sys = parallel (sys1, sys2, in1, in2, out1, out2) * n-th order approximation of time delay exp (tau*s) sys = pade (tau, n) @@ -48,7 +49,6 @@ -- Beware of indices not in ascending order. * Fix PDF manual. - -- @seealso comments -- Use TEX for formulas (iftex) * "horzcat" and "vertcat" are trivial operations for TF, FRD and ZPK models. Modified: trunk/octave-forge/main/control/devel/pdfdoc/control.tex =================================================================== --- trunk/octave-forge/main/control/devel/pdfdoc/control.tex 2012-08-17 19:29:27 UTC (rev 10884) +++ trunk/octave-forge/main/control/devel/pdfdoc/control.tex 2012-08-18 14:16:50 UTC (rev 10885) @@ -3,7 +3,7 @@ @setfilename control.info @settitle Octave Control Systems Package @afourpaper -@set VERSION 2.3.52 +@set VERSION 2.3.53 @finalout @c @afourwide @c %**end of header @@ -65,6 +65,7 @@ and @tex $ H_{\infty} $ @end tex synthesis methods. @item Frequency-weighted model and controller reduction. +@item System identification by subspace methods. @item Overloaded operators due to the use of classes introduced with Octave 3.2. @item Support for descriptor state-space models and non-proper transfer functions. @item Improved @acronym{MATLAB} compatibility. Modified: trunk/octave-forge/main/control/inst/arx.m =================================================================== --- trunk/octave-forge/main/control/inst/arx.m 2012-08-17 19:29:27 UTC (rev 10884) +++ trunk/octave-forge/main/control/inst/arx.m 2012-08-18 14:16:50 UTC (rev 10885) @@ -25,7 +25,7 @@ ## @strong{Inputs} ## @table @var ## @item dat -## iddata set containing the measurements, i.e. time-domain signals. +## iddata identification dataset containing the measurements, i.e. time-domain signals. ## @item n ## The desired order of the resulting model @var{sys}. ## @item @dots{} This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <car...@us...> - 2012-08-17 19:29:34
|
Revision: 10884 http://octave.svn.sourceforge.net/octave/?rev=10884&view=rev Author: carandraug Date: 2012-08-17 19:29:27 +0000 (Fri, 17 Aug 2012) Log Message: ----------- lssa: coding guidelines * replacing tabs per spaces * do not use newline for erros to show traceback * use elseif to reduce code Modified Paths: -------------- trunk/octave-forge/extra/lssa/inst/cubicwgt.m trunk/octave-forge/extra/lssa/inst/lombcoeff.m trunk/octave-forge/extra/lssa/inst/lombnormcoeff.m trunk/octave-forge/extra/lssa/inst/lscomplex.m trunk/octave-forge/extra/lssa/inst/lscomplexwavelet.m trunk/octave-forge/extra/lssa/inst/lscorrcoeff.m trunk/octave-forge/extra/lssa/inst/lsreal.m trunk/octave-forge/extra/lssa/inst/lswaveletcoeff.m trunk/octave-forge/extra/lssa/src/fastlscomplex.cc Modified: trunk/octave-forge/extra/lssa/inst/cubicwgt.m =================================================================== --- trunk/octave-forge/extra/lssa/inst/cubicwgt.m 2012-08-17 15:49:41 UTC (rev 10883) +++ trunk/octave-forge/extra/lssa/inst/cubicwgt.m 2012-08-17 19:29:27 UTC (rev 10884) @@ -32,7 +32,7 @@ function a = cubicwgt (s) if (nargin != 1) - print_usage (); + print_usage (); endif ## s is the value/vector/matrix to be windowed Modified: trunk/octave-forge/extra/lssa/inst/lombcoeff.m =================================================================== --- trunk/octave-forge/extra/lssa/inst/lombcoeff.m 2012-08-17 15:49:41 UTC (rev 10883) +++ trunk/octave-forge/extra/lssa/inst/lombcoeff.m 2012-08-17 19:29:27 UTC (rev 10884) @@ -25,17 +25,14 @@ function coeff = lombcoeff (T, X, o) if (nargin != 3) - print_usage (); + print_usage (); + elseif (! all (size (T) == size (X))) + error ("lombcoeff: Time series vectors of uneven size"); + elseif (! isscalar (o)) + error ("lombcoeff: Supplied frequency is not a scalar"); + elseif (o == 0) + error ("lombcoeff: Supplied frequency is not a frequency"); endif - if (! all (size (T) == size (X))) - error ("lombcoeff: Time series vectors of uneven size.\n"); - endif - if (! isscalar (o)) - error ("lombcoeff: Supplied frequency is not a scalar.\n"); - endif - if (o == 0) - error ("lombcoeff: Supplied frequency is not a frequency.\n"); - endif oT = o .* T; Modified: trunk/octave-forge/extra/lssa/inst/lombnormcoeff.m =================================================================== --- trunk/octave-forge/extra/lssa/inst/lombnormcoeff.m 2012-08-17 15:49:41 UTC (rev 10883) +++ trunk/octave-forge/extra/lssa/inst/lombnormcoeff.m 2012-08-17 19:29:27 UTC (rev 10884) @@ -27,28 +27,25 @@ function coeff = lombnormcoeff (T, X, omega) if (nargin != 3) - print_usage (); + print_usage (); + elseif (! all (size (T) == size (X))) + error ("lombnormcoeff: Time series vectors of uneven size"); + elseif (! isscalar (omega)) + error ("lombnormcoeff: Supplied frequency is not a scalar"); + elseif (omega == 0) + error ("lombnormcoeff: Supplied frequency is not a frequency"); endif - if (! all (size (T) == size (X))) - error ("lombnormcoeff: Time series vectors of uneven size.\n"); - endif - if (! isscalar (omega)) - error ("lombnormcoeff: Supplied frequency is not a scalar.\n"); - endif - if (omega == 0) - error ("lombnormcoeff: Supplied frequency is not a frequency.\n"); - endif xmean = mean (X); theta = atan2 (sum (sin (2 .* omega .*T)), - sum (cos (2 .* omega .* T))) / (2*omega); + sum (cos (2 .* omega .* T))) / (2*omega); coeff = ((sum ((X-xmean) .* cos (omega .* T - theta)) .^ 2 / - sum (cos (omega .* T - theta) .^ 2) + + sum (cos (omega .* T - theta) .^ 2) + sum ((X-xmean) .* sin (omega .* T - theta)) .^ 2 / - sum (sin (omega .* T - theta) .^ 2 )) / + sum (sin (omega .* T - theta) .^ 2 )) / (2 * var(X))); endfunction Modified: trunk/octave-forge/extra/lssa/inst/lscomplex.m =================================================================== --- trunk/octave-forge/extra/lssa/inst/lscomplex.m 2012-08-17 15:49:41 UTC (rev 10883) +++ trunk/octave-forge/extra/lssa/inst/lscomplex.m 2012-08-17 19:29:27 UTC (rev 10884) @@ -33,43 +33,32 @@ function transform = lscomplex (t, x, omegamax, ncoeff, noctave) if (nargin != 5) - print_usage (); + print_usage (); + elseif (! isvector (t)) + error ("lscomplex: Time values are not a vector"); + elseif (! isvector (x)) + error ("lscomplex: Magnitude values are not a vector"); + elseif (! all (size (t) == size (x))) + error ("lscomplex: Size of time vector, magnitude vector unequal"); + elseif (! isscalar (omegamax)) + error ("lscomplex: More than one value for maximum frequency specified"); + elseif (! isscalar (ncoeff)) + error ("lscomplex: More than one number of frequencies per octave specified"); + elseif (! isscalar (noctave)) + error ("lscomplex: More than one number of octaves to traverse specified"); + elseif (omegamax == 0) + error ("lscomplex: Specified maximum frequency is not a frequency"); + elseif (noctave == 0) + error ("lscomplex: No octaves of results requested"); + elseif (ncoeff == 0) + error ("lscomplex: No frequencies per octave requested"); + elseif (ncoeff != floor (ncoeff)) + error ("lscomplex: Specified number of frequencies per octave is not integral"); + elseif (noctave != floor (noctave)) + error ("lscomplex: Specified number of octaves of results is not integral"); endif - if (! isvector (t)) - error ("lscomplex: Time values are not a vector.\n"); - endif - if (! isvector (x)) - error ("lscomplex: Magnitude values are not a vector.\n"); - endif - if (! all (size (t) == size (x))) - error ("lscomplex: Size of time vector, magnitude vector unequal.\n"); - endif - if (! isscalar (omegamax)) - error ("lscomplex: More than one value for maximum frequency specified.\n"); - endif - if (! isscalar (ncoeff)) - error ("lscomplex: More than one number of frequencies per octave specified.\n"); - endif - if (! isscalar (noctave)) - error ("lscomplex: More than one number of octaves to traverse specified.\n"); - endif - if (omegamax == 0) - error ("lscomplex: Specified maximum frequency is not a frequency.\n"); - endif - if (noctave == 0) - error ("lscomplex: No octaves of results requested.\n"); - endif - if (ncoeff == 0) - error ("lscomplex: No frequencies per octave requested.\n"); - endif - if (ncoeff != floor (ncoeff)) - error ("lscomplex: Specified number of frequencies per octave is not integral.\n"); - endif - if (noctave != floor (noctave)) - error ("lscomplex: Specified number of octaves of results is not integral.\n"); - endif - n = numel (t); + n = numel (t); iter = 0 : (ncoeff * noctave - 1); omul = (2 .^ (- iter / ncoeff)); Modified: trunk/octave-forge/extra/lssa/inst/lscomplexwavelet.m =================================================================== --- trunk/octave-forge/extra/lssa/inst/lscomplexwavelet.m 2012-08-17 15:49:41 UTC (rev 10883) +++ trunk/octave-forge/extra/lssa/inst/lscomplexwavelet.m 2012-08-17 19:29:27 UTC (rev 10884) @@ -52,7 +52,7 @@ ## 2004.) does not seem to always cover all values in the data set, and makes ## me suspicious of its ability to accurately transform a data set. ## - + transform = cell(noctave*ncoeff,1); for octave_iter = 1:noctave @@ -63,11 +63,11 @@ ## An additional consideration is that for coeff_iter = 1:ncoeff - + ## in this, win_t is the centre of the window in question ## Although that will vary depending on the window. This is just an ## implementation for the first window. - + current_iteration = (octave_iter-1)*ncoeff+coeff_iter; window_radius = pi / ( sigma * omegamax * ( 2 ^ ( current_iteration - 1 ) ) ); window_count = 2 * ceil ( ( tmax - tmin ) / window_radius ) - 1; @@ -80,14 +80,14 @@ ## win_t is the centre of the current window. win_t = tmin + window_radius; for iter_window = 1:window_count - ## Computes the transform as stated in the paper for each given frequency. - zeta = sum ( cubicwgt ( sigma .* omega .* ( T - win_t ) ) .* exp ( -i .* omega .* ( T - win_t ) ) .* X ) / sum ( cubicwgt ( sigma .* omega .* ( T - win_t ) ) .* exp ( -i .* omega .* ( T - win_t ) ) ); - transform{current_iteration}(iter_window) = zeta; - window_min += window_radius ; + ## Computes the transform as stated in the paper for each given frequency. + zeta = sum ( cubicwgt ( sigma .* omega .* ( T - win_t ) ) .* exp ( -i .* omega .* ( T - win_t ) ) .* X ) / sum ( cubicwgt ( sigma .* omega .* ( T - win_t ) ) .* exp ( -i .* omega .* ( T - win_t ) ) ); + transform{current_iteration}(iter_window) = zeta; + window_min += window_radius ; + endfor endfor + endfor - -endfor endfunction Modified: trunk/octave-forge/extra/lssa/inst/lscorrcoeff.m =================================================================== --- trunk/octave-forge/extra/lssa/inst/lscorrcoeff.m 2012-08-17 15:49:41 UTC (rev 10883) +++ trunk/octave-forge/extra/lssa/inst/lscorrcoeff.m 2012-08-17 19:29:27 UTC (rev 10884) @@ -37,38 +37,29 @@ ## Input checking is absolutely necessary. if (!((nargin >= 6) && (nargin <= 8))) - print_usage (); - endif + print_usage (); ## Test to be sure x1, y1, x2, y2 are all vectors, and that t and o are ## scalars. - if (! isvector (x1)) - error ("lscorrcoeff: First time series time values are not a vector.\n"); + elseif (! isvector (x1)) + error ("lscorrcoeff: First time series time values are not a vector"); + elseif (! isvector (y1)) + error ("lscorrcoeff: First time series magnitude values are not a vector"); + elseif (! isvector (x2)) + error ("lscorrcoeff: Second time series time values are not a vector"); + elseif (! isvector (y2)) + error ("lscorrcoeff: Second time series magnitude values are not a vector"); + elseif (! isscalar (t)) + error ("lscorrcoeff: Window centre is not a scalar"); + elseif (! isscalar (o)) + error ("lscorrcoeff: Specified frequency is not a scalar"); + elseif (! isscalar (wgtrad)) + error ("lscorrcoeff: Window radius is not a scalar"); + elseif (! all (size (x1) == size (y1))) + error ("lscorrcoeff: First time series vectors not of matching size"); + elseif (! all (size (x2) == size (y2))) + error ("lscorrcoeff: Second time series vectors not of matching size"); endif - if (! isvector (y1)) - error ("lscorrcoeff: First time series magnitude values are not a vector.\n"); - endif - if (! isvector (x2)) - error ("lscorrcoeff: Second time series time values are not a vector.\n"); - endif - if (! isvector (y2)) - error ("lscorrcoeff: Second time series magnitude values are not a vector.\n"); - endif - if (! isscalar (t)) - error ("lscorrcoeff: Window centre is not a scalar.\n"); - endif - if (! isscalar (o)) - error ("lscorrcoeff: Specified frequency is not a scalar.\n"); - endif - if (! isscalar (wgtrad)) - error ("lscorrcoeff: Window radius is not a scalar.\n"); - endif - if (! all (size (x1) == size (y1))) - error ("lscorrcoeff: First time series vectors not of matching size.\n"); - endif - if (! all (size (x2) == size (y2))) - error ("lscorrcoeff: Second time series vectors not of matching size.\n"); - endif ## How to determine if a weight function has been assigned or not? (Possible ## to get name of function?) @@ -89,7 +80,7 @@ windowed_element_count = length (rx1); if (windowed_element_count == 0) - error("lscorrcoeff: No time-series elements contained in window.\n"); + error("lscorrcoeff: No time-series elements contained in window"); endif s = sum (wgt ((rx1 - t) .* so)) * sum (wgt ((rx2 - t ) .* so )); Modified: trunk/octave-forge/extra/lssa/inst/lsreal.m =================================================================== --- trunk/octave-forge/extra/lssa/inst/lsreal.m 2012-08-17 15:49:41 UTC (rev 10883) +++ trunk/octave-forge/extra/lssa/inst/lsreal.m 2012-08-17 19:29:27 UTC (rev 10884) @@ -39,41 +39,30 @@ ## Sanity checks to make sure that the user can get meaningful errors. if (nargin != 5) - print_usage (); + print_usage (); + elseif (! isvector (t)) + error ("lsreal: Time values are not a vector"); + elseif (! isvector (x)) + error ("lsreal: Magnitude values are not a vector"); + elseif (! all (size (t) == size (x))) + error ("lsreal: Size of time vector, magnitude vector unequal"); + elseif (! isscalar (omegamax)) + error ("lsreal: More than one value for maximum frequency specified"); + elseif (! isscalar (ncoeff)) + error ("lsreal: More than one number of frequencies per octave specified"); + elseif (! isscalar (noctave)) + error ("lsreal: More than one number of octaves to traverse specified"); + elseif (omegamax == 0) + error ("lsreal: Specified maximum frequency is not a frequency"); + elseif (noctave == 0) + error ("lsreal: No octaves of results requested"); + elseif (ncoeff == 0) + error ("lsreal: No frequencies per octave requested"); + elseif (ncoeff != floor (ncoeff)) + error ("lsreal: Specified number of frequencies per octave is not integral"); + elseif (noctave != floor (noctave)) + error ("lsreal: Specified number of octaves of results is not integral"); endif - if (! isvector (t)) - error ("lsreal: Time values are not a vector.\n"); - endif - if (! isvector (x)) - error ("lsreal: Magnitude values are not a vector.\n"); - endif - if (! all (size (t) == size (x))) - error ("lsreal: Size of time vector, magnitude vector unequal.\n"); - endif - if (! isscalar (omegamax)) - error ("lsreal: More than one value for maximum frequency specified.\n"); - endif - if (! isscalar (ncoeff)) - error ("lsreal: More than one number of frequencies per octave specified.\n"); - endif - if (! isscalar (noctave)) - error ("lsreal: More than one number of octaves to traverse specified.\n"); - endif - if (omegamax == 0) - error ("lsreal: Specified maximum frequency is not a frequency.\n"); - endif - if (noctave == 0) - error ("lsreal: No octaves of results requested.\n"); - endif - if (ncoeff == 0) - error ("lsreal: No frequencies per octave requested.\n"); - endif - if (ncoeff != floor (ncoeff)) - error ("lsreal: Specified number of frequencies per octave is not integral.\n"); - endif - if (noctave != floor (noctave)) - error ("lsreal: Specified number of octaves of results is not integral.\n"); - endif n = numel (t); Modified: trunk/octave-forge/extra/lssa/inst/lswaveletcoeff.m =================================================================== --- trunk/octave-forge/extra/lssa/inst/lswaveletcoeff.m 2012-08-17 15:49:41 UTC (rev 10883) +++ trunk/octave-forge/extra/lssa/inst/lswaveletcoeff.m 2012-08-17 19:29:27 UTC (rev 10884) @@ -37,26 +37,20 @@ function coeff = lswaveletcoeff (x, y, t, o, wgt = @cubicwgt, wgtrad = 1) if (! (nargin >= 4) && (nargin <= 6)) - print_usage (); + print_usage (); + elseif (! isvector (x)) + error ("lswaveletcoeff: Time values are not a vector"); + elseif (! isvector (y)) + error ("lswaveletcoeff: Magnitude values are not a vector"); + elseif (! all (size (x) == size (y))) + error ("lswaveletcoeff: Time series vectors of uneven size"); + elseif (! isscalar (t)) + error ("lswaveletcoeff: Window centre specified is not scalar"); + elseif (! isscalar (o)) + error ("lswaveletcoeff: Frequency specified is not scalar"); + elseif (! isscalar (wgtrad)) + error ("lswaveletcoeff: Window radius specified is not scalar"); endif - if (! isvector (x)) - error ("lswaveletcoeff: Time values are not a vector.\n"); - endif - if (! isvector (y)) - error ("lswaveletcoeff: Magnitude values are not a vector.\n"); - endif - if (! all (size (x) == size (y))) - error ("lswaveletcoeff: Time series vectors of uneven size.\n"); - endif - if (! isscalar (t)) - error ("lswaveletcoeff: Window centre specified is not scalar.\n"); - endif - if (! isscalar (o)) - error ("lswaveletcoeff: Frequency specified is not scalar.\n"); - endif - if (! isscalar (wgtrad)) - error ("lswaveletcoeff: Window radius specified is not scalar.\n"); - endif so = 0.05 .* o; Modified: trunk/octave-forge/extra/lssa/src/fastlscomplex.cc =================================================================== --- trunk/octave-forge/extra/lssa/src/fastlscomplex.cc 2012-08-17 15:49:41 UTC (rev 10883) +++ trunk/octave-forge/extra/lssa/src/fastlscomplex.cc 2012-08-17 19:29:27 UTC (rev 10884) @@ -312,30 +312,30 @@ */ double *exp_pse_ptr, *exp_ptr, exp_power_series_elements[12]; { - double t = mu * loop_delta_tau, tt; - exp_ptr = exp_power_series_elements; - *exp_ptr++ = 1; - *exp_ptr++ = t; - tt = t * t * ( 1.0 / 2.0 ); - *exp_ptr++ = tt; - tt *= t * ( 1.0 / 3.0 ); - *exp_ptr++ = tt; - tt *= t * ( 1.0 / 4.0 ); - *exp_ptr++ = tt; - tt *= t * ( 1.0 / 5.0 ); - *exp_ptr++ = tt; - tt *= t * ( 1.0 / 6.0 ); - *exp_ptr++ = tt; - tt *= t * ( 1.0 / 7.0 ); - *exp_ptr++ = tt; - tt *= t * ( 1.0 / 8.0 ); - *exp_ptr++ = tt; - tt *= t * ( 1.0 / 9.0 ); - *exp_ptr++ = tt; - tt *= t * ( 1.0 / 10.0 ); - *exp_ptr++ = tt; - tt *= t * ( 1.0 / 11.0 ); - *exp_ptr++ = tt; + double t = mu * loop_delta_tau, tt; + exp_ptr = exp_power_series_elements; + *exp_ptr++ = 1; + *exp_ptr++ = t; + tt = t * t * ( 1.0 / 2.0 ); + *exp_ptr++ = tt; + tt *= t * ( 1.0 / 3.0 ); + *exp_ptr++ = tt; + tt *= t * ( 1.0 / 4.0 ); + *exp_ptr++ = tt; + tt *= t * ( 1.0 / 5.0 ); + *exp_ptr++ = tt; + tt *= t * ( 1.0 / 6.0 ); + *exp_ptr++ = tt; + tt *= t * ( 1.0 / 7.0 ); + *exp_ptr++ = tt; + tt *= t * ( 1.0 / 8.0 ); + *exp_ptr++ = tt; + tt *= t * ( 1.0 / 9.0 ); + *exp_ptr++ = tt; + tt *= t * ( 1.0 / 10.0 ); + *exp_ptr++ = tt; + tt *= t * ( 1.0 / 11.0 ); + *exp_ptr++ = tt; } exp_pse_ptr = exp_ptr = exp_power_series_elements; This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <be...@us...> - 2012-08-17 15:49:47
|
Revision: 10883 http://octave.svn.sourceforge.net/octave/?rev=10883&view=rev Author: benjf5 Date: 2012-08-17 15:49:41 +0000 (Fri, 17 Aug 2012) Log Message: ----------- News and version update to match new release. Modified Paths: -------------- trunk/octave-forge/extra/lssa/DESCRIPTION trunk/octave-forge/extra/lssa/NEWS Added Paths: ----------- trunk/octave-forge/extra/lssa/ONEWS Modified: trunk/octave-forge/extra/lssa/DESCRIPTION =================================================================== --- trunk/octave-forge/extra/lssa/DESCRIPTION 2012-08-17 10:51:51 UTC (rev 10882) +++ trunk/octave-forge/extra/lssa/DESCRIPTION 2012-08-17 15:49:41 UTC (rev 10883) @@ -1,6 +1,6 @@ Name: lssa -Version: 0.1.1 -Date: 2012-08-09 +Version: 0.1.2 +Date: 2012-08-17 Author: Ben Lewis <be...@gm...> Maintainer: Ben Lewis <be...@gm...> Title: Least squares spectral analysis Modified: trunk/octave-forge/extra/lssa/NEWS =================================================================== --- trunk/octave-forge/extra/lssa/NEWS 2012-08-17 10:51:51 UTC (rev 10882) +++ trunk/octave-forge/extra/lssa/NEWS 2012-08-17 15:49:41 UTC (rev 10883) @@ -1,7 +1,12 @@ -Welcome to the first release of lssa, 0.1.1 +Summary of changes in lssa 0.1.2: + ** All functions now have input checks in place to return useful errors as + opposed to division by zero, etc. Documentation has also been improved. + +Summary of status of the intial lssa release, 0.1.1: + Current status: - + ** lscomplex and lsreal both produce accurate results; they can be slow for very large datasets. Added: trunk/octave-forge/extra/lssa/ONEWS =================================================================== --- trunk/octave-forge/extra/lssa/ONEWS (rev 0) +++ trunk/octave-forge/extra/lssa/ONEWS 2012-08-17 15:49:41 UTC (rev 10883) @@ -0,0 +1,28 @@ +Welcome to the first release of lssa, 0.1.1 + +Current status: + + ** lscomplex and lsreal both produce accurate results; they can be slow for + very large datasets. + + ** fastlscomplex is accurate for the first octave of results; there is still an + error I need to pin down in the merging for additional octaves. fastlsreal + is disabled at the moment as I move to an implementation based on the new + fastlscomplex. + + ** lscorrcoeff works, although I'm still attempting to understand the initial + author's reasoning. Its generated results are relevant to any given data + set, but it does not appear to be normalized to any great extent. + + ** There are two wavelet functions under development, but they are not included + in this release as they are currently not functional. For all your wavelet + needs, the specific transformation used is available in the lswaveletcoeff + function, and will generate a single cosine/sine magnitude pair (as a + complex number) for a complex-valued series (this function may be joined by + a companion for real-valued series) and can be looped to simulate a full + wavelet transform. + + ** For all the working functions, tests have been written and formatted to + Octave coding standards. These tests should pass on any given architecture + (there was some question about that previously) and often provide examples + of how the function operates. For a few functions, there are demo scripts. This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <par...@us...> - 2012-08-17 10:51:57
|
Revision: 10882 http://octave.svn.sourceforge.net/octave/?rev=10882&view=rev Author: paramaniac Date: 2012-08-17 10:51:51 +0000 (Fri, 17 Aug 2012) Log Message: ----------- control: mute warning in test Modified Paths: -------------- trunk/octave-forge/main/control/inst/@iddata/fft.m trunk/octave-forge/main/control/inst/__iddata_dim__.m Modified: trunk/octave-forge/main/control/inst/@iddata/fft.m =================================================================== --- trunk/octave-forge/main/control/inst/@iddata/fft.m 2012-08-16 21:00:23 UTC (rev 10881) +++ trunk/octave-forge/main/control/inst/@iddata/fft.m 2012-08-17 10:51:51 UTC (rev 10882) @@ -88,7 +88,10 @@ %!shared DATD, Y, U %! Y = 1:10; %! U = 20:-2:1; +%! W = warning ("query", "iddata:transpose"); +%! warning ("off", W.identifier); %! DAT = iddata (Y, U); %! DATD = fft (DAT); +%! warning (W.identifier, W.state); %!assert (DATD.y{1}, Y, 1e-10); %!assert (DATD.u{1}, U, 1e-10); Modified: trunk/octave-forge/main/control/inst/__iddata_dim__.m =================================================================== --- trunk/octave-forge/main/control/inst/__iddata_dim__.m 2012-08-16 21:00:23 UTC (rev 10881) +++ trunk/octave-forge/main/control/inst/__iddata_dim__.m 2012-08-17 10:51:51 UTC (rev 10882) @@ -43,11 +43,11 @@ endif if (ly < p) - warning ("iddata: more outputs than samples - matrice 'y' should probably be transposed"); + warning ("iddata:transpose", "iddata: more outputs than samples - matrice 'y' should probably be transposed"); endif if (lu < m) - warning ("iddata: more inputs than samples - matrice 'u' should probably be transposed"); + warning ("iddata:transpose", "iddata: more inputs than samples - matrice 'u' should probably be transposed"); endif endfunction This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <be...@us...> - 2012-08-16 21:00:29
|
Revision: 10881 http://octave.svn.sourceforge.net/octave/?rev=10881&view=rev Author: benjf5 Date: 2012-08-16 21:00:23 +0000 (Thu, 16 Aug 2012) Log Message: ----------- Fixing some errors; minor improvement in accelerated complex transform. Modified Paths: -------------- trunk/octave-forge/extra/lssa/inst/lscorrcoeff.m trunk/octave-forge/extra/lssa/inst/lswaveletcoeff.m trunk/octave-forge/extra/lssa/src/fastlscomplex.cc Modified: trunk/octave-forge/extra/lssa/inst/lscorrcoeff.m =================================================================== --- trunk/octave-forge/extra/lssa/inst/lscorrcoeff.m 2012-08-16 16:29:54 UTC (rev 10880) +++ trunk/octave-forge/extra/lssa/inst/lscorrcoeff.m 2012-08-16 21:00:23 UTC (rev 10881) @@ -88,7 +88,7 @@ ry2 = y2(mask); windowed_element_count = length (rx1); - if (windowed_element_count = 0) + if (windowed_element_count == 0) error("lscorrcoeff: No time-series elements contained in window.\n"); endif Modified: trunk/octave-forge/extra/lssa/inst/lswaveletcoeff.m =================================================================== --- trunk/octave-forge/extra/lssa/inst/lswaveletcoeff.m 2012-08-16 16:29:54 UTC (rev 10880) +++ trunk/octave-forge/extra/lssa/inst/lswaveletcoeff.m 2012-08-16 21:00:23 UTC (rev 10881) @@ -36,7 +36,7 @@ function coeff = lswaveletcoeff (x, y, t, o, wgt = @cubicwgt, wgtrad = 1) - if (! (ncoeff >= 4) && (ncoeff <= 6)) + if (! (nargin >= 4) && (nargin <= 6)) print_usage (); endif if (! isvector (x)) Modified: trunk/octave-forge/extra/lssa/src/fastlscomplex.cc =================================================================== --- trunk/octave-forge/extra/lssa/src/fastlscomplex.cc 2012-08-16 16:29:54 UTC (rev 10880) +++ trunk/octave-forge/extra/lssa/src/fastlscomplex.cc 2012-08-16 21:00:23 UTC (rev 10881) @@ -312,7 +312,7 @@ */ double *exp_pse_ptr, *exp_ptr, exp_power_series_elements[12]; { - double t = mu * dtaud, tt; + double t = mu * loop_delta_tau, tt; exp_ptr = exp_power_series_elements; *exp_ptr++ = 1; *exp_ptr++ = t; This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <be...@us...> - 2012-08-16 16:30:04
|
Revision: 10880 http://octave.svn.sourceforge.net/octave/?rev=10880&view=rev Author: benjf5 Date: 2012-08-16 16:29:54 +0000 (Thu, 16 Aug 2012) Log Message: ----------- Added sanity checks to functions, improved some documentation for lssa. Modified Paths: -------------- trunk/octave-forge/extra/lssa/INDEX trunk/octave-forge/extra/lssa/data/ch4.csv trunk/octave-forge/extra/lssa/data/co2.csv trunk/octave-forge/extra/lssa/data/deut.csv trunk/octave-forge/extra/lssa/data/dust.csv trunk/octave-forge/extra/lssa/data/o18.csv trunk/octave-forge/extra/lssa/inst/cubicwgt.m trunk/octave-forge/extra/lssa/inst/lombcoeff.m trunk/octave-forge/extra/lssa/inst/lombnormcoeff.m trunk/octave-forge/extra/lssa/inst/lscomplex.m trunk/octave-forge/extra/lssa/inst/lscomplexwavelet.m trunk/octave-forge/extra/lssa/inst/lscorrcoeff.m trunk/octave-forge/extra/lssa/inst/lsreal.m trunk/octave-forge/extra/lssa/inst/lswaveletcoeff.m trunk/octave-forge/extra/lssa/src/fastlscomplex.cc Modified: trunk/octave-forge/extra/lssa/INDEX =================================================================== --- trunk/octave-forge/extra/lssa/INDEX 2012-08-15 14:40:58 UTC (rev 10879) +++ trunk/octave-forge/extra/lssa/INDEX 2012-08-16 16:29:54 UTC (rev 10880) @@ -6,11 +6,9 @@ Accelerated time-series functions fastlscomplex Complex time-series functions - lscomplex fastlscomplex lswaveletcoeff -# lscomplexwavelet + lscomplex Real time-series functions lsreal -# lsrealwavelet Correlation lscorrcoeff Wavelet Transform Modified: trunk/octave-forge/extra/lssa/data/ch4.csv =================================================================== --- trunk/octave-forge/extra/lssa/data/ch4.csv 2012-08-15 14:40:58 UTC (rev 10879) +++ trunk/octave-forge/extra/lssa/data/ch4.csv 2012-08-16 16:29:54 UTC (rev 10880) @@ -1,459 +1,458 @@ -"","Depth.corrected","Ice.age..GT4.","Gas.age","CH4..ppbv." -"1",149.2,5683,2347,668 -"2",173.1,6828,3634,636 -"3",177.4,7043,3833,595 -"4",228.7,9528,6225,588 -"5",236.4,9901,6614,574 -"6",266,11334,8113,616 -"7",303.8,13526,10189,667 -"8",321.2,14538,11013,621 -"9",325,14775,11143,511 -"10",331.7,15215,11329,477 -"11",342.1,15922,11719,501 -"12",356,16974,12626,662 -"13",365.6,17755,13412,610 -"14",366.2,17803,13457,642 -"15",381.7,19089,14241,445 -"16",426.3,22829,16417,395 -"17",443.5,24315,17695,363 -"18",458.3,25557,18950,349 -"19",471,26595,20004,379 -"20",491.3,28356,21636,348 -"21",506.4,29630,22977,406 -"22",507.4,29716,23059,339 -"23",510.2,29967,23392,371 -"24",513.6,30250,23714,377 -"25",517.6,30591,24146,403 -"26",519.7,30761,24327,403 -"27",522.5,30998,24643,340 -"28",522.6,31011,24654,360 -"29",522.7,31020,24662,381 -"30",525.6,31266,24875,358 -"31",528.2,31487,25073,392 -"32",532.2,31828,25423,377 -"33",532.4,31845,25440,381 -"34",532.4,31845,25440,379 -"35",535,32058,25684,360 -"36",540,32465,25999,363 -"37",541.5,32583,26099,382 -"38",541.5,32583,26099,386 -"39",545.2,32887,26336,387 -"40",547,33042,26471,412 -"41",549.4,33240,26672,426 -"42",552,33461,26884,418 -"43",554.2,33646,27064,448 -"44",556.5,33833,27342,464 -"45",560.2,34136,27702,435 -"46",562.5,34318,27951,416 -"47",563.1,34371,28016,403 -"48",565.2,34530,28195,382 -"49",569.2,34832,28551,396 -"50",571.4,34985,28743,425 -"51",574.3,35210,28943,435 -"52",577.8,35464,29130,436 -"53",581.8,35766,29410,421 -"54",582.8,35839,29493,416 -"55",583.3,35876,29542,429 -"56",589.2,36346,30175,481 -"57",591.7,36558,30385,489 -"58",593.8,36729,30591,482 -"59",599.1,37157,31088,394 -"60",602.6,37444,31479,429 -"61",609.7,38013,32176,469 -"62",612,38203,32384,505 -"63",615.5,38491,32715,548 -"64",617.7,38678,32952,532 -"65",619.5,38826,33161,520 -"66",622.2,39039,33474,530 -"67",625.1,39268,33823,509 -"68",627.6,39464,34108,500 -"69",627.6,39464,34108,483 -"70",629.2,39593,34285,484 -"71",633.4,39917,34644,418 -"72",635.1,40060,34784,403 -"73",639.5,40424,35038,459 -"74",641.3,40573,35163,414 -"75",644.6,40841,35387,375 -"76",648,41112,35573,423 -"77",649.2,41209,35645,443 -"78",653.8,41551,35883,431 -"79",664.1,42305,36641,484 -"80",682,43702,38109,520 -"81",683,43785,38201,493 -"82",694.6,44764,39388,424 -"83",699.5,45181,39828,448 -"84",706.1,45770,40626,537 -"85",712.9,46360,41358,522 -"86",724.8,47360,42131,441 -"87",748.3,49296,43546,419 -"88",765.3,50634,44788,402 -"89",788.2,52446,47024,466 -"90",812,54457,49398,504 -"91",834.8,56300,51174,480 -"92",860.6,58258,52870,514 -"93",885.3,60288,55564,528 -"94",911.4,62633,57737,442 -"95",937.3,65016,59604,411 -"96",962.4,67405,61582,414 -"97",986.3,69627,63694,415 -"98",1011.3,71767,65701,434 -"99",1037.5,74017,68495,424 -"100",1062.2,76023,71014,458 -"101",1087.2,78042,72849,430 -"102",1112.6,80064,75367,462 -"103",1137.7,81921,76875,402 -"104",1162.1,83615,78995,438 -"105",1186.5,85262,81122,497 -"106",1209.7,86826,82843,545 -"107",1237.2,88808,84929,594 -"108",1261.2,90609,86323,529 -"109",1289.2,92632,88051,425 -"110",1309.2,94039,89363,417 -"111",1338.2,96047,91691,454 -"112",1363.7,97841,93660,443 -"113",1387.2,99498,95349,406 -"114",1413,101234,96900,407 -"115",1442.8,103125,99067,476 -"116",1451.4,103726,99833,480 -"117",1463.3,104574,100842,521 -"118",1476.1,105492,101829,493 -"119",1505,107599,103372,559 -"120",1526.2,109395,105204,591 -"121",1532,109872,105675,564 -"122",1542.1,110674,106203,437 -"123",1557.4,111923,107007,451 -"124",1582.8,113952,108994,468 -"125",1614.8,116215,111442,448 -"126",1627.7,117059,112559,443 -"127",1630.3,117221,112793,463 -"128",1637.7,117677,113479,505 -"129",1638.8,117747,113574,483 -"130",1643.4,118037,114031,497 -"131",1649,118376,114508,511 -"132",1654.5,118705,115060,485 -"133",1658.6,118958,115401,503 -"134",1664.5,119314,115768,520 -"135",1667.6,119504,116037,550 -"136",1669.5,119620,116200,531 -"137",1671.3,119728,116353,548 -"138",1674.2,119907,116605,575 -"139",1680,120259,117052,541 -"140",1684.5,120528,117342,555 -"141",1686.2,120623,117446,572 -"142",1688.4,120749,117589,590 -"143",1694,121079,117964,560 -"144",1694.6,121116,118010,573 -"145",1697.7,121296,118205,575 -"146",1704.7,121710,118631,563 -"147",1708.8,121941,118853,559 -"148",1714.2,122245,119164,589 -"149",1716,122345,119273,573 -"150",1719.4,122538,119499,584 -"151",1722.6,122718,119704,591 -"152",1731.2,123222,120320,603 -"153",1735.2,123443,120571,601 -"154",1736.8,123535,120652,578 -"155",1739,123658,120765,606 -"156",1744.3,123953,121090,592 -"157",1751.5,124348,121561,598 -"158",1754.3,124505,121752,594 -"159",1759.4,124787,122020,618 -"160",1765.5,125136,122367,592 -"161",1768.5,125298,122528,594 -"162",1770,125380,122606,600 -"163",1775.7,125692,122968,598 -"164",1780,125933,123279,604 -"165",1783.1,126109,123445,601 -"166",1786.8,126316,123677,622 -"167",1789.2,126447,123815,602 -"168",1789.4,126458,123826,630 -"169",1794.2,126710,124077,618 -"170",1797.8,126893,124244,619 -"171",1804.5,127236,124597,610 -"172",1814.8,127750,125176,649 -"173",1818.4,127930,125354,645 -"174",1819.6,127992,125424,623 -"175",1820.4,128032,125468,677 -"176",1824.6,128239,125679,672 -"177",1831,128549,126093,633 -"178",1832.3,128614,126200,644 -"179",1834.2,128712,126343,644 -"180",1834.7,128738,126380,636 -"181",1838.5,128932,126652,632 -"182",1844.8,129266,127008,638 -"183",1848.4,129450,127214,655 -"184",1852.3,129669,127440,666 -"185",1853.9,129752,127526,683 -"186",1857.4,129937,127716,653 -"187",1860.6,130111,127890,687 -"188",1863.8,130286,128080,708 -"189",1869.4,130605,128364,710 -"190",1870.2,130653,128399,699 -"191",1874.4,130904,128576,700 -"192",1875.5,130973,128632,704 -"193",1878.8,131178,128812,676 -"194",1883.3,131459,129062,552 -"195",1884.2,131519,129125,565 -"196",1888.6,131813,129348,540 -"197",1893.4,132149,129675,560 -"198",1897.9,132470,129898,524 -"199",1903.6,132880,130172,542 -"200",1910.9,133444,130549,492 -"201",1921.5,134310,131146,477 -"202",1922.3,134383,131195,491 -"203",1932.1,135318,131795,453 -"204",1954.6,137611,133340,431 -"205",1969.9,139296,134211,399 -"206",1980.2,140452,135003,352 -"207",1987.4,141257,135683,357 -"208",1994.7,142075,136367,374 -"209",1998,142440,136659,377 -"210",2005.9,143326,137393,348 -"211",2009.4,143720,137686,339 -"212",2016.4,144496,138408,318 -"213",2030.9,146122,140072,319 -"214",2042.5,147403,141422,345 -"215",2063.7,149756,143980,355 -"216",2088.6,152467,146784,356 -"217",2102.4,154026,148566,400 -"218",2109,154786,149406,418 -"219",2116,155625,150303,410 -"220",2119,155987,150633,376 -"221",2127.2,156981,151441,395 -"222",2137.1,158157,152562,445 -"223",2143,158819,153173,414 -"224",2153.4,159908,154129,382 -"225",2164,161077,155299,377 -"226",2167.2,161450,155706,406 -"227",2177.3,162574,157299,403 -"228",2180.4,162912,157806,381 -"229",2196.4,164820,159791,376 -"230",2225,168391,162996,405 -"231",2247,170922,165278,420 -"232",2273,174105,169266,478 -"233",2302,177644,172596,456 -"234",2312.3,179000,174189,402 -"235",2325,180546,175440,468 -"236",2348,183525,178550,503 -"237",2363,185640,180779,522 -"238",2373,187067,181718,464 -"239",2386,188892,183355,470 -"240",2399,190587,185063,510 -"241",2414,192382,187199,445 -"242",2425,193816,189335,440 -"243",2437,195298,191057,414 -"244",2475,199904,195625,460 -"245",2501,202717,199292,558 -"246",2525,205458,202212,612 -"247",2543,207803,204283,482 -"248",2552,208947,205148,425 -"249",2554.9,209310,205439,421 -"250",2557.7,209648,205715,413 -"251",2560.9,210056,206122,436 -"252",2564.9,210526,206675,466 -"253",2567.5,210840,207033,463 -"254",2570.4,211178,207418,455 -"255",2574.2,211628,207991,496 -"256",2575.5,211784,208183,475 -"257",2579.9,212295,208796,476 -"258",2581.9,212531,209078,485 -"259",2584.7,212846,209414,515 -"260",2588.5,213282,209975,473 -"261",2590.4,213503,210237,498 -"262",2595.1,214036,210830,567 -"263",2596.7,214219,211005,503 -"264",2600.4,214642,211481,509 -"265",2603.7,215011,211929,586 -"266",2606.6,215343,212281,551 -"267",2609.7,215685,212662,554 -"268",2612.5,216019,213010,545 -"269",2615.5,216377,213385,569 -"270",2621.7,217099,214153,581 -"271",2629,217944,214996,558 -"272",2633.5,218492,215504,568 -"273",2636.7,218908,215879,586 -"274",2639.5,219276,216310,544 -"275",2643.7,219835,216923,557 -"276",2646.4,220230,217253,541 -"277",2649.4,220678,217577,483 -"278",2656.2,221718,218342,440 -"279",2659.5,222273,218767,436 -"280",2666.7,223548,219680,476 -"281",2669.4,224060,220047,473 -"282",2674.6,224993,220760,498 -"283",2676.9,225380,220997,480 -"284",2682.6,226339,221612,482 -"285",2691,227885,222958,494 -"286",2693.6,228349,223446,532 -"287",2698,229167,224630,532 -"288",2700.5,229641,225136,512 -"289",2702.9,230076,225535,506 -"290",2705.6,230547,225888,497 -"291",2707.9,230945,226213,483 -"292",2711.8,231619,226726,484 -"293",2714.7,232092,227224,476 -"294",2717.7,232571,227840,445 -"295",2732.5,234771,230668,439 -"296",2735.7,235233,231383,460 -"297",2738.7,235652,231990,495 -"298",2741.9,236109,232615,502 -"299",2744.8,236498,233139,514 -"300",2747.6,236866,233646,541 -"301",2751.1,237301,234126,540 -"302",2753.6,237602,234470,550 -"303",2756.2,237889,234781,540 -"304",2759.2,238213,235222,554 -"305",2765.2,238907,236234,582 -"306",2771.2,239672,237466,619 -"307",2773.5,240010,237834,631 -"308",2776.5,240465,238199,650 -"309",2780,241055,238623,500 -"310",2782.8,241549,238943,554 -"311",2785.5,242091,239249,538 -"312",2788.5,242675,239545,522 -"313",2794.6,243821,240205,498 -"314",2797.5,244444,240576,484 -"315",2800.5,245091,240966,470 -"316",2806.5,246378,242067,509 -"317",2815.6,248369,243657,402 -"318",2818.5,249027,244198,437 -"319",2821.5,249668,244861,401 -"320",2824.5,250307,245481,380 -"321",2830.4,251542,246709,405 -"322",2833.8,252268,247436,399 -"323",2836.5,252876,248083,424 -"324",2839.5,253557,248977,447 -"325",2842.4,254218,249751,465 -"326",2845.5,254871,250460,467 -"327",2851.5,256180,251519,421 -"328",2854.4,256860,252183,410 -"329",2857.5,257602,252957,511 -"330",2860.5,258358,253889,486 -"331",2866.5,259879,255230,398 -"332",2870.4,260916,256038,408 -"333",2872.7,261510,256489,385 -"334",2876.2,262453,257245,402 -"335",2881.5,263865,258495,457 -"336",2884.5,264663,259226,445 -"337",2887.5,265454,259956,426 -"338",2890.5,266260,260759,448 -"339",2893.5,267040,261596,454 -"340",2896.4,267804,262388,448 -"341",2899.5,268556,263204,441 -"342",2902.5,269304,264042,442 -"343",2905.5,270050,264831,443 -"344",2911.4,271448,266485,417 -"345",2914.5,272177,267443,453 -"346",2917.5,272836,268273,429 -"347",2919.4,273254,268677,441 -"348",2926.5,274800,270677,484 -"349",2935.5,276729,273010,472 -"350",2941.5,278016,274443,508 -"351",2944.5,278704,275209,516 -"352",2951.2,280356,276867,522 -"353",2956.5,281738,277924,430 -"354",2964.5,283807,279541,430 -"355",2973.9,286496,282325,507 -"356",2979.5,288010,283491,464 -"357",2988.6,290551,286214,482 -"358",2994.5,292129,287852,522 -"359",2997.5,292853,288492,454 -"360",3000.4,293619,289444,433 -"361",3003.5,294493,290568,438 -"362",3009.5,296156,292472,475 -"363",3015.6,297835,293700,429 -"364",3018.5,298620,294611,468 -"365",3021.5,299407,295514,464 -"366",3027.7,300970,297181,460 -"367",3030.4,301671,298058,487 -"368",3033.5,302450,299016,486 -"369",3036.5,303199,299875,511 -"370",3039.5,303931,300639,545 -"371",3042.5,304738,301489,539 -"372",3045.5,305609,302452,603 -"373",3048.5,306552,303328,568 -"374",3051.5,307461,303951,588 -"375",3054.5,308352,304584,435 -"376",3057.7,309277,305303,443 -"377",3060.5,310076,306088,457 -"378",3063.5,310900,307124,478 -"379",3066.5,311701,308097,478 -"380",3072.5,313289,310035,488 -"381",3075.6,314077,310980,522 -"382",3078.5,314816,311769,570 -"383",3081.6,315590,312666,561 -"384",3084.6,316319,313510,589 -"385",3087.8,317098,314366,624 -"386",3090.5,317773,315139,620 -"387",3093.5,318507,315937,621 -"388",3096.4,319224,316674,639 -"389",3099.5,319976,317442,627 -"390",3102.5,320731,318261,637 -"391",3105.5,321446,318978,639 -"392",3109.5,322330,319871,636 -"393",3111.5,322753,320388,604 -"394",3114.8,323439,321383,604 -"395",3117.5,324019,322109,647 -"396",3119.7,324496,322618,665 -"397",3120.6,324718,322833,731 -"398",3123.5,325403,323488,773 -"399",3126.5,326197,324186,575 -"400",3129.9,327237,324991,581 -"401",3132.4,328055,325525,588 -"402",3135.5,329132,326236,558 -"403",3138.5,330287,327121,537 -"404",3141.5,331496,328084,517 -"405",3145,333066,329234,471 -"406",3147.5,334351,330204,451 -"407",3153.5,337299,332289,458 -"408",3156.5,338745,333600,371 -"409",3159.5,340342,335404,383 -"410",3162.8,341844,336967,342 -"411",3165.5,343109,338273,369 -"412",3169,344841,340163,422 -"413",3171.5,346049,341572,397 -"414",3174.5,347584,342993,442 -"415",3177.8,349293,344729,406 -"416",3180.5,350757,346095,384 -"417",3183.4,352372,347604,398 -"418",3186.5,354121,349160,391 -"419",3189.5,355789,350759,386 -"420",3192.5,357445,352406,392 -"421",3195.7,359181,354326,384 -"422",3199,360896,356202,399 -"423",3200,361445,356838,399 -"424",3201.4,362204,357728,396 -"425",3204.7,363957,359682,454 -"426",3207.5,365473,361167,422 -"427",3210.6,367094,362814,386 -"428",3213.7,368664,364471,397 -"429",3216.5,370069,366191,432 -"430",3219.5,371827,368105,463 -"431",3222.5,373615,369552,517 -"432",3225.5,375314,370919,405 -"433",3228.9,377171,373007,432 -"434",3231.5,378475,374567,482 -"435",3237.5,381820,378183,521 -"436",3240.5,383388,379625,445 -"437",3243.5,384986,381612,516 -"438",3246.5,386818,383527,542 -"439",3249.5,388758,384910,578 -"440",3252.5,390609,386543,567 -"441",3255.5,392628,388652,544 -"442",3258.5,394611,390567,439 -"443",3261.5,396400,392427,448 -"444",3264.5,398086,394620,478 -"445",3267.5,399720,396698,550 -"446",3270.6,401444,398575,574 -"447",3273.8,403146,400362,566 -"448",3276.5,404597,401860,598 -"449",3280.5,406690,404164,600 -"450",3283.5,408217,405823,672 -"451",3286.5,409724,407442,634 -"452",3289.5,411177,408995,644 -"453",3292.8,412968,410793,623 -"454",3295.5,414399,412182,626 -"455",3299,416327,414080,653 -"456",3301.4,417656,415452,678 -"457",3304.4,419336,417173,695 -"458",NA,NA,NA,NA +149.2,5683,2347,668 +173.1,6828,3634,636 +177.4,7043,3833,595 +228.7,9528,6225,588 +236.4,9901,6614,574 +266,11334,8113,616 +303.8,13526,10189,667 +321.2,14538,11013,621 +325,14775,11143,511 +331.7,15215,11329,477 +342.1,15922,11719,501 +356,16974,12626,662 +365.6,17755,13412,610 +366.2,17803,13457,642 +381.7,19089,14241,445 +426.3,22829,16417,395 +443.5,24315,17695,363 +458.3,25557,18950,349 +471,26595,20004,379 +491.3,28356,21636,348 +506.4,29630,22977,406 +507.4,29716,23059,339 +510.2,29967,23392,371 +513.6,30250,23714,377 +517.6,30591,24146,403 +519.7,30761,24327,403 +522.5,30998,24643,340 +522.6,31011,24654,360 +522.7,31020,24662,381 +525.6,31266,24875,358 +528.2,31487,25073,392 +532.2,31828,25423,377 +532.4,31845,25440,381 +532.4,31845,25440,379 +535,32058,25684,360 +540,32465,25999,363 +541.5,32583,26099,382 +541.5,32583,26099,386 +545.2,32887,26336,387 +547,33042,26471,412 +549.4,33240,26672,426 +552,33461,26884,418 +554.2,33646,27064,448 +556.5,33833,27342,464 +560.2,34136,27702,435 +562.5,34318,27951,416 +563.1,34371,28016,403 +565.2,34530,28195,382 +569.2,34832,28551,396 +571.4,34985,28743,425 +574.3,35210,28943,435 +577.8,35464,29130,436 +581.8,35766,29410,421 +582.8,35839,29493,416 +583.3,35876,29542,429 +589.2,36346,30175,481 +591.7,36558,30385,489 +593.8,36729,30591,482 +599.1,37157,31088,394 +602.6,37444,31479,429 +609.7,38013,32176,469 +612,38203,32384,505 +615.5,38491,32715,548 +617.7,38678,32952,532 +619.5,38826,33161,520 +622.2,39039,33474,530 +625.1,39268,33823,509 +627.6,39464,34108,500 +627.6,39464,34108,483 +629.2,39593,34285,484 +633.4,39917,34644,418 +635.1,40060,34784,403 +639.5,40424,35038,459 +641.3,40573,35163,414 +644.6,40841,35387,375 +648,41112,35573,423 +649.2,41209,35645,443 +653.8,41551,35883,431 +664.1,42305,36641,484 +682,43702,38109,520 +683,43785,38201,493 +694.6,44764,39388,424 +699.5,45181,39828,448 +706.1,45770,40626,537 +712.9,46360,41358,522 +724.8,47360,42131,441 +748.3,49296,43546,419 +765.3,50634,44788,402 +788.2,52446,47024,466 +812,54457,49398,504 +834.8,56300,51174,480 +860.6,58258,52870,514 +885.3,60288,55564,528 +911.4,62633,57737,442 +937.3,65016,59604,411 +962.4,67405,61582,414 +986.3,69627,63694,415 +1011.3,71767,65701,434 +1037.5,74017,68495,424 +1062.2,76023,71014,458 +1087.2,78042,72849,430 +1112.6,80064,75367,462 +1137.7,81921,76875,402 +1162.1,83615,78995,438 +1186.5,85262,81122,497 +1209.7,86826,82843,545 +1237.2,88808,84929,594 +1261.2,90609,86323,529 +1289.2,92632,88051,425 +1309.2,94039,89363,417 +1338.2,96047,91691,454 +1363.7,97841,93660,443 +1387.2,99498,95349,406 +1413,101234,96900,407 +1442.8,103125,99067,476 +1451.4,103726,99833,480 +1463.3,104574,100842,521 +1476.1,105492,101829,493 +1505,107599,103372,559 +1526.2,109395,105204,591 +1532,109872,105675,564 +1542.1,110674,106203,437 +1557.4,111923,107007,451 +1582.8,113952,108994,468 +1614.8,116215,111442,448 +1627.7,117059,112559,443 +1630.3,117221,112793,463 +1637.7,117677,113479,505 +1638.8,117747,113574,483 +1643.4,118037,114031,497 +1649,118376,114508,511 +1654.5,118705,115060,485 +1658.6,118958,115401,503 +1664.5,119314,115768,520 +1667.6,119504,116037,550 +1669.5,119620,116200,531 +1671.3,119728,116353,548 +1674.2,119907,116605,575 +1680,120259,117052,541 +1684.5,120528,117342,555 +1686.2,120623,117446,572 +1688.4,120749,117589,590 +1694,121079,117964,560 +1694.6,121116,118010,573 +1697.7,121296,118205,575 +1704.7,121710,118631,563 +1708.8,121941,118853,559 +1714.2,122245,119164,589 +1716,122345,119273,573 +1719.4,122538,119499,584 +1722.6,122718,119704,591 +1731.2,123222,120320,603 +1735.2,123443,120571,601 +1736.8,123535,120652,578 +1739,123658,120765,606 +1744.3,123953,121090,592 +1751.5,124348,121561,598 +1754.3,124505,121752,594 +1759.4,124787,122020,618 +1765.5,125136,122367,592 +1768.5,125298,122528,594 +1770,125380,122606,600 +1775.7,125692,122968,598 +1780,125933,123279,604 +1783.1,126109,123445,601 +1786.8,126316,123677,622 +1789.2,126447,123815,602 +1789.4,126458,123826,630 +1794.2,126710,124077,618 +1797.8,126893,124244,619 +1804.5,127236,124597,610 +1814.8,127750,125176,649 +1818.4,127930,125354,645 +1819.6,127992,125424,623 +1820.4,128032,125468,677 +1824.6,128239,125679,672 +1831,128549,126093,633 +1832.3,128614,126200,644 +1834.2,128712,126343,644 +1834.7,128738,126380,636 +1838.5,128932,126652,632 +1844.8,129266,127008,638 +1848.4,129450,127214,655 +1852.3,129669,127440,666 +1853.9,129752,127526,683 +1857.4,129937,127716,653 +1860.6,130111,127890,687 +1863.8,130286,128080,708 +1869.4,130605,128364,710 +1870.2,130653,128399,699 +1874.4,130904,128576,700 +1875.5,130973,128632,704 +1878.8,131178,128812,676 +1883.3,131459,129062,552 +1884.2,131519,129125,565 +1888.6,131813,129348,540 +1893.4,132149,129675,560 +1897.9,132470,129898,524 +1903.6,132880,130172,542 +1910.9,133444,130549,492 +1921.5,134310,131146,477 +1922.3,134383,131195,491 +1932.1,135318,131795,453 +1954.6,137611,133340,431 +1969.9,139296,134211,399 +1980.2,140452,135003,352 +1987.4,141257,135683,357 +1994.7,142075,136367,374 +1998,142440,136659,377 +2005.9,143326,137393,348 +2009.4,143720,137686,339 +2016.4,144496,138408,318 +2030.9,146122,140072,319 +2042.5,147403,141422,345 +2063.7,149756,143980,355 +2088.6,152467,146784,356 +2102.4,154026,148566,400 +2109,154786,149406,418 +2116,155625,150303,410 +2119,155987,150633,376 +2127.2,156981,151441,395 +2137.1,158157,152562,445 +2143,158819,153173,414 +2153.4,159908,154129,382 +2164,161077,155299,377 +2167.2,161450,155706,406 +2177.3,162574,157299,403 +2180.4,162912,157806,381 +2196.4,164820,159791,376 +2225,168391,162996,405 +2247,170922,165278,420 +2273,174105,169266,478 +2302,177644,172596,456 +2312.3,179000,174189,402 +2325,180546,175440,468 +2348,183525,178550,503 +2363,185640,180779,522 +2373,187067,181718,464 +2386,188892,183355,470 +2399,190587,185063,510 +2414,192382,187199,445 +2425,193816,189335,440 +2437,195298,191057,414 +2475,199904,195625,460 +2501,202717,199292,558 +2525,205458,202212,612 +2543,207803,204283,482 +2552,208947,205148,425 +2554.9,209310,205439,421 +2557.7,209648,205715,413 +2560.9,210056,206122,436 +2564.9,210526,206675,466 +2567.5,210840,207033,463 +2570.4,211178,207418,455 +2574.2,211628,207991,496 +2575.5,211784,208183,475 +2579.9,212295,208796,476 +2581.9,212531,209078,485 +2584.7,212846,209414,515 +2588.5,213282,209975,473 +2590.4,213503,210237,498 +2595.1,214036,210830,567 +2596.7,214219,211005,503 +2600.4,214642,211481,509 +2603.7,215011,211929,586 +2606.6,215343,212281,551 +2609.7,215685,212662,554 +2612.5,216019,213010,545 +2615.5,216377,213385,569 +2621.7,217099,214153,581 +2629,217944,214996,558 +2633.5,218492,215504,568 +2636.7,218908,215879,586 +2639.5,219276,216310,544 +2643.7,219835,216923,557 +2646.4,220230,217253,541 +2649.4,220678,217577,483 +2656.2,221718,218342,440 +2659.5,222273,218767,436 +2666.7,223548,219680,476 +2669.4,224060,220047,473 +2674.6,224993,220760,498 +2676.9,225380,220997,480 +2682.6,226339,221612,482 +2691,227885,222958,494 +2693.6,228349,223446,532 +2698,229167,224630,532 +2700.5,229641,225136,512 +2702.9,230076,225535,506 +2705.6,230547,225888,497 +2707.9,230945,226213,483 +2711.8,231619,226726,484 +2714.7,232092,227224,476 +2717.7,232571,227840,445 +2732.5,234771,230668,439 +2735.7,235233,231383,460 +2738.7,235652,231990,495 +2741.9,236109,232615,502 +2744.8,236498,233139,514 +2747.6,236866,233646,541 +2751.1,237301,234126,540 +2753.6,237602,234470,550 +2756.2,237889,234781,540 +2759.2,238213,235222,554 +2765.2,238907,236234,582 +2771.2,239672,237466,619 +2773.5,240010,237834,631 +2776.5,240465,238199,650 +2780,241055,238623,500 +2782.8,241549,238943,554 +2785.5,242091,239249,538 +2788.5,242675,239545,522 +2794.6,243821,240205,498 +2797.5,244444,240576,484 +2800.5,245091,240966,470 +2806.5,246378,242067,509 +2815.6,248369,243657,402 +2818.5,249027,244198,437 +2821.5,249668,244861,401 +2824.5,250307,245481,380 +2830.4,251542,246709,405 +2833.8,252268,247436,399 +2836.5,252876,248083,424 +2839.5,253557,248977,447 +2842.4,254218,249751,465 +2845.5,254871,250460,467 +2851.5,256180,251519,421 +2854.4,256860,252183,410 +2857.5,257602,252957,511 +2860.5,258358,253889,486 +2866.5,259879,255230,398 +2870.4,260916,256038,408 +2872.7,261510,256489,385 +2876.2,262453,257245,402 +2881.5,263865,258495,457 +2884.5,264663,259226,445 +2887.5,265454,259956,426 +2890.5,266260,260759,448 +2893.5,267040,261596,454 +2896.4,267804,262388,448 +2899.5,268556,263204,441 +2902.5,269304,264042,442 +2905.5,270050,264831,443 +2911.4,271448,266485,417 +2914.5,272177,267443,453 +2917.5,272836,268273,429 +2919.4,273254,268677,441 +2926.5,274800,270677,484 +2935.5,276729,273010,472 +2941.5,278016,274443,508 +2944.5,278704,275209,516 +2951.2,280356,276867,522 +2956.5,281738,277924,430 +2964.5,283807,279541,430 +2973.9,286496,282325,507 +2979.5,288010,283491,464 +2988.6,290551,286214,482 +2994.5,292129,287852,522 +2997.5,292853,288492,454 +3000.4,293619,289444,433 +3003.5,294493,290568,438 +3009.5,296156,292472,475 +3015.6,297835,293700,429 +3018.5,298620,294611,468 +3021.5,299407,295514,464 +3027.7,300970,297181,460 +3030.4,301671,298058,487 +3033.5,302450,299016,486 +3036.5,303199,299875,511 +3039.5,303931,300639,545 +3042.5,304738,301489,539 +3045.5,305609,302452,603 +3048.5,306552,303328,568 +3051.5,307461,303951,588 +3054.5,308352,304584,435 +3057.7,309277,305303,443 +3060.5,310076,306088,457 +3063.5,310900,307124,478 +3066.5,311701,308097,478 +3072.5,313289,310035,488 +3075.6,314077,310980,522 +3078.5,314816,311769,570 +3081.6,315590,312666,561 +3084.6,316319,313510,589 +3087.8,317098,314366,624 +3090.5,317773,315139,620 +3093.5,318507,315937,621 +3096.4,319224,316674,639 +3099.5,319976,317442,627 +3102.5,320731,318261,637 +3105.5,321446,318978,639 +3109.5,322330,319871,636 +3111.5,322753,320388,604 +3114.8,323439,321383,604 +3117.5,324019,322109,647 +3119.7,324496,322618,665 +3120.6,324718,322833,731 +3123.5,325403,323488,773 +3126.5,326197,324186,575 +3129.9,327237,324991,581 +3132.4,328055,325525,588 +3135.5,329132,326236,558 +3138.5,330287,327121,537 +3141.5,331496,328084,517 +3145,333066,329234,471 +3147.5,334351,330204,451 +3153.5,337299,332289,458 +3156.5,338745,333600,371 +3159.5,340342,335404,383 +3162.8,341844,336967,342 +3165.5,343109,338273,369 +3169,344841,340163,422 +3171.5,346049,341572,397 +3174.5,347584,342993,442 +3177.8,349293,344729,406 +3180.5,350757,346095,384 +3183.4,352372,347604,398 +3186.5,354121,349160,391 +3189.5,355789,350759,386 +3192.5,357445,352406,392 +3195.7,359181,354326,384 +3199,360896,356202,399 +3200,361445,356838,399 +3201.4,362204,357728,396 +3204.7,363957,359682,454 +3207.5,365473,361167,422 +3210.6,367094,362814,386 +3213.7,368664,364471,397 +3216.5,370069,366191,432 +3219.5,371827,368105,463 +3222.5,373615,369552,517 +3225.5,375314,370919,405 +3228.9,377171,373007,432 +3231.5,378475,374567,482 +3237.5,381820,378183,521 +3240.5,383388,379625,445 +3243.5,384986,381612,516 +3246.5,386818,383527,542 +3249.5,388758,384910,578 +3252.5,390609,386543,567 +3255.5,392628,388652,544 +3258.5,394611,390567,439 +3261.5,396400,392427,448 +3264.5,398086,394620,478 +3267.5,399720,396698,550 +3270.6,401444,398575,574 +3273.8,403146,400362,566 +3276.5,404597,401860,598 +3280.5,406690,404164,600 +3283.5,408217,405823,672 +3286.5,409724,407442,634 +3289.5,411177,408995,644 +3292.8,412968,410793,623 +3295.5,414399,412182,626 +3299,416327,414080,653 +3301.4,417656,415452,678 +3304.4,419336,417173,695 +0,0,0,0 Modified: trunk/octave-forge/extra/lssa/data/co2.csv =================================================================== --- trunk/octave-forge/extra/lssa/data/co2.csv 2012-08-15 14:40:58 UTC (rev 10879) +++ trunk/octave-forge/extra/lssa/data/co2.csv 2012-08-16 16:29:54 UTC (rev 10880) @@ -1,284 +1,283 @@ -"","Depth..corrected.","Ice.age..GT4.","Gas.age","CO2..ppmv." -"1",149.1,5679,2342,284.7 -"2",173.1,6828,3634,272.8 -"3",177.4,7043,3833,268.1 -"4",228.6,9523,6220,262.2 -"5",250.3,10579,7327,254.6 -"6",266,11334,8113,259.6 -"7",302.6,13449,10123,261.6 -"8",321.2,14538,11013,263.7 -"9",331.6,15208,11326,244.8 -"10",342.1,15922,11719,238.3 -"11",365.5,17747,13405,236.2 -"12",375.6,18580,13989,225.3 -"13",443.5,24315,17695,182.2 -"14",470.8,26578,19988,189.2 -"15",506.4,29630,22977,191.6 -"16",544.7,32844,26303,188.5 -"17",554.2,33645,27062,191.7 -"18",602.3,37421,31447,205.4 -"19",625.6,39310,33884,209.1 -"20",700.2,45242,39880,209.1 -"21",765,50610,44766,189.3 -"22",788.2,52446,47024,188.4 -"23",800,53436,48229,210.1 -"24",812.2,54474,49414,215.7 -"25",834.8,56300,51174,190.4 -"26",902.2,61783,57068,221.8 -"27",912,62689,57799,210.4 -"28",986.2,69618,63687,195.4 -"29",1011.3,71767,65701,191.4 -"30",1023.5,72797,66883,195 -"31",1087.2,78042,72849,227.4 -"32",1112.5,80057,75360,229.2 -"33",1162.1,83615,78995,217.1 -"34",1175,84515,80059,221.8 -"35",1209.9,86840,82858,231 -"36",1237.2,88808,84929,241.1 -"37",1251.5,89864,85727,236.4 -"38",1261.2,90609,86323,228.1 -"39",1274.2,91560,87180,214.2 -"40",1289.2,92632,88051,217 -"41",1309.2,94039,89363,208 -"42",1338.2,96047,91691,224.3 -"43",1349,96791,92460,228.4 -"44",1387.2,99498,95349,232.1 -"45",1451.5,103733,99842,225.9 -"46",1463.2,104566,100833,230.9 -"47",1476.1,105492,101829,236.9 -"48",1505,107599,103372,228.2 -"49",1526.3,109404,105213,236.9 -"50",1542.1,110674,106203,230.7 -"51",1575.2,113363,108308,238.2 -"52",1582.8,113952,108994,245.7 -"53",1598,115077,110253,251.3 -"54",1615,116228,111456,256.8 -"55",1627.9,117072,112577,266.3 -"56",1637.6,117671,113472,261.4 -"57",1644,118074,114082,274.6 -"58",1651,118499,114738,273.3 -"59",1669.2,119601,116175,262.5 -"60",1687.2,120680,117519,267.6 -"61",1700.9,121485,118396,273.8 -"62",1716,122345,119273,272 -"63",1726.8,122965,120002,265.2 -"64",1736.8,123535,120652,277.7 -"65",1758.2,124721,121961,272.2 -"66",1770,125380,122606,276.5 -"67",1789.2,126447,123815,268.7 -"68",1790,126491,123858,266.6 -"69",1799,126955,124306,266.3 -"70",1804,127210,124571,279.8 -"71",1810,127510,124876,277.2 -"72",1825.7,128293,125746,273.8 -"73",1830,128501,126023,267.1 -"74",1836,128804,126475,262.5 -"75",1841.6,129097,126809,262.6 -"76",1852.4,129674,127445,275.4 -"77",1869.3,130599,128300,274.1 -"78",1870.2,130653,128399,287.1 -"79",1875.9,130998,128652,286.8 -"80",1882.5,131406,129007,282.7 -"81",1890,131908,129411,264.1 -"82",1895,132264,129755,263.4 -"83",1903.5,132873,130167,259 -"84",1932,135308,131789,240.4 -"85",1954.5,137601,133334,224 -"86",1969.8,139285,134205,208.9 -"87",1980.2,140452,135003,204.6 -"88",1987.4,141257,135683,198.1 -"89",1990.6,141615,135976,201.8 -"90",1994.6,142064,136359,202.5 -"91",1998,142440,136659,195.9 -"92",2005.8,143315,137383,194.4 -"93",2009.5,143732,137694,193.4 -"94",2015,144346,138226,190.2 -"95",2025.7,145527,139445,192.3 -"96",2041.5,147292,141312,196.5 -"97",2050.3,148287,142357,190.4 -"98",2077.5,151234,145435,197 -"99",2116,155625,150303,191.9 -"100",2157,160293,154471,189 -"101",2164,161077,155299,185.5 -"102",2203,165646,160494,204.4 -"103",2225,168391,162996,191.6 -"104",2247,170922,165278,183.8 -"105",2280,174920,169870,197.9 -"106",2302,177644,172596,197.8 -"107",2325,180546,175440,190.3 -"108",2333,181502,176271,190.1 -"109",2348,183525,178550,207.7 -"110",2363,185640,180779,213.2 -"111",2372,186927,181617,217.7 -"112",2386,188892,183355,199.8 -"113",2399,190587,185063,203.5 -"114",2414,192382,187199,210.7 -"115",2425,193816,189335,231.4 -"116",2437,195298,191057,231.5 -"117",2451,197086,192632,218 -"118",2475,199904,195625,220.1 -"119",2499,202496,199025,242.6 -"120",2525,205458,202212,251 -"121",2533,206496,203191,239.1 -"122",2543,207803,204283,247.7 -"123",2552.01,208947,205148,244.4 -"124",2557.71,209648,205715,232.2 -"125",2560.91,210053,206119,228.7 -"126",2574.21,211628,207991,238.2 -"127",2584.71,212846,209414,242.2 -"128",2588.81,213315,210022,244.6 -"129",2595.11,214036,210830,247.3 -"130",2596.71,214219,211005,252 -"131",2606.61,215343,212281,257.4 -"132",2621.71,217099,214153,251.2 -"133",2629.41,217989,215041,241.4 -"134",2634.41,218602,215593,240.3 -"135",2636.71,218908,215879,242.7 -"136",2640.41,219393,216459,247.5 -"137",2644.41,219935,217009,251.7 -"138",2646.61,220255,217271,251.2 -"139",2650.41,220822,217676,245.4 -"140",2656.21,221718,218342,240.5 -"141",2666.71,223548,219680,212.2 -"142",2670.41,224240,220182,216.2 -"143",2674.61,224993,220760,207.2 -"144",2677.41,225469,221054,208.9 -"145",2682.61,226339,221612,205.7 -"146",2691.01,227885,222958,203.4 -"147",2693.61,228349,223446,215.7 -"148",2698.01,229167,224630,236.9 -"149",2701.41,229802,225299,234.5 -"150",2702.71,230039,225509,233.1 -"151",2705.61,230547,225888,224.5 -"152",2711.71,231601,226710,232.4 -"153",2715.41,232206,227384,233.9 -"154",2717.71,232571,227840,241.7 -"155",2732.71,234795,230703,245.2 -"156",2735.71,235232,231382,252.2 -"157",2738.71,235652,231990,241.4 -"158",2741.71,236077,232570,247.4 -"159",2744.61,236467,233102,243.1 -"160",2747.61,236866,233646,239.2 -"161",2751.11,237301,234126,245.7 -"162",2753.61,237602,234470,245.9 -"163",2756.21,237889,234781,247.4 -"164",2759.11,238206,235213,252.9 -"165",2765.21,238908,236236,259.8 -"166",2773.51,240006,237831,279 -"167",2782.71,241535,238935,263.8 -"168",2785.51,242092,239250,252.4 -"169",2788.51,242675,239545,249.9 -"170",2794.51,243813,240201,230.4 -"171",2797.51,244446,240577,219.4 -"172",2806.51,246379,242068,214.7 -"173",2815.61,248364,243653,200.2 -"174",2818.61,249046,244215,213.9 -"175",2821.51,249670,244863,195.4 -"176",2824.51,250309,245483,196.7 -"177",2833.81,252279,247447,199 -"178",2836.51,252879,248087,201.9 -"179",2839.51,253559,248980,204 -"180",2845.51,254873,250461,203.9 -"181",2851.51,256182,251521,209.7 -"182",2857.51,257604,252959,208.9 -"183",2860.51,258351,253880,214.7 -"184",2866.51,259882,255233,228.2 -"185",2870.51,260936,256053,199.9 -"186",2872.71,261526,256501,211.7 -"187",2876.21,262455,257247,188.7 -"188",2881.42,263844,258477,194.2 -"189",2884.51,264666,259228,198.9 -"190",2887.51,265457,259958,184.7 -"191",2890.51,266255,260754,190.4 -"192",2893.51,267039,261595,193.9 -"193",2896.51,267825,262411,194.2 -"194",2899.51,268558,263207,198.4 -"195",2902.51,269307,264046,193.2 -"196",2905.51,270052,264834,202.2 -"197",2911.46,271454,266492,211 -"198",2914.51,272171,267434,215.4 -"199",2919.41,273256,268679,223.7 -"200",2926.51,274802,270680,231.4 -"201",2935.51,276731,273012,226.4 -"202",2941.51,278017,274445,230.4 -"203",2944.51,278711,275218,231 -"204",2956.51,281740,277925,220.4 -"205",2959.51,282539,278602,217.2 -"206",2964.51,283810,279543,207.7 -"207",2973.81,286475,282301,212.7 -"208",2979.51,288013,283492,213.2 -"209",2988.61,290554,286217,224.4 -"210",2994.51,292121,287846,236.2 -"211",3003.51,294495,290571,240.2 -"212",3007.01,295477,291769,240.7 -"213",3009.51,296158,292474,250.2 -"214",3015.51,297810,293676,244.9 -"215",3018.51,298623,294615,225.9 -"216",3022.71,299716,295849,227.9 -"217",3027.51,300928,297131,233.2 -"218",3030.41,301665,298051,237.9 -"219",3033.51,302452,299020,239 -"220",3036.51,303201,299877,241.9 -"221",3039.51,303939,300646,251.7 -"222",3042.51,304745,301496,256.8 -"223",3045.51,305612,302456,257.2 -"224",3048.56,306561,303334,246.9 -"225",3051.51,307464,303953,272.7 -"226",3054.51,308358,304590,251.7 -"227",3057.71,309281,305306,244.7 -"228",3063.51,310905,307131,255.9 -"229",3066.51,311704,308101,249.2 -"230",3072.51,313292,310039,256.3 -"231",3075.41,314032,310930,260.4 -"232",3078.51,314822,311774,260.3 -"233",3084.51,316304,313493,266.3 -"234",3090.51,317775,315143,266.2 -"235",3093.51,318509,315940,270.2 -"236",3096.46,319231,316681,271.9 -"237",3099.51,319978,317445,275.2 -"238",3105.51,321448,318980,265 -"239",3109.01,322216,319754,271.8 -"240",3111.51,322746,320378,272.7 -"241",3114.81,323441,321386,273.2 -"242",3117.51,324021,322111,282.4 -"243",3119.51,324461,322582,289.2 -"244",3120.61,324711,322827,288.4 -"245",3123.51,325400,323485,298.7 -"246",3126.51,326200,324189,278.2 -"247",3129.91,327237,324991,285.8 -"248",3132.41,328058,325527,278.7 -"249",3135.51,329135,326239,270.5 -"250",3138.51,330278,327114,255.7 -"251",3141.51,331513,328097,241.9 -"252",3145.01,333111,329267,239.7 -"253",3147.51,334356,330208,234.2 -"254",3153.51,337304,332293,250.2 -"255",3156.51,338770,333627,200.7 -"256",3159.51,340242,335290,205.2 -"257",3162.81,341849,336972,204.9 -"258",3169.01,344844,340165,220.4 -"259",3174.51,347589,342998,221.2 -"260",3177.81,349298,344735,216.2 -"261",3183.41,352377,347610,209.2 -"262",3189.51,355795,350765,193 -"263",3192.51,357450,352412,186.2 -"264",3200.01,361445,356838,201.2 -"265",3204.71,363962,359688,206.4 -"266",3210.51,367048,362766,201.9 -"267",3216.45,370095,366221,214.7 -"268",3222.51,373629,369563,229.7 -"269",3228.91,377177,373014,227 -"270",3231.51,378469,374561,240 -"271",3237.51,381834,378194,246.9 -"272",3240.51,383395,379633,245.9 -"273",3249.51,388757,384909,264.7 -"274",3252.45,390641,386579,259.3 -"275",3258.51,394634,390589,255.2 -"276",3261.51,396423,392451,250.2 -"277",3264.51,398091,394628,266.3 -"278",3267.51,399733,396713,274.7 -"279",3273.81,403173,400390,278 -"280",3283.51,408236,405844,279.7 -"281",3289.45,411202,409022,283.7 -"282",3292.91,413010,410831,276.3 -"283",3299.01,416332,414085,285.5 +149.1,5679,2342,284.7 +173.1,6828,3634,272.8 +177.4,7043,3833,268.1 +228.6,9523,6220,262.2 +250.3,10579,7327,254.6 +266,11334,8113,259.6 +302.6,13449,10123,261.6 +321.2,14538,11013,263.7 +331.6,15208,11326,244.8 +342.1,15922,11719,238.3 +365.5,17747,13405,236.2 +375.6,18580,13989,225.3 +443.5,24315,17695,182.2 +470.8,26578,19988,189.2 +506.4,29630,22977,191.6 +544.7,32844,26303,188.5 +554.2,33645,27062,191.7 +602.3,37421,31447,205.4 +625.6,39310,33884,209.1 +700.2,45242,39880,209.1 +765,50610,44766,189.3 +788.2,52446,47024,188.4 +800,53436,48229,210.1 +812.2,54474,49414,215.7 +834.8,56300,51174,190.4 +902.2,61783,57068,221.8 +912,62689,57799,210.4 +986.2,69618,63687,195.4 +1011.3,71767,65701,191.4 +1023.5,72797,66883,195 +1087.2,78042,72849,227.4 +1112.5,80057,75360,229.2 +1162.1,83615,78995,217.1 +1175,84515,80059,221.8 +1209.9,86840,82858,231 +1237.2,88808,84929,241.1 +1251.5,89864,85727,236.4 +1261.2,90609,86323,228.1 +1274.2,91560,87180,214.2 +1289.2,92632,88051,217 +1309.2,94039,89363,208 +1338.2,96047,91691,224.3 +1349,96791,92460,228.4 +1387.2,99498,95349,232.1 +1451.5,103733,99842,225.9 +1463.2,104566,100833,230.9 +1476.1,105492,101829,236.9 +1505,107599,103372,228.2 +1526.3,109404,105213,236.9 +1542.1,110674,106203,230.7 +1575.2,113363,108308,238.2 +1582.8,113952,108994,245.7 +1598,115077,110253,251.3 +1615,116228,111456,256.8 +1627.9,117072,112577,266.3 +1637.6,117671,113472,261.4 +1644,118074,114082,274.6 +1651,118499,114738,273.3 +1669.2,119601,116175,262.5 +1687.2,120680,117519,267.6 +1700.9,121485,118396,273.8 +1716,122345,119273,272 +1726.8,122965,120002,265.2 +1736.8,123535,120652,277.7 +1758.2,124721,121961,272.2 +1770,125380,122606,276.5 +1789.2,126447,123815,268.7 +1790,126491,123858,266.6 +1799,126955,124306,266.3 +1804,127210,124571,279.8 +1810,127510,124876,277.2 +1825.7,128293,125746,273.8 +1830,128501,126023,267.1 +1836,128804,126475,262.5 +1841.6,129097,126809,262.6 +1852.4,129674,127445,275.4 +1869.3,130599,128300,274.1 +1870.2,130653,128399,287.1 +1875.9,130998,128652,286.8 +1882.5,131406,129007,282.7 +1890,131908,129411,264.1 +1895,132264,129755,263.4 +1903.5,132873,130167,259 +1932,135308,131789,240.4 +1954.5,137601,133334,224 +1969.8,139285,134205,208.9 +1980.2,140452,135003,204.6 +1987.4,141257,135683,198.1 +1990.6,141615,135976,201.8 +1994.6,142064,136359,202.5 +1998,142440,136659,195.9 +2005.8,143315,137383,194.4 +2009.5,143732,137694,193.4 +2015,144346,138226,190.2 +2025.7,145527,139445,192.3 +2041.5,147292,141312,196.5 +2050.3,148287,142357,190.4 +2077.5,151234,145435,197 +2116,155625,150303,191.9 +2157,160293,154471,189 +2164,161077,155299,185.5 +2203,165646,160494,204.4 +2225,168391,162996,191.6 +2247,170922,165278,183.8 +2280,174920,169870,197.9 +2302,177644,172596,197.8 +2325,180546,175440,190.3 +2333,181502,176271,190.1 +2348,183525,178550,207.7 +2363,185640,180779,213.2 +2372,186927,181617,217.7 +2386,188892,183355,199.8 +2399,190587,185063,203.5 +2414,192382,187199,210.7 +2425,193816,189335,231.4 +2437,195298,191057,231.5 +2451,197086,192632,218 +2475,199904,195625,220.1 +2499,202496,199025,242.6 +2525,205458,202212,251 +2533,206496,203191,239.1 +2543,207803,204283,247.7 +2552.01,208947,205148,244.4 +2557.71,209648,205715,232.2 +2560.91,210053,206119,228.7 +2574.21,211628,207991,238.2 +2584.71,212846,209414,242.2 +2588.81,213315,210022,244.6 +2595.11,214036,210830,247.3 +2596.71,214219,211005,252 +2606.61,215343,212281,257.4 +2621.71,217099,214153,251.2 +2629.41,217989,215041,241.4 +2634.41,218602,215593,240.3 +2636.71,218908,215879,242.7 +2640.41,219393,216459,247.5 +2644.41,219935,217009,251.7 +2646.61,220255,217271,251.2 +2650.41,220822,217676,245.4 +2656.21,221718,218342,240.5 +2666.71,223548,219680,212.2 +2670.41,224240,220182,216.2 +2674.61,224993,220760,207.2 +2677.41,225469,221054,208.9 +2682.61,226339,221612,205.7 +2691.01,227885,222958,203.4 +2693.61,228349,223446,215.7 +2698.01,229167,224630,236.9 +2701.41,229802,225299,234.5 +2702.71,230039,225509,233.1 +2705.61,230547,225888,224.5 +2711.71,231601,226710,232.4 +2715.41,232206,227384,233.9 +2717.71,232571,227840,241.7 +2732.71,234795,230703,245.2 +2735.71,235232,231382,252.2 +2738.71,235652,231990,241.4 +2741.71,236077,232570,247.4 +2744.61,236467,233102,243.1 +2747.61,236866,233646,239.2 +2751.11,237301,234126,245.7 +2753.61,237602,234470,245.9 +2756.21,237889,234781,247.4 +2759.11,238206,235213,252.9 +2765.21,238908,236236,259.8 +2773.51,240006,237831,279 +2782.71,241535,238935,263.8 +2785.51,242092,239250,252.4 +2788.51,242675,239545,249.9 +2794.51,243813,240201,230.4 +2797.51,244446,240577,219.4 +2806.51,246379,242068,214.7 +2815.61,248364,243653,200.2 +2818.61,249046,244215,213.9 +2821.51,249670,244863,195.4 +2824.51,250309,245483,196.7 +2833.81,252279,247447,199 +2836.51,252879,248087,201.9 +2839.51,253559,248980,204 +2845.51,254873,250461,203.9 +2851.51,256182,251521,209.7 +2857.51,257604,252959,208.9 +2860.51,258351,253880,214.7 +2866.51,259882,255233,228.2 +2870.51,260936,256053,199.9 +2872.71,261526,256501,211.7 +2876.21,262455,257247,188.7 +2881.42,263844,258477,194.2 +2884.51,264666,259228,198.9 +2887.51,265457,259958,184.7 +2890.51,266255,260754,190.4 +2893.51,267039,261595,193.9 +2896.51,267825,262411,194.2 +2899.51,268558,263207,198.4 +2902.51,269307,264046,193.2 +2905.51,270052,264834,202.2 +2911.46,271454,266492,211 +2914.51,272171,267434,215.4 +2919.41,273256,268679,223.7 +2926.51,274802,270680,231.4 +2935.51,276731,273012,226.4 +2941.51,278017,274445,230.4 +2944.51,278711,275218,231 +2956.51,281740,277925,220.4 +2959.51,282539,278602,217.2 +2964.51,283810,279543,207.7 +2973.81,286475,282301,212.7 +2979.51,288013,283492,213.2 +2988.61,290554,286217,224.4 +2994.51,292121,287846,236.2 +3003.51,294495,290571,240.2 +3007.01,295477,291769,240.7 +3009.51,296158,292474,250.2 +3015.51,297810,293676,244.9 +3018.51,298623,294615,225.9 +3022.71,299716,295849,227.9 +3027.51,300928,297131,233.2 +3030.41,301665,298051,237.9 +3033.51,302452,299020,239 +3036.51,303201,299877,241.9 +3039.51,303939,300646,251.7 +3042.51,304745,301496,256.8 +3045.51,305612,302456,257.2 +3048.56,306561,303334,246.9 +3051.51,307464,303953,272.7 +3054.51,308358,304590,251.7 +3057.71,309281,305306,244.7 +3063.51,310905,307131,255.9 +3066.51,311704,308101,249.2 +3072.51,313292,310039,256.3 +3075.41,314032,310930,260.4 +3078.51,314822,311774,260.3 +3084.51,316304,313493,266.3 +3090.51,317775,315143,266.2 +3093.51,318509,315940,270.2 +3096.46,319231,316681,271.9 +3099.51,319978,317445,275.2 +3105.51,321448,318980,265 +3109.01,322216,319754,271.8 +3111.51,322746,320378,272.7 +3114.81,323441,321386,273.2 +3117.51,324021,322111,282.4 +3119.51,324461,322582,289.2 +3120.61,324711,322827,288.4 +3123.51,325400,323485,298.7 +3126.51,326200,324189,278.2 +3129.91,327237,324991,285.8 +3132.41,328058,325527,278.7 +3135.51,329135,326239,270.5 +3138.51,330278,327114,255.7 +3141.51,331513,328097,241.9 +3145.01,333111,329267,239.7 +3147.51,334356,330208,234.2 +3153.51,337304,332293,250.2 +3156.51,338770,333627,200.7 +3159.51,340242,335290,205.2 +3162.81,341849,336972,204.9 +3169.01,344844,340165,220.4 +3174.51,347589,342998,221.2 +3177.81,349298,344735,216.2 +3183.41,352377,347610,209.2 +3189.51,355795,350765,193 +3192.51,357450,352412,186.2 +3200.01,361445,356838,201.2 +3204.71,363962,359688,206.4 +3210.51,367048,362766,201.9 +3216.45,370095,366221,214.7 +3222.51,373629,369563,229.7 +3228.91,377177,373014,227 +3231.51,378469,374561,240 +3237.51,381834,378194,246.9 +3240.51,383395,379633,245.9 +3249.51,388757,384909,264.7 +3252.45,390641,386579,259.3 +3258.51,394634,390589,255.2 +3261.51,396423,392451,250.2 +3264.51,398091,394628,266.3 +3267.51,399733,396713,274.7 +3273.81,403173,400390,278 +3283.51,408236,405844,279.7 +3289.45,411202,409022,283.7 +3292.91,413010,410831,276.3 +3299.01,416332,414085,285.5 Modified: trunk/octave-forge/extra/lssa/data/deut.csv =================================================================== --- trunk/octave-forge/extra/lssa/data/deut.csv 2012-08-15 14:40:58 UTC (rev 10879) +++ trunk/octave-forge/extra/lssa/data/deut.csv 2012-08-16 16:29:54 UTC (rev 10880) @@ -1,3312 +1,3311 @@ -"","Depth.corrected","Ice.age..GT4.","deut","deltaTS" -"1",0,0,-438,0 -"2",1,17,-438,0 -"3",2,35,-438,0 -"4",3,53,-438,0 -"5",4,72,-438,0 -"6",5,91,-438,0 -"7",6,110,-438,0 -"8",7,129,-438,0 -"9",8,149,-442.9,-0.81 -"10",9,170,-437.9,0.02 -"11",10,190,-435.8,0.36 -"12",11,211,-443.7,-0.95 -"13",12,234,-449.1,-1.84 -"14",13,258,-444.6,-1.09 -"15",14,281,-442.5,-0.75 -"16",15,304,-439.3,-0.22 -"17",16,327,-440.9,-0.48 -"18",17,351,-442.5,-0.75 -"19",18,375,-436.6,0.23 -"20",19,397,-430,1.33 -"21",20,420,-435.9,0.35 -"22",21,444,-436.9,0.18 -"23",22,469,-438.5,-0.08 -"24",23,495,-444.5,-1.08 -"25",24,523,-446.4,-1.39 -"26",25,552,-447.7,-1.61 -"27",26,581,-443.4,-0.9 -"28",27,609,-441.6,-0.6 -"29",28,637,-438.1,-0.02 -"30",29,665,-439.1,-0.18 -"31",30,695,-445.4,-1.23 -"32",31,726,-447.3,-1.54 -"33",32,757,-443.1,-0.85 -"34",33,788,-438.6,-0.1 -"35",34,817,-439,-0.17 -"36",35,848,-442.7,-0.78 -"37",36,881,-442.7,-0.78 -"38",37,912,-439,-0.17 -"39",38,944,-439.5,-0.25 -"40",39,976,-439.7,-0.28 -"41",40,1009,-442.9,-0.81 -"42",41,1042,-438.3,-0.05 -"43",42,1074,-436.4,0.27 -"44",43,1107,-443,-0.83 -"45",44,1142,-441.9,-0.65 -"46",45,1176,-439.6,-0.27 -"47",46,1211,-441.9,-0.65 -"48",47,1247,-446.9,-1.48 -"49",48,1285,-447.9,-1.64 -"50",49,1321,-440.4,-0.4 -"51",50,1356,-436,0.33 -"52",51,1390,-438.3,-0.05 -"53",52,1426,-438.8,-0.13 -"54",53,1461,-438.2,-0.03 -"55",54,1497,-440.8,-0.46 -"56",55,1535,-444,-1 -"57",56,1573,-443.8,-0.96 -"58",57,1612,-446,-1.33 -"59",58,1652,-447.1,-1.51 -"60",59,1692,-443.3,-0.88 -"61",60,1732,-444.4,-1.06 -"62",61,1772,-445.3,-1.21 -"63",62,1812,-445.5,-1.24 -"64",63,1853,-443.8,-0.96 -"65",64,1893,-441.2,-0.53 -"66",65,1931,-437.1,0.15 -"67",66,1970,-439.7,-0.28 -"68",67,2009,-440.7,-0.45 -"69",68,2049,-440.3,-0.38 -"70",69,2089,-441.2,-0.53 -"71",70,2129,-441.7,-0.61 -"72",71,2171,-443.7,-0.95 -"73",72,2212,-442.4,-0.73 -"74",73,2253,-437.3,0.12 -"75",74,2291,-431,1.16 -"76",75,2331,-443.9,-0.98 -"77",76,2374,-446.7,-1.44 -"78",77,2418,-442.4,-0.73 -"79",78,2460,-441.8,-0.63 -"80",79,2501,-436.2,0.3 -"81",80,2542,-439.6,-0.27 -"82",81,2585,-446.2,-1.36 -"83",82,2628,-439,-0.17 -"84",83,2670,-438.1,-0.02 -"85",84,2713,-445.2,-1.19 -"86",85,2760,-449.9,-1.97 -"87",86,2805,-441.7,-0.61 -"88",87,2847,-434.5,0.58 -"89",88,2889,-440.3,-0.38 -"90",89,2934,-446.1,-1.34 -"91",90,2980,-446.5,-1.41 -"92",91,3026,-442.4,-0.73 -"93",92,3070,-439.5,-0.25 -"94",93,3114,-441.2,-0.53 -"95",94,3158,-438.5,-0.08 -"96",95,3201,-437.1,0.15 -"97",96,3245,-440.6,-0.43 -"98",97,3289,-441.7,-0.61 -"99",98,3334,-439.8,-0.3 -"100",99,3379,-438.8,-0.13 -"101",100,3422,-436.7,0.22 -"102",101,3466,-437,0.17 -"103",102,3511,-443.5,-0.91 -"104",103,3558,-443.4,-0.9 -"105",104,3603,-436.2,0.3 -"106",105,3646,-434.1,0.65 -"107",106,3689,-434.5,0.58 -"108",107,3732,-437.8,0.03 -"109",108,3778,-441.8,-0.63 -"110",109,3824,-440.8,-0.46 -"111",110,3870,-438,0 -"112",111,3915,-439.4,-0.23 -"113",112,3962,-442,-0.66 -"114",113,4009,-442.4,-0.73 -"115",114,4057,-442.5,-0.75 -"116",115,4104,-443.5,-0.91 -"117",116,4153,-444.6,-1.09 -"118",117,4202,-444,-1 -"119",118,4250,-441.2,-0.53 -"120",119,4295,-434.7,0.55 -"121",120,4339,-431.2,1.13 -"122",121,4381,-431.2,1.13 -"123",122,4423,-431.2,1.13 -"124",123,4466,-431.2,1.13 -"125",124,4509,-431.2,1.13 -"126",125,4552,-432.7,0.88 -"127",126,4596,-436.8,0.2 -"128",127,4642,-440,-0.33 -"129",128,4690,-443.3,-0.88 -"130",129,4739,-441.5,-0.58 -"131",130,4786,-436.5,0.25 -"132",131,4831,-438,0 -"133",132,4880,-444.9,-1.14 -"134",133,4929,-442,-0.66 -"135",134,4977,-440.2,-0.36 -"136",135,5025,-442,-0.66 -"137",136,5072,-437.2,0.13 -"138",137,5118,-436.9,0.18 -"139",138,5165,-440.3,-0.38 -"140",139,5212,-439.3,-0.22 -"141",140,5259,-436.3,0.28 -"142",141,5305,-437.4,0.1 -"143",142,5351,-437.5,0.08 -"144",143,5397,-435,0.5 -"145",144,5442,-435,0.5 -"146",145,5488,-436.8,0.2 -"147",146,5534,-437.9,0.02 -"148",147,5581,-437.5,0.08 -"149",148,5627,-437.8,0.03 -"150",149,5674,-438.37,-0.06 -"151",150,5721,-438.93,-0.15 -"152",151,5769,-439.5,-0.25 -"153",152,5816,-439.3,-0.22 -"154",153,5863,-437.1,0.15 -"155",154,5909,-435.3,0.45 -"156",155,5955,-438.8,-0.13 -"157",156,6004,-442.4,-0.73 -"158",157,6052,-439.25,-0.21 -"159",158,6099,-436.1,0.32 -"160",159,6145,-439,-0.17 -"161",160,6193,-440.2,-0.33 -"162",161,6241,-437.6,0.09 -"163",162,6287,-436.4,0.28 -"164",163,6334,-441.3,-0.55 -"165",164,6385,-447.5,-1.59 -"166",165,6436,-444.4,-1.09 -"167",166,6486,-439.6,-0.31 -"168",167,6534,-441.4,-0.62 -"169",168,6583,-441.5,-0.65 -"170",169,6631,-435.3,0.37 -"171",170,6677,-435.2,0.37 -"172",171,6724,-439.5,-0.36 -"173",172,6773,-442.3,-0.84 -"174",173,6823,-444.9,-1.28 -"175",174,6874,-444,-1.14 -"176",175,6924,-440.5,-0.58 -"177",176,6973,-440.5,-0.59 -"178",177,7023,-443.2,-1.05 -"179",178,7074,-444,-1.2 -"180",179,7124,-440.5,-0.63 -"181",180,7172,-436.5,0.02 -"182",181,7220,-436.8,-0.04 -"183",182,7267,-437.1,-0.11 -"184",183,7315,-438.1,-0.29 -"185",184,7364,-441.2,-0.81 -"186",185,7413,-439.7,-0.58 -"187",186,7462,-436,0.02 -"188",187,7509,-436.2,-0.03 -"189",188,7555,-433.1,0.48 -"190",189,7602,-436,-0.02 -"191",190,7649,-435.7,0.02 -"192",191,7697,-436,-0.04 -"193",192,7745,-440,-0.72 -"194",193,7794,-439,-0.57 -"195",194,7844,-440.9,-0.9 -"196",195,7894,-441,-0.93 -"197",196,7944,-439.5,-0.69 -"198",197,7994,-438.5,-0.54 -"199",198,8043,-439,-0.64 -"200",199,8091,-433.3,0.3 -"201",200,8135,-422.6,2.06 -"202",201,8178,-431.35,0.59 -"203",202,8226,-440.1,-0.87 -"204",203,8276,-439.5,-0.78 -"205",204,8325,-438,-0.55 -"206",205,8374,-435.9,-0.21 -"207",206,8422,-436.1,-0.26 -"208",207,8471,-437.6,-0.52 -"209",208,8520,-438.3,-0.65 -"210",209,8569,-438.4,-0.68 -"211",210,8619,-438.6,-0.73 -"212",211,8668,-437.5,-0.56 -"213",212,8716,-432,0.34 -"214",213,8763,-433.2,0.13 -"215",214,8811,-438.8,-0.81 -"216",215,8861,-437,-0.53 -"217",216,8910,-437,-0.54 -"218",217,8960,-439,-0.88 -"219",218,9009,-436.5,-0.48 -"220",219,9058,-436,-0.41 -"221",220,9107,-437.1,-0.6 -"222",221,9156,-436.5,-0.51 -"223",222,9204,-434.1,-0.13 -"224",223,9252,-431.7,0.26 -"225",224,9298,-433,0.03 -"226",225,9346,-435.5,-0.39 -"227",226,9396,-438,-0.82 -"228",227,9445,-437.2,-0.7 -"229",228,9494,-433.9,-0.16 -"230",229,9542,-433.8,-0.16 -"231",230,9589,-430.2,0.43 -"232",231,9635,-429.6,0.51 -"233",232,9682,-435.4,-0.46 -"234",233,9732,-437.4,-0.8 -"235",234,9782,-437.6,-0.85 -"236",235,9831,-436.9,-0.74 -"237",236,9881,-434.5,-0.36 -"238",237,9929,-434.5,-0.37 -"239",238,9978,-436.1,-0.65 -"240",239,10027,-433.8,-0.28 -"241",240,10075,-434.9,-0.47 -"242",241,10124,-435.5,-0.58 -"243",242,10172,-430,0.31 -"244",243,10218,-428.7,0.52 -"245",244,10265,-432.8,-0.18 -"246",245,10315,-439.5,-1.3 -"247",246,10366,-437.4,-0.97 -"248",247,10415,-434.1,-0.43 -"249",248,10465,-436,-0.76 -"250",249,10515,-436,-0.77 -"251",250,10564,-436,-0.79 -"252",251,10614,-436.6,-0.9 -"253",252,10665,-436.9,-0.96 -"254",253,10715,-435.2,-0.7 -"255",254,10764,-432.5,-0.26 -"256",255,10812,-433.5,-0.44 -"257",256,10861,-434.5,-0.62 -"258",257,10910,-431.6,-0.15 -"259",258,10957,-431.3,-0.12 -"260",259,11005,-431.9,-0.23 -"261",260,11053,-430.3,0.02 -"262",261,11100,-429.8,0.09 -"263",262,11146,-425.8,0.74 -"264",263,11191,-425.3,0.81 -"265",264,11237,-431.2,-0.18 -"266",265,11286,-433,-0.48 -"267",266,11334,-431.7,-0.27 -"268",267,11383,-434.5,-0.73 -"269",268,11434,-437.4,-1.22 -"270",269,11485,-437.8,-1.29 -"271",270,11537,-439.5,-1.57 -"272",271,11590,-439.6,-1.59 -"273",272,11642,-439.7,-1.61 -"274",273,11695,-441,-1.83 -"275",274,11749,-443.2,-2.2 -"276",275,11805,-444.2,-2.37 -"277",276,11861,-447.1,-2.85 -"278",277,11918,-445.3,-2.55 -"279",278,11973,-443.1,-2.19 -"280",279,12029,-447,-2.84 -"281",280,12087,-448.5,-3.09 -"282",281,12144,-446.5,-2.77 -"283",282,12202,-447.3,-2.9 -"284",283,12261,-453.2,-3.88 -"285",284,12323,-455,-4.18 -"286",285,12385,-453.6,-3.96 -"287",286,12446,-451.5,-3.61 -"288",287,12507,-452.4,-3.76 -"289",288,12569,-455.3,-4.25 -"290",289,12632,-455.3,-4.25 -"291",290,12694,-453.27,-3.91 -"292",291,12755,-451.23,-3.57 -"293",292,12815,-449.2,-3.24 -"294",293,12874,-450.2,-3.4 -"295",294,12934,-450.8,-3.5 -"296",295,12994,-451.8,-3.67 -"297",296,13055,-452.9,-3.85 -"298",297,13116,-452.3,-3.75 -"299",298,13177,-452.1,-3.72 -"300",299,13237,-450.5,-3.45 -"301",300,13296,-448.8,-3.17 -"302",301,13355,-448.8,-3.17 -"303",302,13414,-451.8,-3.67 -"304",303,13476,-455.5,-4.28 -"305",304,13539,-453.9,-4.02 -"306",305,13600,-451.2,-3.57 -"307",306,13659,-449.4,-3.27 -"308",307,13718,-447.2,-2.91 -"309",308,13774,-442.9,-2.19 -"310",309,13828,-442,-2.04 -"311",310,13883,-443.2,-2.24 -"312",311,13938,-442.1,-2.06 -"313",312,13992,-443.65,-2.32 -"314",313,14048,-445.2,-2.57 -"315",314,14105,-446.75,-2.83 -"316",315,14163,-448.3,-3.08 -"317",316,14221,-449.85,-3.34 -"318",317,14281,-451.4,-3.6 -"319",318,14342,-452.95,-3.85 -"320",319,14404,-454.5,-4.11 -"321",320,14466,-451.7,-3.64 -"322",321,14526,-452.8,-3.82 -"323",322,14589,-456,-4.34 -"324",323,14651,-453.8,-3.98 -"325",324,14713,-453.5,-3.92 -"326",325,14775,-454.8,-4.14 -"327",326,14839,-457.1,-4.52 -"328",327,14904,-458.1,-4.68 -"329",328,14968,-456.7,-4.44 -"330",329,15032,-458,-4.66 -"331",330,15099,-462,-5.32 -"332",331,15167,-462.5,-5.4 -"333",332,15234,-460.1,-5 -"334",333,15300,-459,-4.81 -"335",334,15366,-458.6,-4.74 -"336",335,15432,-461.1,-5.15 -"337",336,15501,-464.5,-5.71 -"338",337,15570,-463.8,-5.6 -"339",338,15639,-462.9,-5.44 -"340",339,15708,-463.7,-5.57 -"341",340,15777,-462,-5.29 -"342",341,15845,-462.4,-5.35 -"343",342,15915,-467.5,-6.19 -"344",343,15987,-466.3,-5.99 -"345",344,16057,-464.9,-5.75 -"346",345,16128,-466.9,-6.08 -"347",346,16201,-468.5,-6.34 -"348",347,16275,-470.9,-6.74 -"349",348,16350,-471.8,-6.88 -"350",349,16426,-471.8,-6.88 -"351",350,16502,-471,-6.74 -"352",351,16577,-471.2,-6.77 -"353",352,16653,-472.4,-6.97 -"354",353,16729,-473.6,-7.16 -"355",354,16808,-475.6,-7.49 -"356",355,16889,-480.7,-8.33 -"357",356,16974,-481.8,-8.51 -"358",357,17058,-479,-8.04 -"359",358,17139,-476.4,-7.6 -"360",359,17219,-476,-7.53 -"361",360,17298,-475.5,-7.45 -"362",361,17379,-479.4,-8.09 -"363",362,17462,-480.5,-8.27 -"364",363,17544,-477,-7.68 -"365",364,17625,-477.6,-7.78 -"366",365,17706,-478,-7.84 -"367",366,17787,-477.9,-7.82 -"368",367,17868,-477.3,-7.72 -"369",368,17949,-477.5,-7.75 -"370",369,18031,-480.15,-8.19 -"371",370,18116,-482.8,-8.63 -"372",371,18201,-480,-8.16 -"373",372,18283,-478.4,-7.89 -"374",373,18365,-477.5,-7.74 -"375",374,18446,-478.9,-7.97 -"376",375,18530,-482.1,-8.5 -"377",376,18615,-481.7,-8.43 -"378",377,18701,-483.5,-8.73 -"379",378,18787,-481.9,-8.46 -"380",379,18870,-476.6,-7.58 -"381",380,18950,-476.9,-7.63 -"382",381,19032,-479.8,-8.11 -"383",382,19116,-480.7,-8.26 -"384",383,19199,-479.35,-8.03 -"385",384,19282,-478,-7.81 -"386",385,19362,-476.4,-7.54 -"387",386,19443,-477.4,-7.7 -"388",387,19525,-480.1,-8.15 -"389",388,19610,-481.9,-8.45 -"390",389,19696,-483.5,-8.71 -"391",390,19782,-482.4,-8.52 -"392",391,19868,-482.9,-8.61 -"393",392,19953,-479.2,-7.99 -"394",393,20035,-477,-7.62 -"395",394,20116,-478.3,-7.84 -"396",395,20197,-476.4,-7.52 -"397",396,20278,-478.2,-7.82 -"398",397,20361,-480,-8.11 -"399",398,20444,-479.8,-8.08 -"400",399,20528,-479.5,-8.03 -"401",400,20611,-479.6,-8.04 -"402",401,20694,-479.1,-7.96 -"403",402,20777,-478.6,-7.87 -"404",403,20859,-479,-7.94 -"405",404,20943,-480.1,-8.12 -"406",405,21026,-480,-8.1 -"407",406,21110,-479,-7.93 -"408",407,21192,-478.9,-7.91 -"409",408,21275,-478.9,-7.91 -"410",409,21358,-479.45,-8 -"411",410,21442,-480,-8.09 -"412",411,21525,-477.8,-7.73 -"413",412,21605,-475.6,-7.36 -"414",413,21686,-477.4,-7.66 -"415",414,21769,-480.9,-8.24 -"416",415,21854,-481.5,-8.33 -"417",416,21939,-480.2,-8.12 -"418",417,22023,-480.4,-8.15 -"419",418,22108,-482,-8.41 -"420",419,22196,-484.5,-8.82 -"421",420,22284,-484.5,-8.82 -"422",421,22371,-482.3,-8.45 -"423",422,22457,-481.4,-8.3 -"424",423,22543,-481.85,-8.37 -"425",424,22629,-482.3,-8.45 -"426",425,22716,-482.75,-8.52 -"427",426,22803,-483.2,-8.59 -"428",427,22888,-479.5,-7.97 -"429",428,22972,-479.2,-7.92 -"430",429,23057,-482.7,-8.5 -"431",430,23145,-484.5,-8.8 -"432",431,23234,-485.1,-8.89 -"433",432,23324,-485.8,-9.01 -"434",433,23412,-483,-8.54 -"435",434,23497,-478.3,-7.76 -"436",435,23581,-480.95,-8.2 -"437",436,23668,-483.6,-8.63 -"438",437,23755,-483.6,-8.63 -"439",438,23843,-483.6,-8.63 -"440",439,23931,-482.5,-8.44 -"441",440,24017,-481.4,-8.26 -"442",441,24102,-480,-8.03 -"443",442,24186,-479.1,-7.87 -"444",443,24272,-484,-8.68 -"445",444,24363,-488.3,-9.39 -"446",445,24453,-482.7,-8.46 -"447",446,24537,-477.1,-7.53 -"448",447,24619,-477,-7.51 -"449",448,24700,-477,-7.5 -"450",449,24781,-475.5,-7.25 -"451",450,24860,-474,-7 -"452",451,24941,-477.45,-7.57 -"453",452,25024,-480.9,-8.14 -"454",453,25109,-480,-7.98 -"455",454,25193,-479.1,-7.83 -"456",455,25277,-478.2,-7.68 -"457",456,25360,-479.5,-7.89 -"458",457,25445,-481.8,-8.27 -"459",458,25531,-481,-8.13 -"460",459,25615,-478.4,-7.7 -"461",460,25697,-474.5,-7.05 -"462",461,25776,-474.1,-6.98 -"463",462,25855,-475.8,-7.26 -"464",463,25936,-476,-7.29 -"465",464,26017,-477.1,-7.47 -"466",465,26099,-477.2,-7.48 -"467",466,26180,-475.3,-7.16 -"468",467,26261,-475.8,-7.24 -"469",468,26342,-477.7,-7.55 -"470",469,26425,-479.3,-7.82 -"471",470,26510,-480.7,-8.05 -"472",471,26595,-481,-8.09 -"473",472,26681,-481,-8.09 -"474",473,26766,-478.9,-7.74 -"475",474,26849,-477.8,-7.56 -"476",475,26933,-479.9,-7.9 -"477",476,27019,-484.4,-8.64 -"478",477,27110,-486.7,-9.02 -"479",478,27202,-486.7,-9.02 -"480",479,27293,-485.5,-8.82 -"481",480,27382,-484.3,-8.62 -"482",481,27470,-481.4,-8.14 -"483",482,27555,-479.6,-7.84 -"484",483,27641,-482.3,-8.28 -"485",484,27730,-484.6,-8.66 -"486",485,27819,-483.8,-8.52 -"487",486,27907,-482.3,-8.27 -"488",487,27993,-481.2,-8.09 -"489",488,28079,-480.1,-7.9 -"490",489,28163,-478.85,-7.69 -"491",490,28247,-477.6,-7.49 -"492",491,28331,-481.7,-8.16 -"493",492,28420,-485.7,-8.82 -"494",493,28510,-483.58,-8.47 -"495",494,28597,-481.47,-8.12 -"496",495,28683,-479.35,-7.77 -"497",496,28766,-477.23,-7.42 -"498",497,28848,-475.12,-7.07 -"499",498,28927,-473,-6.71 -"500",499,29006,-473,-6.71 -"501",500,29085,-474.62,-6.98 -"502",501,29166,-476.24,-7.25 -"503",502,29249,-477.86,-7.52 -"504",503,29332,-479.48,-7.79 -"505",504,29418,-481.1,-8.05 -"506",505,29505,-482.9,-8.35 -"507",506,29594,-483,-8.37 -"508",507,29682,-482.8,-8.33 -"509",508,29771,-484.3,-8.58 -"510",509,29861,-483.4,-8.43 -"511",510,29949,-482.6,-8.3 -"512",511,30036,-480.5,-7.95 -"513",512,30120,-475.6,-7.14 -"514",513,30201,-474.9,-7.02 -"515",514,30283,-478.5,-7.62 -"516",515,30368,-479.8,-7.83 -"517",516,30453,-479.3,-7.75 -"518",517,30538,-478.63,-7.64 -"519",518,30622,-477.95,-7.52 -"520",519,30705,-477.27,-7.41 -"521",520,30788,-476.6,-7.3 -"522",521,30871,-478.6,-7.63 -"523",522,30957,-480.5,-7.95 -"524",523,31043,-480.8,-8 -"525",524,31130,-481.1,-8.05 -"526",525,31216,-479.9,-7.85 -"527",526,31302,-478.7,-7.65 -"528",527,31387,-479.4,-7.77 -"529",528,31473,-481,-8.03 -"530",529,31560,-482,-8.2 -"531",530,31648,-480.4,-7.93 -"532",531,31733,-477.2,-7.4 -"533",532,31815,-475.6,-7.14 -"534",533,31896,-473.4,-6.77 -"535",534,31976,-473.2,-6.74 -"536",535,32056,-473.5,-6.79 -"537",536,32137,-475.3,-... [truncated message content] |
From: <mtm...@us...> - 2012-08-15 14:41:04
|
Revision: 10879 http://octave.svn.sourceforge.net/octave/?rev=10879&view=rev Author: mtmiller Date: 2012-08-15 14:40:58 +0000 (Wed, 15 Aug 2012) Log Message: ----------- pei_tseng_notch: fix failing tests reported at bug #3553263 (Debian bug #664694). Modified Paths: -------------- trunk/octave-forge/main/signal/NEWS trunk/octave-forge/main/signal/inst/pei_tseng_notch.m Modified: trunk/octave-forge/main/signal/NEWS =================================================================== --- trunk/octave-forge/main/signal/NEWS 2012-08-15 13:41:35 UTC (rev 10878) +++ trunk/octave-forge/main/signal/NEWS 2012-08-15 14:40:58 UTC (rev 10879) @@ -9,7 +9,9 @@ column), the default values for grid_n and ramp_n, and returning an error when invalid values are used (instead of silently adjusting them). - ** Fixed failing test for the function `residued'. + ** Fixed failing tests for the following functions: + pei_tseng_notch + residued ** The function `rceps' was fixed to work correctly with odd-length inputs. Modified: trunk/octave-forge/main/signal/inst/pei_tseng_notch.m =================================================================== --- trunk/octave-forge/main/signal/inst/pei_tseng_notch.m 2012-08-15 13:41:35 UTC (rev 10878) +++ trunk/octave-forge/main/signal/inst/pei_tseng_notch.m 2012-08-15 14:40:58 UTC (rev 10879) @@ -91,7 +91,7 @@ %! [b, a] = pei_tseng_notch ( 50 / sf2, 2 / sf2 ); %! filtered = filter ( b, a, data ); %! damp_db = 20 * log10 ( max ( filtered ( end - 1000 : end, : ) ) ); -%! assert ( damp_db, [ -3 -251.9 -3 ], 0.1 ) +%! assert ( damp_db, [ -3 -251.9 -3 ], -0.1 ) %!test %! ##1Hz bandwidth @@ -100,7 +100,7 @@ %! [b, a] = pei_tseng_notch ( 50 / sf2, 1 / sf2 ); %! filtered = filter ( b, a, data ); %! damp_db = 20 * log10 ( max ( filtered ( end - 1000 : end, : ) ) ); -%! assert ( damp_db, [ -3 -240.4 -3 ], 0.1 ) +%! assert ( damp_db, [ -3 -240.4 -3 ], -0.1 ) %!demo %! sf = 800; sf2 = sf/2; This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <car...@us...> - 2012-08-15 13:41:41
|
Revision: 10878 http://octave.svn.sourceforge.net/octave/?rev=10878&view=rev Author: carandraug Date: 2012-08-15 13:41:35 +0000 (Wed, 15 Aug 2012) Log Message: ----------- fir2: always return a row (matlab compatibility) Modified Paths: -------------- trunk/octave-forge/main/signal/NEWS trunk/octave-forge/main/signal/inst/fir2.m Modified: trunk/octave-forge/main/signal/NEWS =================================================================== --- trunk/octave-forge/main/signal/NEWS 2012-08-15 13:15:12 UTC (rev 10877) +++ trunk/octave-forge/main/signal/NEWS 2012-08-15 13:41:35 UTC (rev 10878) @@ -4,7 +4,10 @@ signal-1.1.4 Release Date: 2012-XX-XX Release Manager: =============================================================================== - ** Improved Matlab compability for the function `fir2'. + ** Improved Matlab compability for the function `fir2'. This changes include + always returning vaues in a row (even when the smoothing window is a single + column), the default values for grid_n and ramp_n, and returning an error + when invalid values are used (instead of silently adjusting them). ** Fixed failing test for the function `residued'. Modified: trunk/octave-forge/main/signal/inst/fir2.m =================================================================== --- trunk/octave-forge/main/signal/inst/fir2.m 2012-08-15 13:15:12 UTC (rev 10877) +++ trunk/octave-forge/main/signal/inst/fir2.m 2012-08-15 13:41:35 UTC (rev 10878) @@ -129,14 +129,12 @@ b = ifft([grid ; zeros(grid_n*2,1) ;grid(grid_n:-1:2)]); b = 2 * real([ b([end-n+1:2:end]) ; b(2:2:(n+1))]); endif + ## Multiplication in the time domain is convolution in frequency, ## so multiply by our window now to smooth the frequency response. - if rows(window) > 1 - b = b .* window; - else - b = b' .* window; - endif - b = b' + ## Also, for matlab compatibility, we return return values in 1 row + b = b(:)' .* window(:)'; + endfunction %% Test that the grid size is rounded up to the next power of 2 This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <car...@us...> - 2012-08-15 13:15:18
|
Revision: 10877 http://octave.svn.sourceforge.net/octave/?rev=10877&view=rev Author: carandraug Date: 2012-08-15 13:15:12 +0000 (Wed, 15 Aug 2012) Log Message: ----------- fir2: replace more calls to soon to be deprecated usage Modified Paths: -------------- trunk/octave-forge/main/signal/inst/fir2.m Modified: trunk/octave-forge/main/signal/inst/fir2.m =================================================================== --- trunk/octave-forge/main/signal/inst/fir2.m 2012-08-15 12:07:12 UTC (rev 10876) +++ trunk/octave-forge/main/signal/inst/fir2.m 2012-08-15 13:15:12 UTC (rev 10877) @@ -70,7 +70,7 @@ if nargin < 6, window=w; endif if isempty(window), window=hamming(n+1); endif if !isreal(window) || ischar(window), window=feval(window, n+1); endif - if length(window) != n+1, usage("window must be of length n+1"); endif + if length(window) != n+1, error ("fir2: window must be of length n+1"); endif ## Default grid size is 512... unless n+1 >= 1024 if isempty (grid_n) @@ -136,6 +136,7 @@ else b = b' .* window; endif + b = b' endfunction %% Test that the grid size is rounded up to the next power of 2 This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <car...@us...> - 2012-08-15 12:07:18
|
Revision: 10876 http://octave.svn.sourceforge.net/octave/?rev=10876&view=rev Author: carandraug Date: 2012-08-15 12:07:12 +0000 (Wed, 15 Aug 2012) Log Message: ----------- fir2: replace calls to soon to be deprecated usage Modified Paths: -------------- trunk/octave-forge/main/signal/inst/fir2.m Modified: trunk/octave-forge/main/signal/inst/fir2.m =================================================================== --- trunk/octave-forge/main/signal/inst/fir2.m 2012-08-15 10:36:54 UTC (rev 10875) +++ trunk/octave-forge/main/signal/inst/fir2.m 2012-08-15 12:07:12 UTC (rev 10876) @@ -52,16 +52,13 @@ ## verify frequency and magnitude vectors are reasonable t = length(f); if t<2 || f(1)!=0 || f(t)!=1 || any(diff(f)<0) - usage("frequency must be nondecreasing starting from 0 and ending at 1"); - endif - if t != length(m) - usage("frequency and magnitude vectors must be the same length"); - endif - + error ("fir2: frequency must be nondecreasing starting from 0 and ending at 1"); + elseif t != length(m) + error ("fir2: frequency and magnitude vectors must be the same length"); ## find the grid spacing and ramp width - if (nargin>4 && length(grid_n)>1) || \ - (nargin>5 && (length(grid_n)>1 || length(ramp_n)>1)) - usage("grid_n and ramp_n must be integers"); + elseif (nargin>4 && length(grid_n)>1) || \ + (nargin>5 && (length(grid_n)>1 || length(ramp_n)>1)) + error ("fir2: grid_n and ramp_n must be integers"); endif if nargin < 4, grid_n=[]; endif if nargin < 5, ramp_n=[]; endif This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <jpi...@us...> - 2012-08-15 10:37:00
|
Revision: 10875 http://octave.svn.sourceforge.net/octave/?rev=10875&view=rev Author: jpicarbajal Date: 2012-08-15 10:36:54 +0000 (Wed, 15 Aug 2012) Log Message: ----------- geometry: Adding polygonCentriod and polygonArea. Added Paths: ----------- trunk/octave-forge/main/geometry/inst/polygons2d/polygonArea.m trunk/octave-forge/main/geometry/inst/polygons2d/polygonCentroid.m Added: trunk/octave-forge/main/geometry/inst/polygons2d/polygonArea.m =================================================================== --- trunk/octave-forge/main/geometry/inst/polygons2d/polygonArea.m (rev 0) +++ trunk/octave-forge/main/geometry/inst/polygons2d/polygonArea.m 2012-08-15 10:36:54 UTC (rev 10875) @@ -0,0 +1,98 @@ +%% Copyright (C) 2003-2011 David Legland <dav...@gr...> +%% Copyright (C) 2012 Adapted to Octave by Juan Pablo Carbajal <car...@if...> +%% All rights reserved. +%% +%% Redistribution and use in source and binary forms, with or without +%% modification, are permitted provided that the following conditions are met: +%% +%% 1 Redistributions of source code must retain the above copyright notice, +%% this list of conditions and the following disclaimer. +%% 2 Redistributions in binary form must reproduce the above copyright +%% notice, this list of conditions and the following disclaimer in the +%% documentation and/or other materials provided with the distribution. +%% +%% THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS ''AS IS'' +%% AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE +%% IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE +%% ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE FOR +%% ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL +%% DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR +%% SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER +%% CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, +%% OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +%% OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +%% +%% The views and conclusions contained in the software and documentation are +%% those of the authors and should not be interpreted as representing official +%% policies, either expressed or implied, of the copyright holders. + +%% -*- texinfo -*- +%% @deftypefn {Function File} {@var{area} = } polygonArea (@var{points}) +%% @deftypefnx {Function File} {@var{area} = } polygonArea (@var{px},@var{py}) +%% Compute the signed area of a polygon. +%% +%% Compute area of a polygon defined by @var{points}. @var{points} is a N-by-2 +%% matrix containing coordinates of vertices. +%% +%% Vertices of the polygon are supposed to be oriented Counter-Clockwise +%% (CCW). In this case, the signed area is positive. +%% If vertices are oriented Clockwise (CW), the signed area is negative. +%% +%% If polygon is self-crossing, the result is undefined. +%% +%% If @var{points} is a cell, each element is considered a polygon and the area +%% of each one is returned in the matrix @var{area}. The matrix has the same shape +%% as the cell. +%% +%% References: +%% Algorithm adapted from P. Bourke web page +%% http://local.wasp.uwa.edu.au/~pbourke/geometry/polyarea/ +%% +%% @seealso{polygons2d, polygonCentroid, drawPolygon} +%% @end deftypefn + +function area = polygonArea(varargin) + + var = varargin{1}; + + % in case of polygon sets, computes several areas + if iscell (var) + area = cellfun (@func, var); + +% area = zeros(length(var), 1); +% for i = 1:length(var) +% area(i) = polygonArea(var{i}, varargin{2:end}); +% end +% return; +% end + else + % extract coordinates + if nargin == 1 + + area = func(var) + + elseif nargin == 2 + + px = varargin{1}; + py = varargin{2}; + + % indices of next vertices + N = length(px); + iNext = [2:N 1]; + + % compute area (vectorized version) + area = sum(px .* py(iNext) - px(iNext) .* py) / 2; + + end + + end + +endfunction + +function a = func (c) + + N = length (c); + iNext = [2:N 1]; + a = sum (c(:,1) .* c(iNext,2) - c(iNext,1) .* c(:,2)) / 2; + +endfunction Added: trunk/octave-forge/main/geometry/inst/polygons2d/polygonCentroid.m =================================================================== --- trunk/octave-forge/main/geometry/inst/polygons2d/polygonCentroid.m (rev 0) +++ trunk/octave-forge/main/geometry/inst/polygons2d/polygonCentroid.m 2012-08-15 10:36:54 UTC (rev 10875) @@ -0,0 +1,82 @@ +%% Copyright (C) 2003-2011 David Legland <dav...@gr...> +%% Copyright (C) 2012 Adapted to Octave by Juan Pablo Carbajal <car...@if...> +%% All rights reserved. +%% +%% Redistribution and use in source and binary forms, with or without +%% modification, are permitted provided that the following conditions are met: +%% +%% 1 Redistributions of source code must retain the above copyright notice, +%% this list of conditions and the following disclaimer. +%% 2 Redistributions in binary form must reproduce the above copyright +%% notice, this list of conditions and the following disclaimer in the +%% documentation and/or other materials provided with the distribution. +%% +%% THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS ''AS IS'' +%% AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE +%% IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE +%% ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE FOR +%% ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL +%% DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR +%% SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER +%% CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, +%% OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +%% OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +%% +%% The views and conclusions contained in the software and documentation are +%% those of the authors and should not be interpreted as representing official +%% policies, either expressed or implied, of the copyright holders. + +%% -*- texinfo -*- +%% @deftypefn {Function File} {[ @var{pt}, @var{area} ] = } polygonCentroid (@var{points}) +%% @deftypefnx {Function File} {[ @dots{} ]= } polygonCentroid (@var{ptx},@var{pty}) +%% Compute the centroid (center of mass) of a polygon. +%% +%% Computes the center of mass of a polygon defined by @var{points}. @var{points} is a +%% N-by-2 matrix. The two columns can be given separately using @var{ptx} and @var{pty} +%% for the x and y component respectively. +%% +%% The area of the polygon is returned in the second output argument. +%% +%% Adapted from @url{http://local.wasp.uwa.edu.au/~pbourke/geometry/polyarea/} +%% +%% @seealso{polygons2d, polygonArea, drawPolygon} +%% @end deftypefn + +function [pt A] = polygonCentroid(varargin) + + if nargin==1 + var = varargin{1}; + + px = var(:,1); + py = var(:,2); + + elseif nargin==2 + + px = varargin{1}; + py = varargin{2}; + + end + + % Algorithme P. Bourke (vectorized) + inext = [2:N 1]; + + cros = (px.*py(inext) - px(inext).*py); + sx_ = sum ( (px + px(inext)) .* cros); + sy_ = sum ( (py + py(inext)) .* cros); + + A = sum(cros) / 2; + + pt_ = [sx_ sy_]/A/6; + + % sx = 0; + % sy = 0; + % N = length(px); + % for i=1:N-1 + % sx = sx + (px(i)+px(i+1))*(px(i)*py(i+1) - px(i+1)*py(i)); + % sy = sy + (py(i)+py(i+1))*(px(i)*py(i+1) - px(i+1)*py(i)); + % end + % sx = sx + (px(N)+px(1))*(px(N)*py(1) - px(1)*py(N)); + % sy = sy + (py(N)+py(1))*(px(N)*py(1) - px(1)*py(N)); + % pt = [sx sy]/6/polygonArea(px, py) + +endfunction This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <mtm...@us...> - 2012-08-15 06:33:56
|
Revision: 10874 http://octave.svn.sourceforge.net/octave/?rev=10874&view=rev Author: mtmiller Date: 2012-08-15 06:33:49 +0000 (Wed, 15 Aug 2012) Log Message: ----------- fir2: fix default frequency response interpolation parameters * Increase default interpolation size for larger filter length. * Default transition width is 1/25 of interpolation size. Modified Paths: -------------- trunk/octave-forge/main/signal/inst/fir2.m Modified: trunk/octave-forge/main/signal/inst/fir2.m =================================================================== --- trunk/octave-forge/main/signal/inst/fir2.m 2012-08-14 20:50:42 UTC (rev 10873) +++ trunk/octave-forge/main/signal/inst/fir2.m 2012-08-15 06:33:49 UTC (rev 10874) @@ -28,7 +28,7 @@ ## grid_n: length of ideal frequency response function ## defaults to 512, should be a power of 2 bigger than n/2 ## ramp_n: transition width for jumps in filter response -## defaults to grid_n/20; a wider ramp gives wider transitions +## defaults to grid_n/25; a wider ramp gives wider transitions ## but has better stopband characteristics. ## window: smoothing window ## defaults to hamming(n+1) row vector @@ -75,7 +75,14 @@ if !isreal(window) || ischar(window), window=feval(window, n+1); endif if length(window) != n+1, usage("window must be of length n+1"); endif - if isempty (grid_n), grid_n = 512; endif + ## Default grid size is 512... unless n+1 >= 1024 + if isempty (grid_n) + if n+1 < 1024 + grid_n = 512; + else + grid_n = n+1; + endif + endif ## ML behavior appears to always round the grid size up to a power of 2 grid_n = 2 ^ nextpow2 (grid_n); @@ -85,7 +92,7 @@ error ("fir2: grid size must be greater than half the filter order"); endif - if isempty (ramp_n), ramp_n = fix (grid_n / 20); endif + if isempty (ramp_n), ramp_n = fix (grid_n / 25); endif ## Apply ramps to discontinuities if (ramp_n > 0) This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |