Spectrum falling off as frequency increases

# Why do harmonics (almost) always roll off?

Published on January 22, 2019

There is a book out there on harmonics, I'm not going to bother looking for it again, but it's \$435 a copy, written by a PhD and it's wrong! I found one of the chapters on Google Books and it said something to this effect: The second harmonic is due to second order effects, the third harmonic is due to third order effects, the fourth harmonic is due to.... yeah, you get the idea. So obviously harmonics are going to roll off. I mean, how far can this go, the 2 millionth order effect? Come on!

Obviously this is crap (and for \$435 a copy!). The amplitudes of harmonics are clearly defined by the Bullard Laws of Harmonics, and just like Newton's Laws of Motion, anytime you have a question about how something works, read the law. Like, when I step off my boat onto the dock, why does the boat seem to move away from the dock? For each action, there is an equal and opposite reaction, Third Law. How does SpaceX get stuff into space? Third Law. So which law tells us why harmonic amplitudes generally roll off as the frequency increases? Let's discuss it.

Often, when the answer to a question eludes us, the answer is that we are asking the question wrong. When I was trying to save my reputation and solve the answer to the 70 year old question, where do harmonics come from, I asked myself that if Audio Precision's guesstimation that "Symmetrical distortion causes Odd harmonics" was right, why is it right?. As I point out in my books, Distortion and Harmonics, the problem with this question is that it's the wrong question, because the statement that Bob Metzler made back in 1992 is wrong. Anybody who looks at any kind of distorted spectrum can see that both symmetrically and asymmetrically distorted waves contain Odd harmonics, so the question is not why symmetrical distortion causes Odd harmonics, almost all distortion creates Odd harmonics (proving Audio Precision's statement false) but the real question is, why don't Even harmonics appear in symmetrically distorted waves?

So, in asking why harmonics generally roll off as the frequency increases, you are asking the wrong question. The solution is to ask it the other way around. Why, given that the spectrum of an impulse (a very low duty cycle rectangular wave) is flat, why do the lower harmonics increase in amplitude as the duty cycle increases? Let's look at two examples from the books. First, the time domain, then the frequency domain of a single sample impulse wave.

The spectrum of a perfect impulse is flat as a pancake, and this is only the first 107 harmonics. Every harmonic out into the TeraHertz range is exactly the same amplitude, -54dB in this case. Of course, in real life, you can't prove this, because as I learned (and you should have learned by now) the world is a low pass filter. Ask the guys at Intel what they are fighting to get the bus rates up. Yep, bandwidth. they want more of it. That's the only way to get data speeds up. So while your spectrum analyzer can't actually be trusted to give you the truth, the math can. Do an FFT on a single high point amid a field of zeros and you get a totally flat spectrum as far as your FFT can take you.

Now, I used to work with a guy who thought he was God's gift to the world (remind you of anyone) and he said that everyone should use an impulse to test filters, because if you send an impulse into a filter, capture the output and do an FFT on it, you get the filter response directly, no screwing around. There is only one problem with this idea, an impulse has almost no energy, making this technique almost unusable. In fact, the more points you make your time domain data from, the lower the energy of the impulse. Excel limits FFTs to 2048 samples, but if you use another tool and increase the number of samples, the single point impulse will lose more and more energy as you increase the number of samples, it's just simple common sense.

But at least it's flat, and that is a good place to start. Now, what happens if we increase the pulse width so we can test our filter with more energy?

So I widen the impulse to 13 points instead of 1, now it has more energy, and the amplitudes of the lower harmonics increase in amplitude. And while it helps increase the signal to noise ratio for my filter test, it also causes a roll-off which interferes with my pristine flat spectrum, making it no good for filter testing. But wait, we just learned something! By increasing the duty cycle of the rectangle wave from a single point impulse to a 13 point impulse, something happened. By increasing the number of samples high, making the impulse wider, we increased its energy. When we did that, like when we stepped off the boat, we invoked a law, "Harmonic amplitudes are proportional to the area of the distortion." The higher harmonics did not change amplitude, they remain at low amplitudes. In fact, remember that in these spectral plots, I only go out to the 107th harmonic, but the spectrum actually goes out to the 1023rd harmonic in bin 19,437, which of course does not exist in a 1025 point spectrum, but it does if you learn to use aliasing! Take a wild guess what the amplitude is in bin 19,437. Here is a plot where I sorted through the last fifty two bins and found the aliases right up to the final harmonic, the 1023rd in bin 1005, aliased from bin 19,437.

This plot shows the last 52 harmonics before the end of the spectrum, from the 971st harmonic, in blue on the far left, to the 1023rd harmonic, in blue at the far right. What’s the level? -54dB, just like when the impulse was a single sample wide. You can see it rising up from -60dB, that is the effect from the sine function changing the harmonic amplitudes of a rectangle wave. But with a single impulse, the sine function flattens the spectrum out completely. Only when the width of the impulse is greater than one sample does the sine function have any effect. So now that the impulse is 13 samples wide, the roll-off we saw before turns out to be just the very beginning of a hump that arches over and over and over again to end here at the 1023rd harmonic back at -54dB

Let’s do another one, just to make sure. Here I create a 12% duty cycle rectangle wave, which I have used in previous articles. First the time domain, then the spectrum.

Again, notice how the harmonics hump over and over in a descending trajectory. The humping is due to the sine function that defines the spectral nature of square and rectangle waves. But how does it end? What does the other end of the spectrum look like? One last plot, the far end of the spectrum, from the 971st harmonic to the 1023rd harmonic.

And there it is, humping over and over, at what level? Yep, -54dB, just exactly the same level as we saw in the single impulse. OK, not to be annoying but this is just too much fun, so one more, this time a 50% duty cycle square wave. You should know this one well by now.

There we see only Odd harmonics falling off at (as you should remember) at 1/harmonic#. Now here is a rare opportunity, we know this spectrum well, so once again, how does it end? Here’s the plot for the last 52 harmonic bins, although you will only be able to count 27 harmonics.

Notice that all the Even harmonics are gone. Where did they go? Do I need to say it again? Law #3, meaning that the energy is there, but not visible. And what level are the Odd harmonics at? -54dB, just like when this wave was a single impulse.

So it’s not that the higher harmonics roll off, what happened was that as we increased the duty cycle of our of our rectangle wave, the area increased, and that increased the amplitudes of the lower harmonics, including harmonic #1, the fundamental. Again, the higher harmonics didn't roll off, the lower harmonics obeyed Bullard Laws of Harmonics #1 so when the area of the wave increased, the lower harmonic amplitudes increased, leaving the higher harmonics at low amplitudes (with the addition of the effects of the sine function on them from Law #2). But while the area of the wave increases, the two super fast edges that made up our impulse are the same, and so the very high harmonics that are responsible for those edges haven't changed at all. Increasing the width of the pulse causes the lower harmonics to increase in amplitude, but the higher harmonics are fixed at this very low amplitude, the same low amplitude that made the impulse useless for testing filters.

So the lesson is this: Trust the LAW. When you step off a boat, remember Newton or you'll end up in the drink. And when someone asks you why harmonics roll off as the frequency goes up, tell them that's not what is happening, higher harmonics have less area than the bigger, fatter features that create more lower harmonics, ramping them up as the frequency decreases. Remember, it's the law.