@@ -53,10 +53,10 @@ Base.zero(f::SisoZpk) = zero(typeof(f))
53
53
tzero (sys:: SisoZpk ) = f. z # Do minreal first?,
54
54
pole (sys:: SisoZpk ) = f. p # Do minreal first?
55
55
56
- numpoly (f:: SisoZpk{<:Real} ) = f. k* prod (roots2real_poly_factors (f. z)) # QUESTION: Include f.k?
56
+ numpoly (f:: SisoZpk{<:Real} ) = f. k* prod (roots2real_poly_factors (f. z))
57
57
denpoly (f:: SisoZpk{<:Real} ) = prod (roots2real_poly_factors (f. p))
58
58
59
- numpoly (f:: SisoZpk ) = prod (roots2complex_poly_factors (f. z))
59
+ numpoly (f:: SisoZpk ) = f . k * prod (roots2complex_poly_factors (f. z))
60
60
denpoly (f:: SisoZpk ) = prod (roots2complex_poly_factors (f. p))
61
61
62
62
num (f:: SisoZpk ) = reverse (coeffs (numpoly (f))) # FIXME : reverse?!
@@ -156,11 +156,14 @@ function poly_factors2string(poly_factors, var)
156
156
end
157
157
end
158
158
159
- # TODO : add print function for complex coefficient polynomial factors
160
159
function print_siso (io:: IO , t:: SisoZpk , var= :s )
161
- numstr = poly_factors2string (roots2real_poly_factors (t. z), var)
162
- denstr = poly_factors2string (roots2real_poly_factors (t. p), var)
163
-
160
+ if typeof (t. k) <: Real
161
+ numstr = poly_factors2string (roots2real_poly_factors (t. z), var)
162
+ denstr = poly_factors2string (roots2real_poly_factors (t. p), var)
163
+ else
164
+ numstr = poly_factors2string (roots2complex_poly_factors (t. z), var)
165
+ denstr = poly_factors2string (roots2complex_poly_factors (t. p), var)
166
+ end
164
167
# Figure out the length of the separating line
165
168
len_num = length (numstr)
166
169
len_den = length (denstr)
0 commit comments