Hacker News new | ask | show | jobs
by mjochim 1301 days ago
Apart from the fact that FFT is way more complex than needed for a guitar tuner, I also believe it’s not even really possible to use a Fourier Transform for a useful guitar tuner. Because you won’t achieve good enough frequency resolution.

I would be interested if I am missing any possible tricks here. But the low E string on a guitar is about 82.4 Hz. For a useful basic tuner you would need a precision of maybe 5 cents (~ percent of a semitone), or roughly 0.25 Hz (roughly 1 Hz for the high E string). Frequency resolution with the FFT improves when you analyse a longer signal. For 0.25 Hz resolution, you need more than two seconds of audio. Two seconds where the pitch doesn’t change. I don’t think you’d get anywhere with such a design.

I’m not sure if this could be changed with a higher sample rate. With a higher sample rate, you have more samples per second to feed into the FFT, but also the upper boundary for frequency increases, so I believe frequency resolution just stays the same. I’d need to look up the formulas, though. Maybe with extreme zero padding? Or any other tricks?

3 comments

It's possible to interpolate between FFT bins if you're assuming the input is a reasonably pure tone (because a pure tone in between two FFT bins will fill both of them in proportion to how close it is to each of them). This can give you extremely good frequency resolution (and is also good at rejecting noise far away from the tone of interest).
You're absolutely right. Even on a bass where your low E is about 40Hz (or a 5-string where you have a low *C* at 32Hz give or take) you'd only need a handful of cycles to track pitch very accurately.

The trick works because you're only trying to tune one string at a time. An FFT approach would presumably be able to track the pitch of all the strings regardless of what notes you were playing, with a bit of thought, although if you played an A on the 6th string 5th fret and an open 5th string it wouldn't be able to tell which was "out".

> good enough frequency resolution

phase vocoder, little man

s/little man/my friend/

the deprecatory reading was unwarranted