Guitar fundamental frequency vs pitch When a note is played on the guitar, is the fundamental frequency always the strongest one or could a harmonic be the strongest one (in terms of amplitude). When could that happen? Also, when playing a note of, for example, 440Hz, is 220Hz also a harmonic or only larger multiples?

When I produce a spectrogram of a B3 guitar note I get this:



As you can see, the frequency of B3 (246Hz) does not seem to be the strongest frequency. Its approximate half (near 130) seems to be the strongest one.

This is the audio file (the B3 note is clear).

To generate the spectrogram, I use a STFT taken from the Librosa library:

import plot as plt

def transcribe(filename):
  y, sr = librosa.load(filename, sr=40000)

  D = librosa.stft(y)
  plt.plot_spectrogram(D)


The plot.py module:

import matplotlib.pylab as plt

def plot_spectrogram(stft_output, xlabel='Time', ylabel='Hz'):
  plt.figure()
  librosa.display.specshow(librosa.amplitude_to_db(stft_output, 
    ref=np.max), y_axis='log', x_axis='time')
  plt.title('Power Spectrogram')
  plt.colorbar(format='%+2.0f dB')
  plt.tight_layout()
  plt.savefig('static/plots/' + 'spectrogram.png')
Pitch is psychoacoustic.  Thus, a harmonic frequency can be stronger than the fundamental, without changing the pitch heard.  This is common in some stringed instruments.  And a note's pitch frequency could even be missing from a notes frequency spectrum.  For instance: An old telephone circuit can cut off frequencies below 200 Hz, but people still have no problem recognizing a low male voice pitched at around 100 Hz.

For many timbres, humans will hear the harmonic spacing as the note pitch.  In your plot, the harmonic spacing appears to be around 130 Hz, so that will be the note pitch perceived (if played at the same sample rate at the plot axis suggest).  Not 260.