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)

The plot.py module:

import matplotlib.pylab as plt

def plot_spectrogram(stft_output, xlabel='Time', ylabel='Hz'):
    ref=np.max), y_axis='log', x_axis='time')
  plt.title('Power Spectrogram')
  plt.colorbar(format='%+2.0f dB')
  plt.savefig('static/plots/' + 'spectrogram.png')

Generally, the amplitude of each harmonic including the fundamental depends on the physics of the instrument. Harmonics that are close in frequency to the vibrational modes (i.e. where the frequency response of the instrument exhibits a peak) will be higher. It could happen that the highest hamronic is not the first one (the fundamental frequency). For example, in the open G string of the violin the fundamental frequency has a very low (almost zero) amplitude, because there are no vibrational modes near 192 Hz. For this reason, the amplitude of each harmonic depends on the played note. I think that it could happen for every instrument that, for a particular note, the fundamental is not the strongest one.

Please note that in your picture the fundamental frequency is the one near 128 Hz. You can verify it by checking that the frequency step between contiguous harmonics is about 128 Hz. In this case it appears to be the strongest one in terms of amplitude but, as I said, it could happen that it is not.

  • $\begingroup$ Thanks. Please see updated question. Why do you think B3 is not the strongest frequency in the spectrogram? $\endgroup$ – pavlos163 May 16 '17 at 14:23
  • $\begingroup$ I edited the answer. Are you sure that you recorded a B3 and not a B2? $\endgroup$ – firion May 16 '17 at 14:30
  • $\begingroup$ Yes, I added the audio file. $\endgroup$ – pavlos163 May 16 '17 at 14:40
  • $\begingroup$ I also added the code used to generate the spectrogram. $\endgroup$ – pavlos163 May 16 '17 at 14:43
  • 1
    $\begingroup$ There is a problem with your spectrogram. You specified a sample rate of 40000 but actually it is 22050. That's why displayed frequencies are wrong! $\endgroup$ – firion May 16 '17 at 14:55

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.

  • $\begingroup$ But B3 is the note played (perceived pitch should be 246Hz) $\endgroup$ – pavlos163 May 16 '17 at 14:51
  • $\begingroup$ Not if you play what you plotted. $\endgroup$ – hotpaw2 May 16 '17 at 14:58
  • $\begingroup$ You are right! So, in which cases in the guitar could a harmonic be stronger than the fundamental? Is it when playing high or low notes or that does not play any role? $\endgroup$ – pavlos163 May 16 '17 at 15:02
  • $\begingroup$ Depends on the guitar (shape, material, construction, bridge, etc.), string type, which string, fretting, how the string is plucked, and the 3D acoustic radiation pattern's relationship to the mic (or ear) placement. Weak fundamentals are somewhat more common in the lower notes of large stringed instruments. $\endgroup$ – hotpaw2 May 16 '17 at 15:06

The note/pitch is determined only by the first frequency peak on the DFT plot. All the other amplitudes are called harmonics that only add to the timber. These harmonics (timber) are what differences a guitar note, for example, from a note on a violin.

  • $\begingroup$ -1 Sid. there are some notes with missing fundamentals. you cannot assume there is sufficient energy at the fundamental frequency that it will show up as "the first frequency peak on the DFT plot." the only thing you can assume is some degree of periodicity. we call these functions quasi-periodic: $$ x(t+P) \approx x(t) $$ for $P$ being the period and $$f_0 \triangleq \frac{1}{P}$$ being the fundamental frequency. $\endgroup$ – robert bristow-johnson Jan 21 '18 at 1:48

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.