[Pkg-octave-commit] r922 - in octplot/trunk/debian: . patches
Thomas Weber
thomas-guest at alioth.debian.org
Mon May 21 07:48:33 UTC 2007
Author: thomas-guest
Date: 2007-05-21 07:48:33 +0000 (Mon, 21 May 2007)
New Revision: 922
Added:
octplot/trunk/debian/patches/50_add_missing_functions.patch
Modified:
octplot/trunk/debian/changelog
Log:
Add some files from Octave-forge, such that the demos work
Modified: octplot/trunk/debian/changelog
===================================================================
--- octplot/trunk/debian/changelog 2007-05-18 07:10:54 UTC (rev 921)
+++ octplot/trunk/debian/changelog 2007-05-21 07:48:33 UTC (rev 922)
@@ -8,11 +8,15 @@
+ 50_quiet_subplot.patch
+ 50_kfreebsd.patch
+ 50_supply_paths.patch
- * New patch: 50_link_with_glu.patch
- Change configure.ac to check for GLU. Check taken from autoconf-archive.
- These checks need config.guess and config.sub as well (closes: #423994)
+ * New patches:
+ + 50_link_with_glu.patch
+ Change configure.ac to check for GLU. Check taken from autoconf-archive.
+ These checks need config.guess and config.sub as well (closes: #423994)
+ + 50_add_missing_functions
+ Copy some files from Octave-forge into OctPlot. Otherwise, most demos
+ won't run.
- --
+ --
octplot (0.3.9-3) unstable; urgency=low
Added: octplot/trunk/debian/patches/50_add_missing_functions.patch
===================================================================
--- octplot/trunk/debian/patches/50_add_missing_functions.patch (rev 0)
+++ octplot/trunk/debian/patches/50_add_missing_functions.patch 2007-05-21 07:48:33 UTC (rev 922)
@@ -0,0 +1,230 @@
+diff -Nur octplot-0.4.0/src/chirp.m octplot-0.4.0.new/src/chirp.m
+--- octplot-0.4.0/src/chirp.m 1970-01-01 01:00:00.000000000 +0100
++++ octplot-0.4.0.new/src/chirp.m 2007-05-21 09:26:22.000000000 +0200
+@@ -0,0 +1,98 @@
++## Copyright (C) 1999-2000 Paul Kienzle
++##
++## 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 2 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, write to the Free Software
++## Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
++
++## usage: y = chirp(t [, f0 [, t1 [, f1 [, form [, phase]]]]])
++##
++## Evaluate a chirp signal at time t. A chirp signal is a frequency
++## swept cosine wave.
++##
++## t: vector of times to evaluate the chirp signal
++## f0: frequency at time t=0 [ 0 Hz ]
++## t1: time t1 [ 1 sec ]
++## f1: frequency at time t=t1 [ 100 Hz ]
++## form: shape of frequency sweep
++## 'linear' f(t) = (f1-f0)*(t/t1) + f0
++## 'quadratic' f(t) = (f1-f0)*(t/t1)^2 + f0
++## 'logarithmic' f(t) = (f1-f0)^(t/t1) + f0
++## phase: phase shift at t=0
++##
++## Example
++## specgram(chirp([0:0.001:5])); # linear, 0-100Hz in 1 sec
++## specgram(chirp([-2:0.001:15], 400, 10, 100, 'quadratic'));
++## soundsc(chirp([0:1/8000:5], 200, 2, 500, "logarithmic"),8000);
++##
++## If you want a different sweep shape f(t), use the following:
++## y = cos(2*pi*integral(f(t)) + 2*pi*f0*t + phase);
++
++## 2001-08-31 Paul Kienzle <pkienzle at users.sf.net>
++## * Fix documentation for quadratic case
++
++function y = chirp(t, f0, t1, f1, form, phase)
++
++ if nargin < 1 || nargin > 6
++ usage("y = chirp(t [, f0 [, t1 [, f1 [, form [, phase]]]]])");
++ endif
++ if nargin < 2, f0 = []; endif
++ if nargin < 3, t1 = []; endif
++ if nargin < 4, f1 = []; endif
++ if nargin < 5, form = []; endif
++ if nargin < 6, phase = []; endif
++
++ if isempty(f0), f0 = 0; endif
++ if isempty(t1), t1 = 1; endif
++ if isempty(f1), f1 = 100; endif
++ if isempty(form), form = "linear"; endif
++ if isempty(phase), phase = 0; endif
++
++ phase = 2*pi*phase/360;
++
++ if strcmp(form, "linear")
++ a = pi*(f1 - f0)/t1;
++ b = 2*pi*f0;
++ y = cos(a*t.^2 + b*t + phase);
++ elseif strcmp(form, "quadratic")
++ a = (2/3*pi*(f1-f0)/t1/t1);
++ b = 2*pi*f0;
++ y = cos(a*t.^3 + b*t + phase);
++ elseif strcmp(form, "logarithmic")
++ a = 2*pi*t1/log(f1-f0);
++ b = 2*pi*f0;
++ x = (f1-f0)^(1/t1);
++ y = cos(a*x.^t + b*t + phase);
++ else
++ error("chirp doesn't understand '%s'",form);
++ endif
++
++endfunction
++
++%!demo
++%! specgram(chirp([0:0.001:5]),[],1000); # linear, 0-100Hz in 1 sec
++%! %------------------------------------------------------------
++%! % Shows linear sweep of 100 Hz/sec starting at zero for 5 sec
++%! % since the sample rate is 1000 Hz, this should be a diagonal
++%! % from bottom left to top right.
++
++%!demo
++%! specgram(chirp([-2:0.001:15], 400, 10, 100, 'quadratic'));
++%! %------------------------------------------------------------
++%! % Shows a quadratic chirp of 400 Hz at t=0 and 100 Hz at t=10
++%! % Time goes from -2 to 15 seconds.
++
++%!demo
++%! specgram(chirp([0:1/8000:5], 200, 2, 500, "logarithmic"),[],8000);
++%! %------------------------------------------------------------
++%! % Shows a logarithmic chirp of 200 Hz at t=0 and 500 Hz at t=2
++%! % Time goes from 0 to 5 seconds at 8000 Hz.
+diff -Nur octplot-0.4.0/src/jet.m octplot-0.4.0.new/src/jet.m
+--- octplot-0.4.0/src/jet.m 1970-01-01 01:00:00.000000000 +0100
++++ octplot-0.4.0.new/src/jet.m 2007-05-21 09:25:22.000000000 +0200
+@@ -0,0 +1,55 @@
++## Copyright (C) 1999,2000 Kai Habel
++##
++## 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 2 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, write to the Free Software
++## Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
++
++## -*- texinfo -*-
++## @deftypefn {Function File} {} jet (@var{n})
++## Create color colormap.
++## (dark blue through blue, cyan, green, yellow, red to dark red)
++## The argument @var{n} should be a scalar. If it
++## is omitted, the length of the current colormap or 64 is assumed.
++## @seealso{colormap}
++## @end deftypefn
++
++## Author: Kai Habel <kai.habel at gmx.de>
++
++function map = jet (number)
++
++ if (nargin == 0)
++ number = rows (colormap);
++ elseif (nargin == 1)
++ if (! is_scalar (number))
++ error ("jet: argument must be a scalar");
++ endif
++ else
++ usage ("jet (number)");
++ endif
++
++ if (number == 1)
++ map = [0, 0, 0.5];
++ elseif (number > 1)
++ x = linspace(0, 1, number)';
++ r = (x >= 3/8 & x < 5/8) .* (4 * x - 3/2)\
++ + (x >= 5/8 & x < 7/8) + (x >= 7/8) .* (-4 * x + 9/2);
++ g = (x >= 1/8 & x < 3/8) .* (4 * x - 1/2)\
++ + (x >= 3/8 & x < 5/8) + (x >= 5/8 & x < 7/8) .* (-4 * x + 7/2);
++ b = (x < 1/8) .* (4 * x + 1/2) + (x >= 1/8 & x < 3/8)\
++ + (x >= 3/8 & x < 5/8) .* (-4 * x + 5/2);
++ map = [r, g, b];
++ else
++ map = [];
++ endif
++
++endfunction
+diff -Nur octplot-0.4.0/src/Makefile.am octplot-0.4.0.new/src/Makefile.am
+--- octplot-0.4.0/src/Makefile.am 2007-04-27 12:41:39.000000000 +0200
++++ octplot-0.4.0.new/src/Makefile.am 2007-05-21 09:26:42.000000000 +0200
+@@ -70,7 +70,8 @@
+ get.m line_props.m patch_props.m title.m \
+ gnuplot_warn.m octplot_atexit.m print.m xlabel.m \
+ iscolorspec.m octplot_disable.m quiver.m ylabel.m \
+-close.m
++close.m \
++peaks.m jet.m chirp.m
+
+ ############################################################################
+ ### all files built from this point must be explicitly listed in the
+diff -Nur octplot-0.4.0/src/peaks.m octplot-0.4.0.new/src/peaks.m
+--- octplot-0.4.0/src/peaks.m 1970-01-01 01:00:00.000000000 +0100
++++ octplot-0.4.0.new/src/peaks.m 2007-05-21 09:23:32.000000000 +0200
+@@ -0,0 +1,52 @@
++## Generate a function with lots of local maxima and minima.
++##
++## f(x,y) = 3*(1-x)^2*exp(-x^2 - (y+1)^2) ...
++## - 10*(x/5 - x^3 - y^5)*exp(-x^2-y^2) ...
++## - 1/3*exp(-(x+1)^2 - y^2)
++##
++## peaks plot a 49x49 mesh over the range [-3,3]
++## peaks(n) plot an nxn mesh over the range [-3,3]
++## peaks(v) plot over [X,Y]=meshgrid(v,v)
++## peaks(x,y) plot over [X,Y]=meshgrid(x,y)
++## Z = peaks(...) return Z instead of plotting
++## [X,Y,Z] = peaks(...) return X,Y,Z instead of plotting
++
++## This program is public domain
++
++## Expression for peaks function was taken from the following paper:
++## http://www.control.hut.fi/Kurssit/AS-74.115/Material/GENALGgoga.pdf
++function [X_out,Y_out,Z_out] = peaks(x,y)
++
++ if nargin == 0
++ x = y = linspace(-3,3,49);
++ elseif nargin == 1
++ if length(x) > 1
++ y = x;
++ else
++ x = y = linspace(-3,3,x);
++ endif
++ endif
++
++ if (isvector(x) && isvector(y))
++ [X,Y] = meshgrid(x,y);
++ else
++ X = x;
++ Y = y;
++ endif
++
++ Z = 3*(1-X).^2.*exp(-X.^2 - (Y+1).^2) \
++ - 10*(X/5 - X.^3 - Y.^5).*exp(-X.^2-Y.^2) \
++ - 1/3*exp(-(X+1).^2 - Y.^2);
++
++ if nargout == 0
++ mesh(x,y,Z);
++ elseif nargout == 1
++ X_out = Z;
++ else
++ X_out = X;
++ Y_out = Y;
++ Z_out = Z;
++ endif
++
++endfunction
++
More information about the Pkg-octave-commit
mailing list