def test_TCXOPoly_compute0(): ''' Unit test for empty TCXOPoly object ''' tcxo = TCXOPoly(()) time = tcxo.computeTcxoTime(0, 10, NormalRateConfig) assert time is None
def test_TCXOPoly_compute1(): ''' Unit test for TCXOPoly with linear time shift (10e-6) ''' tcxo = TCXOPoly((1.,)) time = tcxo.computeTcxoTime(0, 10, NormalRateConfig) test_vector = numpy.linspace(0., 10. * 1e-6 / NormalRateConfig.SAMPLE_RATE_HZ, 10., endpoint=False) assert (time == test_vector).all()
def test_TCXOPoly_compute2(): ''' Unit test for TCXOPoly with linear time shift (10e-6) ''' tcxo = TCXOPoly((1., 1.)) time = tcxo.computeTcxoTime(0, 10, NormalRateConfig) test_vector = numpy.linspace(0., 10. * 1e-6 / NormalRateConfig.SAMPLE_RATE_HZ, 10., endpoint=False) test_vector = test_vector * test_vector / 2. + test_vector assert (numpy.abs(time - test_vector) < EPSILON).all()