Chromatic tuner using FFT and autocorrelation
@janihalme | jh(├Ąt)
fs = , fw = , fbin =
fcenter = , farea = , q =
fest =
Noise floor:
The spectrum analyser displays a frequency domain window from 0 Hz to fw and each horizontal line represents a "bin" of frequencies within a range of fbin. Note that the analyser window has a fixed number of 512 bins, so a higher sample rate means that each bin will contain a larger set of frequencies.

fcenter is an approximated frequency of the strongest pitch detected from the frequency domain data obtained using FFT. The "neighbourhood" of this frequency is used as a basis for searching a more accurate estimate using a normalised autocorrelation algorithm. The final estimated pitch is fest.

The nearest chromatic note is shown on the tuning meter, along with the deviation from the note pitch in cents. "--" means that the signal level is too low to detect. "!!" means that a sufficiently strong signal exists but a reliable estimate for the pitch has not yet been acquired.

The detection modes incorporating FFT are best used with tones that have a clearly defined fundamental frequency. However, for detecting the pitch of human voice, it's best to use only autocorrelation as it seems to provide the best results with sounds containing a large amount of harmonic tones.