]> Creatis software - CreaPhase.git/blob - octave_packages/signal-1.1.3/zp2ss.m
Add a useful package (from Source forge) for octave
[CreaPhase.git] / octave_packages / signal-1.1.3 / zp2ss.m
1 ## Copyright (C) 1994, 1996, 2000, 2002, 2003, 2004, 2005, 2007 Auburn University
2 ## Copyright (C) 2012 Lukas F. Reichlin <lukas.reichlin@gmail.com>
3 ##
4 ## This program is free software; you can redistribute it and/or modify it under
5 ## the terms of the GNU General Public License as published by the Free Software
6 ## Foundation; either version 3 of the License, or (at your option) any later
7 ## version.
8 ##
9 ## This program is distributed in the hope that it will be useful, but WITHOUT
10 ## ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
11 ## FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more
12 ## details.
13 ##
14 ## You should have received a copy of the GNU General Public License along with
15 ## this program; if not, see <http://www.gnu.org/licenses/>.
16
17 ## -*- texinfo -*-
18 ## @deftypefn {Function File} {[@var{a}, @var{b}, @var{c}, @var{d}] =} zp2ss (@var{zer}, @var{pol}, @var{k})
19 ## Conversion from zero / pole to state space.
20 ##
21 ## @strong{Inputs}
22 ## @table @var
23 ## @item zer
24 ## @itemx pol
25 ## Vectors of (possibly) complex poles and zeros of a transfer
26 ## function. Complex values must come in conjugate pairs
27 ## (i.e., @math{x+jy} in @var{zer} means that @math{x-jy} is also in @var{zer}).
28 ## @item k
29 ## Real scalar (leading coefficient).
30 ## @end table
31 ##
32 ## @strong{Outputs}
33 ## @table @var
34 ## @item @var{a}
35 ## @itemx @var{b}
36 ## @itemx @var{c}
37 ## @itemx @var{d}
38 ## The state space system, in the form:
39 ## @iftex
40 ## @tex
41 ## $$ \dot x = Ax + Bu $$
42 ## $$ y = Cx + Du $$
43 ## @end tex
44 ## @end iftex
45 ## @ifinfo
46 ## @example
47 ##      .
48 ##      x = Ax + Bu
49 ##      y = Cx + Du
50 ## @end example
51 ## @end ifinfo
52 ## @end table
53 ## @end deftypefn
54
55 ## Author: David Clem
56
57 function [a, b, c, d, e] = zp2ss (varargin)
58
59   if (nargin == 0)
60     print_usage ();
61   endif
62
63   [a, b, c, d, e] = dssdata (zpk (varargin{:}), []);
64
65 endfunction