Site map  

Harmonics

Harmonics are whole multiples of a frequency. For instance, the harmonics of 110 Hz are 220, 330, 440, 550 Hz, etc.
The relationship with musical instruments explained on Wikipedia: Harmonic.
Below more synthetic waves:

Sawtooth wave

Sawtooth wave

A sawtooth wave can be 'build' adding sinusoidal waves. The amplitude of the harmonics is inverse proportional to their frequency;

sin(x) + 1/2 sin(2x) + 1/3 sin(3x) + 1/4 sin(4x) etc.

Where 'x' varies in time to generate a sinusoidal wave.

The image below shows the first nine harmonics being added one by one.
Sawtooth wave hamonics
As you can see the wave looks a bit 'wrinkled'. Adding more harmonics will make the wave look nicer, but the wrinkly bits never go away completely. The image below shows a sawtooth with 50 harmonics;
Sawtooth wave with 50 harmonics

A Video (with sound) of a 440 Hz sawtooth wave with the first 10 harmonics being added one by one.
Real live sawtooth waves look nicer than this. They have more harmonics and the highest harmonics are a bit weaker than in the 'recipe' above. This makes them kind of smooth.

With LPF

Here all the harmonics are present all the way up to halve the sample frequency. The signal is passed through a 24 dB/Oct low-pass filter. The cut-off frequency is increased to multiples of the first harmonic in nine steps.
Saw thooth wave with LPF

A Video of the cut-off frequency being increased in 10 steps; From 440 Hz to 4400 Hz.
This is actually a bit more like something you may encounter 'in the wild'.

Square wave

Square wave

A square wave is like a sawtooth, but only contains odd harmonics;

sin(x) + 1/3 sin(3x) + 1/5 sin(5x) + 1/7 sin(7x) etc.

The image below shows the harmonics three to nine being added one by one.
Square wave harmonics

The image below shows a square wave with 49 harmonics;
Square wave with 49 harmonics

A Video of a 440 Hz square wave with harmonics three to nine being added one by one.

With LPF

Here all the harmonics are present all the way up to halve the sample frequency. The signal is passed through a 24 dB/Oct low-pass filter. The cut-off frequency is increased to multiples of the first harmonic in nine steps.
Square wave with LPF

A Video of the cut-off frequency being increased in 10 steps; From 440 Hz to 4400 Hz.

Harmonics expressed as other notes

The frequencies of some harmonics are pretty close to the frequencies of other notes. The table below shows how much;

Harmonics of a particular note as other notes
Harm0 1234 5678 9101112 %
1C₁ C♯₁D₁D♯₁E₁ F₁F♯₁G₁G♯₁ A₁A♯₁B₁C₂ 0
2C₂ C♯₂D₂D♯₂E₂ F₂F♯₂G₂G♯₂ A₂A♯₂B₂C₃ 0
3G₂ G♯₂A₂A♯₂B₂ C₃C♯₃D₃D♯₃ E₃F₃F♯₃G₃ -0.11
4C₃ C♯₃D₃D♯₃E₃ F₃F♯₃G₃G♯₃ A₃A♯₃B₃C₄ 0
5E₃ F₃F♯₃G₃G♯₃ A₃A♯₃B₃C₄ C♯₄D₄D♯₄E₄ 0.79
6G₃ G♯₃A₃A♯₃B₃ C₄C♯₄D₄D♯₄ E₄F₄F♯₄G₄ -0.11
7A♯₃ B₃C₄C♯₄D₄ D♯₄E₄F₄F♯₄ G₄G♯₄A₄A♯₄ 1.78
8C₄ C♯₄D₄D♯₄E₄ F₄F♯₄G₄G♯₄ A₄A♯₄B₄C₅ 0
9D₄ D♯₄E₄F₄F♯₄ G₄G♯₄A₄A♯₄ B₄C₅C♯₅D₅ -0.23
10E₄ F₄F♯₄G₄G♯₄ A₄A♯₄B₄C₅ C♯₅D₅D♯₅E₅ 0.79
11F♯₄ G₄G♯₄A₄A♯₄ B₄C₅C♯₅D₅ D♯₅E₅F₅F♯₅ 2.75
12 G₄G♯₄A₄A♯₄ B₄C₅C♯₅D₅ D♯₅E₅F₅F♯₅G₅ -0.11
13G♯₄ A₄A♯₄B₄C₅ C♯₅D₅D♯₅E₅ F₅F♯₅G₅G♯₅ -2.37
14 A♯₄B₄C₅C♯₅ D₅D♯₅E₅F₅ F♯₅G₅G♯₅A₅ A♯₅ 1.78
15B₄ C₅C♯₅D₅D♯₅ E₅F₅F♯₅G₅ G♯₅A₅A♯₅B₅ 0.67
16C₅ C♯₅D₅D♯₅E₅ F₅F♯₅G₅G♯₅ A₅A♯₅B₅C₆ 0
17C♯₅ D₅D♯₅E₅F₅ F♯₅G₅G♯₅A₅ A♯₅B₅C₆C♯₆ -0.29

The percentage in the last column shows how close the frequency is;

               frequency tone - frequency harmonic
Percentage =  ───────────────────────────────────── * 100 %
                        frequency tone

The above table can also be used to work out approximate frequency ratios.
E.G.:

 C : G ≈ 2 : 3
 C : E ≈ 4 : 5
 E : G ≈ 5 : 6

Etc.