Autocorrelation strange results?
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?