John said:
How do they work, then? (The answer 'Very well' is not acceptable.)
Most of them use a simple design. You can find one on CircuitCellar,
and that's pretty much how this is done in commercial products.
It consists of an input stage, which is basically a good low-pass filter
filtering everything above the maximum fundamental frequency it's
supposed to deal with (probably something like 1000 or 1500 Hz), usually
a 2nd order active filter. Then it's followed by a comparator set with
some hysteresis, which can also be an amplifier based on some AOP with
a lot of gain - so that the AOP clips the signal, which is easily
transformed into a digital signal with a schmitt trigger, for instance.
This circuit basically extracts the fundamental frequency of the input
signal with a reasonable usability.
Then the comparator's output can be dealt with in various ways.
Some can be rather crude (just measuring the frequency of the resulting
digital signal), some are more clever, and I like the one that's used
in the CircuitCellar project. The comparator's output goes to a digital
I/O pin of a microcontroller, of course set as an input. The algorithm
used consists of measuring the delay between two consecutive raising
edges - but this is not all. To make sure the measure is meaningful,
several consecutive measures are compared, and only if we get a few
(like 10, for instance) consecutive measures that are close enough
to one another, do we consider this is the fundamental frequency.
The latter is computed from the period, using for instance an average of
the 10 given "meaningful" past measures.
By comparing the frequency with a few preset ranges, the tuner can
even guess what the string it is you're trying to tune, and
automatically give you how far away you are from the nominal
frequency for this string.
As to how the above input stage, based on a filter and a saturation
stage, translates in the frequency domain (in other words, how
the spectrum of the original signal is transformed), I'll let you
think about it. It resembles, but is not quite like simply looking
at zero-crossings - because the saturation on the signal actually
tends to "ignore" the harmonics, whereas simple zero-crossing
analysis has to deal with them.
All in all, this is a working approach and it's much simpler than any
sophisticated DSP analysis you might try.