I think you may have a problem with your code. You have defined rawData to be an array of type char. When you perform the multiplication in the step which multiplies the two rawData values you are overflowing the type char. The multiplication is done on type char before it is assigned to variable sum.

` for (k=0; k <len-i; k++)`

{

sum += (rawData[k]) * (rawData[k+i]);

}

I have been bitten by this before. Try casting rawData to long before doing the multiplication and see if you get the same answer.

I analyzed your data in Mathematica and got a much different result for the autocorrelation. Also, you imply that autocorrelation is a frequency domain technique which it is not. It is done strictly in the time domain. Taking the FFT of the autocorrelation gives the power spectrum of the signal putting it in the frequency domain.

The plot below is the periodogram of the data. Mathematica has a function to find the peaks which are found at the following indices of the data (shown as red dots on the plot)...

{13, 24, 35, 47, 59, 70, 82, 93, 105, 116, 128, 139, 151, 162, 174, \

185, 197, 208, 220, 231, 243, 254, 266, 277, 289, 300, 312, 323, 335, \

346, 358, 369, 381, 392, 404, 415, 427, 438, 450, 461, 472, 485, 487, \

500, 511, 522, 534, 545, 557, 568, 580, 591, 603, 614, 626, 637, 649, \

660, 672, 683, 695, 706, 718, 729, 741, 752, 764, 775, 787, 798, 810, \

821, 833, 844, 856, 867, 879, 890, 902, 913, 925, 937, 948, 959}

The fundamental frequency (259.09 Hz)and overtones really stand out when displayed this way.