def compute_frequency(t, theta):
 dt = (t[1] - t[0])
 f = ((np.diff(theta) / (2 * np.pi)) / dt)
 tf = (0.5 * (t[1:] + t[:(-1)]))
 return (tf, f)

def compute_frequency ( t , theta ) : dt = ( t [ 1 ] - t [ 0 ] ) f = ( ( np . diff ( theta ) / ( 2 * np . pi ) ) / dt ) tf = ( 0.5 * ( t [ 1 : ] + t [ : ( - 1 ) ] ) ) return ( tf , f )
compute theta(t)/ .