I can see that there are different functions available across various libraries for performing Autocorrelation on a signal in Python.
I've tried the following 3 functions and all result in different outputs for the sample 'x' used, where, x = [22, 24, 25, 25, 28, 29, 34, 37, 40, 44, 51, 48, 47, 50, 51]
1) Using statsmodels
import statsmodels
res = statsmodels.tsa.stattools.acf(x)
plt.plot(res)
plt.show()
2. Using scipy
import scipy.signal as signal
res = signal.correlate(x, x, mode = 'same')
res_au = (res-min(res))/(max(res)-min(res))
plt.plot(res_au)
plt.show()
3. Using numpy
import numpy
res = numpy.correlate(x, x, mode='same')
res_norm = (res-min(res))/(max(res)-min(res))
plt.plot(res_norm)
plt.show()
Can anyone please explain what are the differences between them and when should we be using each of them?
My objective is to find autocorrelation for a single channel with itself.