feat: interp testing plot
This commit is contained in:
@@ -187,5 +187,16 @@ def load_scope_data(filename):
|
||||
print(f"Skipping malformed row: {row}")
|
||||
return timearr, v1arr, v2arr
|
||||
|
||||
#t, v1, v2 = load_scope_data('~/Sync/org/School/EE3150/LAB3/data/2_2_a/100hz.csv')
|
||||
#print (t1)
|
||||
def test_interp():
|
||||
A = 1.0
|
||||
f = 100
|
||||
xmax = 2.0
|
||||
w = 2*np.pi*f
|
||||
x = A * np.sin(w*t) * (t >= 0)
|
||||
y_full = conv_num(x, h, dt)
|
||||
y = y_full[:N] # keep same length as x
|
||||
t2, v1, v2 = load_scope_data('/home/hurricos/Sync/org/School/EE3150/LAB3/data/2_2_a/100hz.csv')
|
||||
yinterp = np.interp(t2, t, y)
|
||||
plt.plot(t, y, 'o')
|
||||
plt.plot(t2, yinterp, '-x')
|
||||
plt.show()
|
||||
|
||||
Reference in New Issue
Block a user