60
|
1 function zr = tzero (a, b, c, d, bal) |
|
2 |
|
3 # Compute the transmission zeros of a, b, c, d. |
|
4 # |
|
5 # bal = balancing option (see balance); default is "B". |
|
6 # |
|
7 # Needs to incorporate mvzero algorithm to isolate finite zeros. |
|
8 |
|
9 if (nargin == 4) |
|
10 bal = "B"; |
|
11 elseif (nargin ~= 5) |
|
12 error("tzero: illegal number of arguments") |
|
13 endif |
|
14 |
|
15 [n, m, p] = abcdchk (a, b, c, d); |
|
16 |
|
17 if(m != p) |
|
18 |
|
19 disp("warning: tzero: number of inputs,outputs differ -- squaring up") |
|
20 |
|
21 if (p > m) |
|
22 disp (" by padding b, d with zeros") |
|
23 b = [b, zeros (n, p-m)]; |
|
24 d = [d, zeros (p, p-m)]; |
|
25 m = p; |
|
26 else |
|
27 disp (" by padding c,d with zeros") |
|
28 c = [c; zeros (m-p, n)]; |
|
29 d = [d; zeros (m-p, m)]; |
|
30 p = m; |
|
31 endif |
|
32 |
|
33 disp ("This is a kludge. Try again with SISO system.") |
|
34 |
|
35 endif |
|
36 |
|
37 if (n != -1) |
|
38 ab = [-a -b; c d]; |
|
39 bb = [eye (n), zeros (n, m); zeros (p, n), zeros (p, m)]; |
|
40 [ab, bb] = balance (ab, bb); |
|
41 zr = qzval (ab, bb); |
|
42 endif |
|
43 |
|
44 endfunction |