Mercurial > hg > ltpda
diff m-toolbox/classes/+utils/@math/getk.m @ 0:f0afece42f48
Import.
author | Daniele Nicolodi <nicolodi@science.unitn.it> |
---|---|
date | Wed, 23 Nov 2011 19:22:13 +0100 |
parents | |
children |
line wrap: on
line diff
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/m-toolbox/classes/+utils/@math/getk.m Wed Nov 23 19:22:13 2011 +0100 @@ -0,0 +1,59 @@ +% GETK get the mathematical gain factor for a pole-zero model +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +% +% DESCRIPTION +% +% A zpk model in matlab notation is an object of the type: +% +% (s-z1)...(s-zN) +% zpk = k*---------------- +% (s-p1)...(s-pn) +% +% the zero-frequency-gain (zfg) of this object is obtained by the equation, +% for s = 0. +% LTPDA pzmodels are constructed by poles, zeros and zero-frequency-gain +% (zfg). This means that the value stored in the 'gain' field of the model +% is the zfg! +% This function calculate k. +% +% CALL: +% +% k = getk(z,p,zfg) +% +% INPUT: +% +% z zeros +% p poles +% zfg zero frequency gain (model resp at zero frequency) +% +% +% OUTPUT: +% +% k mathematical gain +% +% NOTE: +% +% +% +% +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +% VERSION: $Id: getk.m,v 1.1 2010/02/19 14:59:04 luigi Exp $ +% +% HISTORY: 08-10-2008 L Ferraioli +% Creation +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +function k = getk(z,p,zfg) + +zrs = prod(-1*z); +pls = prod(-1*p); + +k = zfg*pls/zrs; + +end + + + + + + +