]> Creatis software - CreaPhase.git/blob - octave_packages/signal-1.1.3/zp2tf.m
Add a useful package (from Source forge) for octave
[CreaPhase.git] / octave_packages / signal-1.1.3 / zp2tf.m
1 ## Copyright (C) 1996, 1998, 2000, 2002, 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{num}, @var{den}] =} zp2tf (@var{zer}, @var{pol}, @var{k})
19 ## Converts zeros / poles to a transfer function.
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 appear in conjugate pairs.
27 ## @item k
28 ## Real scalar (leading coefficient).
29 ## @end table
30 ## @end deftypefn
31
32 ## Author: A. S. Hodel <a.s.hodel@eng.auburn.edu>
33 ## (With help from students Ingram, McGowan.)
34
35 function [num, den] = zp2tf (varargin)
36
37   if (nargin == 0)
38     print_usage ();
39   endif
40
41   [num, den] = tfdata (zpk (varargin{:}), "vector");
42
43 endfunction