Autocorrelation strange results? I'm trying to do autocorrelation with numpy in python but i'm getting strange results :

For a simple 440Hz sine wave sample :


This is the result of autocorrelation :


Is this normal ? Maybe I'm not understanding everything

UPDATE :

Here is my code :

def autocorrelation(signal):
  res = np.correlate(signal, signal, mode='same')
  res = res[len(res)//2:]
  plt.plot(signal)
  plt.show()
  plt.plot(res)

  plt.show()
I think you have some overflow/underflow issues? At about 32768, there are signal glitches in the autocorrelation results. Could it be that your calculations are done on 16 bits?