示例#1
0
 def setUp(self):
     # Data for test 1,2,3
     zt = np.array((1, 2, 3))
     pt = np.array((1 + 2e-5, 2 + .5e-5, 3))
     kt = 2
     zpkt = (zt, pt, kt)
     self.zr, self.pr, self.kr = ds.cancelPZ(zpkt, tol=1e-5)
     # Data for test 4
     ntf_test = (np.array([ 1. +1.49011612e-08j]), np.array([ 1.+0.j]), 1.0)
     self.test4 = ds.cancelPZ(ntf_test)
示例#2
0
def zpk_multiply(a, b):
    za, pa, ka = ds._utils._get_zpk(a)
    zb, pb, kb = ds._utils._get_zpk(b)
    pa = pa.tolist() if hasattr(pa, 'tolist') else pa
    pb = pb.tolist() if hasattr(pb, 'tolist') else pb
    za = za.tolist() if hasattr(za, 'tolist') else za
    zb = zb.tolist() if hasattr(zb, 'tolist') else zb
    return ds.cancelPZ((za+zb, pa+pb, ka*kb))
示例#3
0
 def setUp(self):
     zt = np.array((1, 2, 3))
     pt = np.array((1 + 2e-5, 2 + .5e-5, 3))
     kt = 2
     zpkt = (zt, pt, kt)
     self.zr, self.pr, self.kr = ds.cancelPZ(zpkt, tol=1e-5)