aboutsummaryrefslogtreecommitdiff
path: root/sem5/sig/mm6/opg2.py
diff options
context:
space:
mode:
Diffstat (limited to 'sem5/sig/mm6/opg2.py')
-rw-r--r--sem5/sig/mm6/opg2.py30
1 files changed, 30 insertions, 0 deletions
diff --git a/sem5/sig/mm6/opg2.py b/sem5/sig/mm6/opg2.py
new file mode 100644
index 0000000..38d65fe
--- /dev/null
+++ b/sem5/sig/mm6/opg2.py
@@ -0,0 +1,30 @@
+#!/usr/bin/env python3
+# 2020-09-23:s5/sig/mm6/opg/2
+
+import matplotlib.pyplot as plt
+import sys
+import numpy as np
+
+lookahead = 100
+values = 50
+
+res = np.empty(values)
+
+for n in range(values):
+ s = 0
+ for k in range(lookahead):
+ h = np.exp(-k/8)
+
+ x = 1
+ if (n - k) < 0:
+ x = 0
+
+ s += x * h
+ res[n] = s
+
+x = np.arange(values)
+
+plt.plot(x, res)
+plt.show()
+
+