Ejemplo n.º 1
0
 def test_synthesizeChebyshevNTF_3(self):
     """Test function for synthesizeChebyshevNTF() 3/3"""
     z, p, k = ds.synthesizeChebyshevNTF(order=5,
                                         OSR=32,
                                         opt=0,
                                         H_inf=1.5,
                                         f0=.33)
Ejemplo n.º 2
0
 def test_synthesizeChebyshevNTF_3(self):
     """Test function for synthesizeChebyshevNTF() 3/3"""
     with self.assertRaises(ValueError):
         z, p, k = ds.synthesizeChebyshevNTF(order=5,
                                             OSR=32,
                                             opt=0,
                                             H_inf=1.5,
                                             f0=.33)
 def test_synthesizeChebyshevNTF_1(self):
     """Test function for synthesizeChebyshevNTF() 1/3"""
     z, p, k = ds.synthesizeChebyshevNTF()
     zref = [1., .9991 + 0.0425j, .9991 - 0.0425j]
     pref = [.6609, .7686 + .2858j, .7686 - .2858j]
     kref = 1.
     self.assertTrue(np.allclose(cplxpair(z), cplxpair(zref), atol=1e-4, rtol=1e-4))
     self.assertTrue(np.allclose(cplxpair(p), cplxpair(pref), atol=1e-4, rtol=1e-4))
     self.assertTrue(np.allclose(k, kref, atol=1e-4, rtol=1e-4))
 def test_synthesizeChebyshevNTF_2(self):
     """Test function for synthesizeChebyshevNTF() 2/3"""
     with catch_warnings(record=True) as w:
         z, p, k = ds.synthesizeChebyshevNTF(order=4, OSR=32, opt=1, H_inf=1.5, f0=.33)
         self.assertTrue(len(w) > 0)
     zref = [-.4513 + .8924j, -.4513 - .8924j, -.5122 + 0.8589j, -.5122 - 0.8589j]
     pref = [-.2249 + .7665j, -.2249 - .7665j, -.5506 + .6314j, -.5506 - .6314j]
     kref = 1.
     self.assertTrue(np.allclose(cplxpair(z), cplxpair(zref), atol=1e-4, rtol=1e-4))
     self.assertTrue(np.allclose(cplxpair(p), cplxpair(pref), atol=1e-4, rtol=1e-4))
     self.assertTrue(np.allclose(k, kref, atol=1e-4, rtol=1e-4))
Ejemplo n.º 5
0
 def test_synthesizeChebyshevNTF_1(self):
     """Test function for synthesizeChebyshevNTF() 1/3"""
     z, p, k = ds.synthesizeChebyshevNTF()
     zref = [1., .9991 + 0.0425j, .9991 - 0.0425j]
     pref = [.6609, .7686 + .2858j, .7686 - .2858j]
     kref = 1.
     self.assertTrue(
         np.allclose(cplxpair(z), cplxpair(zref), atol=1e-4, rtol=1e-4))
     self.assertTrue(
         np.allclose(cplxpair(p), cplxpair(pref), atol=1e-4, rtol=1e-4))
     self.assertTrue(np.allclose(k, kref, atol=1e-4, rtol=1e-4))
Ejemplo n.º 6
0
 def test_synthesizeChebyshevNTF_2(self):
     """Test function for synthesizeChebyshevNTF() 2/3"""
     with catch_warnings(record=True) as w:
         z, p, k = ds.synthesizeChebyshevNTF(order=4,
                                             OSR=32,
                                             opt=1,
                                             H_inf=1.5,
                                             f0=.33)
         self.assertTrue(len(w) > 0)
     zref = [
         -.4513 + .8924j, -.4513 - .8924j, -.5122 + 0.8589j,
         -.5122 - 0.8589j
     ]
     pref = [
         -.2249 + .7665j, -.2249 - .7665j, -.5506 + .6314j, -.5506 - .6314j
     ]
     kref = 1.
     self.assertTrue(
         np.allclose(cplxpair(z), cplxpair(zref), atol=1e-4, rtol=1e-4))
     self.assertTrue(
         np.allclose(cplxpair(p), cplxpair(pref), atol=1e-4, rtol=1e-4))
     self.assertTrue(np.allclose(k, kref, atol=1e-4, rtol=1e-4))
 def test_synthesizeChebyshevNTF_3(self):
     """Test function for synthesizeChebyshevNTF() 3/3"""
     z, p, k = ds.synthesizeChebyshevNTF(order=5, OSR=32, opt=0, H_inf=1.5, f0=.33)