def test_AmplitudeSine_SNR0():
  '''
  Test AmplitudeSine SNR_0 computation (1.+2.*sin(2.*pi*t/1.))
  '''
  noiseParams = NoiseParameters(1e6, 1.)
  ampl = AmplitudeSine(AmplitudeBase.UNITS_AMPLITUDE, 1., 2., 1.)
  SNR = 10. * numpy.log10(noiseParams.getFreqTimesTau() / 4.)
  assert numpy.abs(SNR - ampl.computeSNR(noiseParams)) < EPSILON
def test_AmplitudeSine_apply0():
  '''
  Test AmplitudeSine computation (1.+2.*sin(2.*pi*t/4.))
  '''
  noiseParams = NoiseParameters(1e6, 1.)
  ampl = AmplitudeSine(AmplitudeBase.UNITS_AMPLITUDE, 1., 2., 4.)
  userTimeAll_s = numpy.asarray([0., 1., 2.], dtype=numpy.float)
  signal = numpy.asarray([0., 1., 1.], dtype=numpy.float)
  signal = ampl.applyAmplitude(signal, userTimeAll_s, noiseParams)
  assert (numpy.abs(signal - numpy.asarray([0., 3., 1.], dtype=numpy.float))
          < EPSILON).all()