Skip to content
Snippets Groups Projects

Add initial support for signal generators

Merged Oscar Gustafsson requested to merge signalgenerator into master
1 file
+ 12
0
Compare changes
  • Side-by-side
  • Inline
@@ -50,6 +50,12 @@ def test_addition():
assert g(2) == 2
assert g(3) == 1
g = Impulse(1) + 1
assert g(0) == 1
assert g(1) == 2
assert g(2) == 1
assert g(3) == 1
def test_subtraction():
g = Impulse() - Impulse(2)
@@ -64,6 +70,12 @@ def test_subtraction():
assert g(2) == 0
assert g(3) == 1
g = Impulse(2) - 1
assert g(0) == -1
assert g(1) == -1
assert g(2) == 0
assert g(3) == -1
def test_multiplication():
g = Impulse() * 0.5
Loading