This is done by Fourier transforming wave forms represented as vectors of intensity over time.
Plot of 440hz tone and an almost 440hz tone, recorded with real equipment.
Heat map of frequencies in entire audio file for flute playing an A tone at 5th octave.