t = dt * np.arange(num_samples)

def autocor(x):
    result = np.correlate(x, x, mode='full')
return result[result.size / 2:]

def f(freq):
    return np.sin(2 * np.pi * freq * t)
plt.plot(t, autocor(f(0.3)))
plt.xlabel('time (sec)')
plt.show()
How to find periodicity in an algorithimic sequence with python