Hello, I am trying to create a digital guitar tuner using the arduino with the Atmel168. My idea for determining the frequency of the incoming guitar signal is to use the analogRead command to sample the incoming signal at 5kHz (every 200us) and store a certain number of values in an array (about 100 samples should do). If I can pull the max values from the array and count how often they occur I think it could determine the input fundamental frequency.
I do have all the hardware setup already to condition the guitar signal to readable levels (between 0 and 5V, input signal is 2.5V biased) and also filtered to cut out anything above 600Hz. Guitars are like harmonic frequency generators so its pretty tough to filter each individual note to its fundamental, but my input signals do max periodically at the fundamental frequency. I thought about using a set limit to trigger a max, but the amplitude does reduce as the string rings out so it might not always trigger properly, and thus the max values will slowly be declining.
So basically my question is how do I store 100 input values into an array at 200us(or faster) per sample, and then determine how many samples occur between each max value?