Worth noting that with real-world sounds, there are always harmonics present. Although the frequency resolution of FFT gets progressively worse at lower frequencies, for many sounds it can be expected that the first harmonic will be exactly double the frequency of the fundamental. In terms of "pitch", a more accurate estimate may be made by looking at the harmonics.

*Guitar Low E*
- window-Frequency Analysis-000.png (43.73 KiB) Viewed 227 times

Example, in this spectrum the fundamental shows 83 Hz. Given the "Size" of 8192 samples and a sample rate of 44100 Hz, that figure lies between 80.749512 Hz and 86.132812 Hz, and the interpolated estimate is 83 Hz Here is the relevant part of the data (exported from Plot Spectrum):

- Code: Select all
`64.599609 -50.531769`

69.982910 -46.574673

75.366211 -32.057095

80.749512 -22.215677

86.132812 -24.367990

91.516113 -40.745335

96.899414 -50.853859

Looking at the first harmonic, the interpolated estimate is 164 Hz. Here is the data:

- Code: Select all
`139.965820 -50.730862`

145.349121 -48.354359

150.732422 -44.920811

156.115723 -34.589748

161.499023 -19.850306

166.882324 -18.712814

172.265625 -29.874290

177.648926 -45.561481

183.032227 -50.346607

Taking a naive approximation that the true value is somewhere between the mid-points of the adjacent bins, at 83 Hz, a range of +/- 2.6 Hz represents +/- 39.6 cents, but for the first harmonic, the accuracy improves to +/- 27.9 cents. If I recall correctly, Plot Spectrum uses cubic interpolation, so the approximation will actually be much better than this, but the same principle applies, that the first harmonic value is likely to be a better approximation than the fundamental.