# What gives a square wave harmonics, and not a sine wave?

A square wave has an intense amount of harmonics, producing a bright sound. But a sine wave has none, and is a dull sound.

Why does the square wave create harmonics and not a sine wave?

• Dec 18, 2018 at 7:46
• @Timinycricket thank you for the link! I would suggest marking this question as a duplicate of that question, the answer there is great. Dec 18, 2018 at 16:37
• I don’t think the questions are similar but the answer to yours is contained in the answer to that one Dec 19, 2018 at 2:49

You're looking at it the wrong way round.

The square sounds like it does because it is made up of a fundamental frequency and a series of harmonics, whereas the sine wave just has the fundamental frequency.

A square wave has harmonics at odd multiples of the fundamental frequency.

Sine waves (strictly speaking sine/cosine quadrature pairs) are the principal components of many signals, the main reason being that they are the Eigenfunctions of linear timeshift-invariant systems which many systems in reality are essentially or to first order approximation.

That means that a sine wave, filtered through such an LTI system, will result in another sine wave of equal frequency but possibly different phase and amplitude.

For that reason, sine wave audio signals suck for directional hearing since all you get to hear, regardless of attenuation or reverb, is another sine wave (though with possibly different amplitude and phase on either ear). You get much better locateability by superimposing sine waves at numerous frequencies with fixed phase relations. Square waves are such a superposition.

You can both represent sine waves as a superposition of square waves and vice versa, but it is only the sine waves that, for each particular frequency, are maintaining the same shape and frequency when passed through LTI systems.

So it makes more sense to represent signals as superpositions of a fundamental sine wave and harmonic multiples than in any other manner.

Now mechanical oscillators like strings and air columns (in flutes) have modes they resonate with, basically Eigenstates of the oscillator that will recur periodically, a certain configuration of mechanical energy. More often than not those modes result in first order approximation in proper harmonics, oscillations with an integral multiple frequency of that of the fundamental oscillation. But for things like thick strings or sounding bars, the first order approximation is not good enough and the modes are noticeably detuned from proper harmonics. This is typically experienced with the thick strings from a piano, an effect known as "disharmonicity" and somewhat accounted for by "stretch tuning".

Firstly, an ideal sine wave has one constituent frequency. One harmonic1.

Secondly, to answer this question, we first need to learn some basics about harmonics in general (Don't worry, I'll just skim the basics for those who are unsure).

## The Sine Wave

A sine wave is the least complex waveform; representative of the most simple oscillation. We can assign to it three values; amplitude, frequency and relative phase (this last one is only relevant when we add more waves).

Any soundwave can be broken down, or deconstructed, via FFT2, into a collection of these simple sine waves at different amplitudes, frequencies and (relative) phases. Conversely, we can synthesize any sound by adding these pure tones together at specific amplitudes, frequencies and phases. Those constituent frequencies would interact to form the resulting waveform's harmonic and inharmonic partials (part-waves of the parent wave).

This GIF demonstrates the adding of sinewaves at specific harmonic frequencies to produce a square wave The further a wave deviates from an ideal sine wave, the more partials will be present in the analysis (or, the more sine waves would be needed to synthesize the wave - if that makes it easier to understand).
That is the basic explanation of why a square wave has more harmonics than a pure sine wave.

## A Note on Timbre

Note that, the quality that gives the same musical note a different sound when played on different instruments is called "Timbre" (Pronounced "Tambuh" or "Tambruh"). The timbre changes as the relative amplitude of the note's overtones3 (overtone partials start at 2nd harmonic) change (and so the wave shape also changes). So two different notes can have the same pitch, the same harmonic content, but can sound and look very different. A square wave, for example, has (ideally) no even harmonic partials4. This is what gives the square wave that well-known "hollow" sound. A square wave has a distinct timbre.

I won't go into any more detail than that, I think it should be enough for you to do some research if you wish to learn more.

Common Misconceptions:

• The fundamental frequency is not a harmonic
The fundamental is not an overtone, but it is the first harmonic partial (at 1:1 relative amplitude and frequency)
• The fundamental frequency is not always the lowest harmonic
The fundamental is always the lowest harmonic, but not always the most prominent harmonic, neither is it always the perceived pitch
• Harmonic frequencies are always exact integer multiples of the fundamental frequency
This is wrong. For example, while in university, I wrote an analysis of the harmonics produced by a grand piano, and found that as the strings became very short, they started acting like solid bars, causing the harmonics intervals to stretch slightly5. This is why piano tuning is a fine art. In practice, harmonic intervals are often not exact integer multiples of the fundamental frequency. Things like phase and the physics of the physical medium can affect harmonic intervals.

Wikipedia References
1 Partial, Harmonic, Fundamental, Inharmonicity, and Overtone
2 Fourier Analysis
3 Overtone
4 Square Wave - Fourier Analysis
5 Mersenne's Laws (re: stretched harmonics)