Mercurial > hg > ltpda
comparison 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 |
comparison
equal
deleted
inserted
replaced
-1:000000000000 | 0:f0afece42f48 |
---|---|
1 % GETK get the mathematical gain factor for a pole-zero model | |
2 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% | |
3 % | |
4 % DESCRIPTION | |
5 % | |
6 % A zpk model in matlab notation is an object of the type: | |
7 % | |
8 % (s-z1)...(s-zN) | |
9 % zpk = k*---------------- | |
10 % (s-p1)...(s-pn) | |
11 % | |
12 % the zero-frequency-gain (zfg) of this object is obtained by the equation, | |
13 % for s = 0. | |
14 % LTPDA pzmodels are constructed by poles, zeros and zero-frequency-gain | |
15 % (zfg). This means that the value stored in the 'gain' field of the model | |
16 % is the zfg! | |
17 % This function calculate k. | |
18 % | |
19 % CALL: | |
20 % | |
21 % k = getk(z,p,zfg) | |
22 % | |
23 % INPUT: | |
24 % | |
25 % z zeros | |
26 % p poles | |
27 % zfg zero frequency gain (model resp at zero frequency) | |
28 % | |
29 % | |
30 % OUTPUT: | |
31 % | |
32 % k mathematical gain | |
33 % | |
34 % NOTE: | |
35 % | |
36 % | |
37 % | |
38 % | |
39 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% | |
40 % VERSION: $Id: getk.m,v 1.1 2010/02/19 14:59:04 luigi Exp $ | |
41 % | |
42 % HISTORY: 08-10-2008 L Ferraioli | |
43 % Creation | |
44 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% | |
45 function k = getk(z,p,zfg) | |
46 | |
47 zrs = prod(-1*z); | |
48 pls = prod(-1*p); | |
49 | |
50 k = zfg*pls/zrs; | |
51 | |
52 end | |
53 | |
54 | |
55 | |
56 | |
57 | |
58 | |
59 |