def __init__(self, name='Ramp', amplitude=1, delay=0, offset=0): Signal.__init__(self, name) def function(t): if t < delay: return offset else: return (t-delay) * amplitude + offset self.function = function
def __init__(self, name, function): Signal.__init__(self, name) self.function = function
def __init__(self, name='Sinus', amplitude=1, w=1, phase=0, offset=0): Signal.__init__(self, name) self.function = lambda t: amplitude * np.sin(w * t + phase) + offset