def test_integer_all(self): f0 = 10 t1 = 3 f1 = 20 t = np.linspace(-1, 1, 11) float_result = waveforms.chirp(t, float(f0), float(t1), float(f1)) int_result = waveforms.chirp(t, f0, t1, f1) err_msg = "Integer input 'f0=10, t1=3, f1=20' gives wrong result" assert_equal(int_result, float_result, err_msg=err_msg)
def test_integer_f1(self): f0 = 10.0 t1 = 3.0 t = np.linspace(-1, 1, 11) f1 = 20.0 float_result = waveforms.chirp(t, f0, t1, f1) f1 = 20 int_result = waveforms.chirp(t, f0, t1, f1) err_msg = "Integer input 'f1=20' gives wrong result" assert_equal(int_result, float_result, err_msg=err_msg)
def test_quadratic_at_zero2(self): w = waveforms.chirp(t=0, f0=1.0, f1=2.0, t1=1.0, method='quadratic', vertex_zero=False) assert_almost_equal(w, 1.0)
def test_linear_at_zero(self): w = waveforms.chirp(t=0, f0=1.0, f1=2.0, t1=1.0, method='linear') assert_almost_equal(w, 1.0)
def test_hyperbolic_at_zero(self): w = waveforms.chirp(t=0, f0=10.0, f1=1.0, t1=1.0, method='hyperbolic') assert_almost_equal(w, 1.0)
def test_logarithmic_at_zero(self): w = waveforms.chirp(t=0, f0=1.0, f1=2.0, t1=1.0, method='logarithmic') assert_almost_equal(w, 1.0)