def correlation(x, nMax=80, dt=1, method='manual'):
    ' \n    Compute auto correlation of a signal\n    '
    nvec = np.arange(0, nMax)
    sigma2 = np.var(x)
    R = np.zeros(nMax)
    R[0] = 1
    for (i, nDelay) in enumerate(nvec[1:]):
        R[(i + 1)] = (np.mean((x[0:(- nDelay)] * x[nDelay:])) / sigma2)
    tau = (nvec * dt)
    return (R, tau)
Compute auto correlation of a signal
def correlation(x, nMax=80, dt=1, method='manual'):
    ' \n    \n    '
    nvec = np.arange(0, nMax)
    sigma2 = np.var(x)
    R = np.zeros(nMax)
    R[0] = 1
    for (i, nDelay) in enumerate(nvec[1:]):
        R[(i + 1)] = (np.mean((x[0:(- nDelay)] * x[nDelay:])) / sigma2)
    tau = (nvec * dt)
    return (R, tau)