Advertisement
Guest User

Untitled

a guest
Sep 8th, 2020
157
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 0.37 KB | None | 0 0
  1. def theta_t(f, t):  # compute complete input ("phase") from instantaneous freq
  2.     theta0 = f[0] * t[0]  # initial phase / input
  3.     theta = [theta0]
  4.     for i in range(1, len(f)):
  5.         theta.append(theta[-1] + (t[i] - t[i - 1]) * f[i])
  6.     return 2 * np.pi * np.array(theta)
  7.     # Equivalent:
  8.     # return 2 * np.pi * np.cumsum([f[0] * t[0]] + list(f[1:] * np.diff(t)))
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement