fixed files
This commit is contained in:
BIN
assignments/01/TTT4120_Assignment_1.pdf
Normal file
BIN
assignments/01/TTT4120_Assignment_1.pdf
Normal file
Binary file not shown.
32
assignments/01/conv.py
Normal file
32
assignments/01/conv.py
Normal file
@@ -0,0 +1,32 @@
|
||||
import numpy as np
|
||||
|
||||
x = [1,2,3]
|
||||
|
||||
h_1 = [1,1,1]
|
||||
|
||||
h2Length = 10
|
||||
h_2 = [(0.9**n) for n in range(h2Length + 1)]
|
||||
|
||||
print(h_2)
|
||||
|
||||
y_1 = np.convolve(x,h_1)
|
||||
y_2 = np.convolve(y_1,h_2)
|
||||
|
||||
y_1h2 = np.convolve(x,h_2)
|
||||
|
||||
|
||||
|
||||
print(y_1)
|
||||
print(y_2)
|
||||
print(y_1h2)
|
||||
|
||||
def GenStem(arr, padding = 2):
|
||||
print("n\txn")
|
||||
for i in range(padding):
|
||||
print(str(i-padding) + "\t0")
|
||||
for i in range(len(arr)):
|
||||
print(str(i) + "\t" + str(arr[i]))
|
||||
for i in range(padding):
|
||||
print(str(len(arr) + i) + "\t0")
|
||||
|
||||
GenStem(y_1h2)
|
||||
Reference in New Issue
Block a user