Square wave frequency detection

Hi there! I'm building a guitar with a hex pickup and I was thinking of a way of having pitch detection without using too much processing power.

-Because there is a pickup for each string, we can use both a low pass and a high pass filter to get a pure sine wave. For instance, for the fifth string of a guitar we could have a high pass at 110Hz and a low pass at 220Hz, from A to A, so no harmonics would get in our way (well, the first overtone is the octave, so maybe we should narrow it to 11 frets. Still OK).

-Using some Schmitt Trigger circuit we can easily turn our sine wave into a square wave. Maybe the sine wave needs some form of compression first to make the amplitude regular enough. Still easy.

-We do a digitalRead on the square wave. Some basic algorithm could calculate the frequency from there (I don't know exactly yet, I'm guessing).

Would this work? Is the Arduino fast enough to do a digitalRead on all six channels? The highest frequency should be around 640 Hz, so a 1200 Hz samplerate should be enough.

But it looks so easy I'm sure I'm overlooking some problem. Frequency to voltage IC's have a reputation for being slow for audio, but maybe they work better with a simple square wave.

Thanky'all

Substitute "pulseIn()" for digitalRead(). Other than that, sounds like a good first cut.

It might or might not be fast enough to do it with digitalRead or pulseIn. You can definitely do it using direct port manipulation, reading all 6 at once.

Nick has some examples of frequency counters here:

Seriously, that easy? I'll give it a try and I'll come back once I get it working.

Thanks!