# Where do harmonics come from?

At first, I thought harmonics come from the signal being periodic. However, we know a sine wave is also periodic but contains a single frequency and no harmonics.

A harmonic for me is a component (pure sine-wave) with a frequency $$f_k = k f_0$$ for some $$k\in \mathbb{Z}$$ and a certain frequency $$f_0$$ called the fundamental frequency. To this, I add the condition that its amplitude is not zero.

We can also imagine the sum of two different frequencies, one is not necessarily the harmonic of the other, and get a periodic signal but no harmonics (according to my definition, which might need correction if it's wrong), just the two frequencies. Below, the result of a simulation where I have the sum of two sine-waves with frequencies 100 Hz and 201 Hz, respectively: $$x(t) = \sin(2 \pi 100 t) + \sin(2 \pi 201 t)$$ The signal is periodic (with a period equal to 1 s) but it does not contain harmonics (again according to my definition!).

Now, I'm wondering what's the real root-cause for harmonics appearing on a signal.

• Hi! Do you know what the Fourier transform / a Fourier series is? Mar 16, 2021 at 14:07
• (generally, harmonics don't "appear" on a signal. They are as much part of a signal as anything else. It's your interpretation that defines what is desired signal content and what is undesired.) Mar 16, 2021 at 14:08
• @MarcusMüller, Yes I know. Mar 16, 2021 at 14:10
• It's a bit hard to understand then where this question comes from. I guess you then know where the harmonics mathematically come from – what's the remaining question then Mar 16, 2021 at 14:19
• @MarcusMüller, Maybe one question at a time :) Say I have a periodic signal. Does this imply that the frequency content is necessarily composed of a fundamental frequency plus its harmonics. Mar 16, 2021 at 14:21

It appears that your understanding of harmonics is not entirely correct yet. Your example of two sinusoids with frequencies $$f_1$$ and $$f_2$$ can actually be explained in terms of harmonics IF

$$f_1=n_1f_0\quad\text{and}\quad f_2=n_2f_0,\qquad n_1,n_2\in\mathbb{Z^+}\tag{1}$$

is satisfied for some positive $$f_0$$. Note that this means that the ratio $$f_1/f_2$$ is rational. In that case the resulting sum is periodic. Choosing the smallest possible integer values of $$n_1$$ and $$n_2$$ such that $$(1)$$ is satisfied will allow you to compute the fundamental frequency $$f_0$$ of the resulting waveform.

In the case of your example we have $$f_1=100$$ and $$f_2=201$$ (units don't matter here). So we get $$n_1=100$$, $$n_2=201$$, and $$f_0=1$$ (same units as $$f_1$$ and $$f_2$$). So the sum is periodic with fundamental frequency $$f_0=1$$, even though the Fourier series coefficient of the fundamental is zero! Hence, we have a periodic signal with two harmonics and no fundamental. Nevertheless, the (fundamental) frequency of that signal equals $$f_0=1$$ (check that!).

With the period $$T=1/f_0=1$$ we have

$$x(t+T)=\sin\big[2\pi\cdot 100(t+T)\big]+\sin\big[2\pi\cdot 201(t+T)\big]=x(t)\tag{2}$$

where the last equality follows from the fact that we add an integer multiple of $$2\pi$$ to the argument of $$\sin(x)$$, which of course has period $$2\pi$$. Note that this doesn't show that $$T$$ is the smallest possible period, i.e., that $$f_0$$ is the largest possible fundamental frequency, but I trust that you can easily verify that.

• You're right, it seems that I still don't fully understand what a harmonic is. Mar 16, 2021 at 17:46
• @sasguy is also saying that "harmonic" might mean different things, which does not help my understanding. Mar 16, 2021 at 17:48
• @Likely: The only ambiguity - as far as I'm concerned - is if the fundamental $f_0$ is the zeroth of the first harmonic. That's it. Mar 16, 2021 at 18:07

At first, I thought harmonics come from the signal being periodic.

That's correct.

However, we know a sine wave is also periodic but contains a single frequency and no harmonics.

This is the only periodic signal that doesn't have harmonics. Or to be precise the amplitudes of all harmonics are zero.

No, I'm wondering what's the real root-cause for harmonics appearing on a signal.

Any periodic signal can be expressed as the sum of discrete sine waves with frequencies that are integer fractions of the period of the signal. For example if the period is 100ms, the frequency would be 10Hz, 20Hz, 30Hz, 40 Hz etc

We just call the frequency which is the inverse of the period the "fundamental" and all others "harmonics". For any periodic signal you calculate the amplitude of the fundamental and each harmonic. Sometimes a specific amplitude is zero, sometimes it's not. Sometimes the amplitude of even the fundamental can be zero. It really depends on the specific shape of the time wave form that get's repeated.

If you look at the same note played by a trumpet, a saxophone, an oboe or a guitar: they all look different and the sound different. The fundamental is the same but the harmonic content makes all the difference here.

The sine wave is just one version of that where the amplitude of all ahrmincs except the fundamental is zero.

• What about the sum of two frequencies (not necessarily harmonics) leading to a periodic signal? Mar 16, 2021 at 14:12
• if you sum two periodic signals, the sum still has periodic components. Don't forget the Fourier transform is linear. You are misusing the word "harmonics", by the way. "Harmonics" in isolation do not exist. They are always "harmonics of something". I really think you might first go back and read up on what a harmonic is. Mar 16, 2021 at 14:20
• For me, the first line of your answer is incorrect. Mar 16, 2021 at 14:50
• @Likely that doesn't matter, math is on my side. Mar 16, 2021 at 14:51

The basic idea is that a periodic sound can have a missing fundamental. e.g. If you mix the right multiples of 110 Hz, a human will hear 110 Hz, whether or not there is any non-zero 110 Hz sinusoidal component in the mix (via FT or DFT). So all those multiples are still called the same thing: harmonics.

Where do they come from: lots of physical objects/systems have lots of harmonically related resonances, but you can damp the lowest one to zero, and still hear the rest at some missing fundamental frequency, due to psychoacoustic processes in the human ear/brain. So, in that physical situation, they were always there, no need to “come from” the fundamental periodicity.

Yet another way to generate harmonics is to pass even a pure sinusoid through a (usually time invariant) non-linear channel, such as a comparator, or an overdriven tube guitar amp.

I think that maybe there is a mis understanding in your question. The harmonics doesn't appear in every signal. Usually they appear because the main frequency excite a natural frequency (resonance) or because there is any other physical phenomena involved in its generation.

We can also imagine the sum of two different frequencies, one is not necessarily the harmonic of the other, and get a periodic signal but no harmonics, just the two frequencies

No this is not true. If you eventually have a periodic signal (which meets Dirichlet Conditions) from their sum, then those two sine waves must be harmonically related, at the period of the combined signal.

Besides, you cannot freely assume that the sum of two arbitrary sinusoidals will always be periodic: They may not have a common period; their sum may then be non-periodic.

The following is a continuous-time example: Let the two periodic signals be $$x_1(t) = \cos(\sqrt{2} t)$$ and $$x_2(t) = \cos(\frac{5\pi}{7} t)$$; then their sum

$$x(t) = \cos(\sqrt{2} t) + \cos(\frac{5\pi}{7} t)$$

will not be periodic; i.e., there exist no real number $$T_0$$ such that $$x(t+T_0) = x(t)$$ for all $$t$$.

Hence those two sinusoidal signals are not harmonics of each other. But that's not a problem because the combined signal is already not periodic anyway. If you can find that real number $$T_0$$, then $$x_1(t)$$ and $$x_2(t)$$ will be harmonics of each other.

And this also explains the root cause of Harmonicity; it's a mathematical adjective which describes the condition of two (or more) sinusoidals being related by a common period; the period of their sum. The Fourier analysis of periodic signals by default defines the set of harmonically related decomposition of the given periodic signal at its fundamental period.

Eventhough harmonics do not originate from physical causes, eventually, individual harmonic components (predicted by Fourier analysis) of periodic signals can be processed independently by means of LTI frequency selective filtering operations.

• Will the sum of 2 sinusoids with frequencies 10 Hz and 20 Hz give a periodic signal? If yes, then why there aren't any harmonics. Mar 16, 2021 at 15:01
• Yes, the sum of 10 Hz and 20 Hz sine waves will be periodic. Their fundmental period is 1/10 s (the period of 10 Hz component) . Eventually, the first component will be the fundamental and the second component will be the first harmonic of it. All other harmonics will be zero. So there are only two harmonics, the fundamental and the first. Mar 16, 2021 at 15:07
• Is it correct to say that a signal being periodic is a necessary and sufficient condition for it to have a harmonic content (a certain fundamental frequency + its harmonics)? Mar 16, 2021 at 15:44
• I simulated a sum of 2 sine waves with frequencies 100 Hz and 201 Hz and I got a periodic signal. Would you call 201 Hz a harmonic of 100 Hz? Mar 16, 2021 at 15:49
• @Likely if a periodic signal meets the Dirichlet Conditions, then it will have a harmonic expansion on Fourier bases, and thus it will have harmonic components. For a single sine wave, the harmonic is itself, for a sum of N sine waves, (prvided the sum is periodic) you will have N harmonics. 100 Hz and 201 Hz signals will be paeriodic with a fundamental frequency of 1 Hz. In that case the fundamental is missing but the 100th and 201st harmonics exist only. Mar 16, 2021 at 15:58

There are two meanings of harmonics that may be confused. One is the mathematical, where in a Fourier expansion of any periodic signal (actually one satisfying Dirichlet conditions, as was pointed out), any components in the expansion with frequency an integer multiple of the frequency of repitition of the signal, might be understood to be a harmonic of the signal.

On the other hand in audio and radio applications of signal analysis, you might refer to harmonics of a signal as anything produced by a nonlinear channel on the signal. Amplitude limiting, rectification, quantization, etc. will introduce components outside the band of the original signal. In gun-slinging engineering terms, those components would be referred to as harmonics, harmonic distortion, or distortion if the energy is at frequencies that are not a multiple of a component of the signal.

• For me there's actually no real difference between the two definitions. Nonlinear (time-invariant) devices add harmonics, which are just frequencies at integer multiples of the fundamental frequency. So your Fourier series expansion changes, but that doesn't change the definition of harmonics. Mar 16, 2021 at 18:22
• Arbirary non-linearities produce frequency components that are not necessarily integer multiples of the fundamental. In a Fourier expansion, the components are always integer multiples of the fundemental. Mar 26, 2021 at 23:29

Below, the result of a simulation where I have the sum of two sine-waves with frequencies 100 Hz and 201 Hz, respectively: $$x(t) = > \sin(2 \pi 100 t) + \sin(2 \pi 201 t)$$ The signal is periodic (with a period equal to 1 s) but it does not contain harmonics

Yes it does. It is a 1 Hz periodic signal that only contains the 100th and 201st harmonics.