I'm trying to figure out how exactly an auto correlation corresponds to a time domain signal.
Now I'm trying to find pitch periods in an audio file and 99% of the time I'm getting it spot on. Unfortunately however that 1% of the time is throwing me some annoying issues.
Now at present I scan through my window for the highest peak (ie the highest abs( sample value )). This seems to match up really nicely in most cases.
Now when I auto correlate I would expect the central peak to be this peak that I have identified (It will always have a positive number if i read it right). Is this correct?
Secondly, A peak that is n samples away from the central peak of the auto correlation will be n samples away from the peak I've identified in time domain, ok?
Sooo, if this is correct then I'm having a strange problem. I'm finding a peak in the auto correlation 91 samples from the center of my auto correlation. Unfortunately when I look at the signal in the time domain (inside an audio editing app) then my central peak corresponds perfectly to a negative peak in the audio. However, there are no peaks 91 samples away from that peak.
If I look forward the next real peak is 142 samples away and the previous peak to it is 75 samples away. I do notice a very tiny peak 91 samples or so in front of my peak but the sample never even goes negative. So why does this end up showing up as by far the strongest peak in the auto correlation?
Any help with this would be hugely appreciated!