# Understanding sawtooth wave harmonics

I've been playing synthesizers for a while and I'm trying to understand their math and electronics better.

The sawtooth is one of the three common waveforms on most subtractive synths. The waves are generated by one or more VCOs and are modulated through LFOs and other sources, and we finally use some filters to remove certain frequencies and get the desired sound. I more or less understand the way these filters work, however what I don't understand is how does a sawtooth wave come to have any harmonic content at all? They way I see it, there is nothing there to be filtered except for the wave's fundamental frequency.

I'm assuming the answer to this depends on how the wave is built. If it's built additively by summing up different sinusoids then I can see how the different "frequencies" are present. However, per my understanding, we normally don't build an "analog" waveform like this, we rather slowly charge up a capacitor and then discharge it to get a ramp-like wave.

Now I know that this shape can also be mathematically "approximated" as a summation of sine waves through a fourier transform, and the transform is applicable regardless of how the wave is built, but I don't see how the possibility of such a decomposition results in those harmonics "actually", not mathematically, being present in the wave; they were simply not there to begin with.

So the question is, how it is that there are different harmonics in a sawtooth that we can filter with filters later? Don't hesitate to correct my understanding of how the sawtooth is built in the first place and please explain the electronics as simply as possible, I've never been really good in this stuff.

Update:

I think what I find most confusing or counter-intuitive is that the harmonics suggested by the fouriers series for the sawtooth function actually exist and are not just a mathematical abstraction.

• Darth, what really sings to me when I'm struggling to understand a modern result is to go back to the moment when the modern result was first uncovered. In this case, it's heat flow and Joseph Fourier's struggles trying to solve a problem presented to him "back in the day." There are two adjacent parts of a video series, Part 3, Solving the heat equation and Part 4, But what is a Fourier series? From heat flow to drawing with circles that particularly capture the exact reasoning behind sine and cosine here. Please watch.
– jonk
Commented Jul 17, 2021 at 23:56

## 3 Answers

They way I see it, there is nothing there to be filtered except for the wave's fundamental frequency.

If that was the case, you would only have a cosine with the fundamental frequency. Any periodic signal that's not just a cosine is composed of a sum of them.

I'm assuming the answer to this depends on how the wave is built.

No! The spectrum of a signal is property of the signal, no matter how you constructed that signal: same signal, same harmonics.

Don't hesitate to correct my understanding of how the sawtooth is built in the first place

It doesn't matter how it's built - a sawtooth has exactly the harmonics every sawtooth has :)

Thing is relatively straightforward: "harmonics" are harmonic oscillations (that means cosines) that are at multiples of the fundamental frequency.

What you are looking to understand is the Fourier series; I was about to write a short introduction here, but realized my phone's swipe keyboard suggests you'll be happier with one of the thousands of introductions to Fourier series, Fourier analysis and the Fourier transform that you can find. Start in Wikipedia!

• I'm assuming your answer means that the harmonics decomposition given by the fourier series actually exists, e.g if the fourier series of a function says some frequencies are present, then those frequencies are "inherently" present in the signal and are not just a mathematical thing, right? I've always found this very counter-intuitive. Commented Jul 17, 2021 at 23:27
• @Paghillect Try listening to a sawtooth waveform. They very audibly contain higher frequencies beyond the fundamental, so yes the harmonics are real and you can hear them with your own ears. To make it really obvious, try a 10 Hz sawtooth wave where the fundamental is inaudible but the KHz harmonics are not. Commented Jul 18, 2021 at 1:22

Figure 1. The first five harmonics of the triangle wave and its result. Image source: gfycat but I am unable to find the credit the creator.

I don't understand is how does a sawtooth wave come to have any harmonic content at all? They way I see it, there is nothing there to be filtered except for the wave's fundamental frequency.

No, the fundamental would just be a sine or cosine wave. What Fourier is telling you is that any period wave can be created by a fundamental and its harmonics.

However, per my understanding, we normally don't build an "analog" waveform like this, we rather slowly charge up a capacitor and then discharge it to get a ramp-like wave.

Consider the squarewave. You're syth will generate this by simply switching between two voltages yet it is composed of harmonics despite you not having built it of sinewaves.

Figure 2. This fabulous illustration of the Fourier Transform by Lucas V. Barbosa on Wikipedia's Fourier transform page shows the transformation of a periodic waveform from the time domain to the frequency domain. The frequency plot shows the relative strength of the harmonics with clarity that could not be obtained from staring at the time plot.

• It should be apparent that the more square the time domain waveform is then the more harmonics you will have and these should be visible in the frequency domain.
• It should also be clear that the amplitude decreases with the increasing frequency.

The process is reversible (if that's the right term) in that you can construct a waveform using harmonically related sinewaves (which would be a form of additive synthesis) or you can generate the waveform electronically and modify the harmonic content by filtering.

Figure 3. There is a fantastic video, What is a Fourier Series? on YouTube by Smarter Every Day which you may find instructive.

If you generate a sawtooth wave with fundamental frequency of say 1000 Hz, it repeats the ramp with slow and fast edges 1000 times per second.

Now, if you generate a sine wave with fundamental frequeny of same 1000 Hz, it's a sine wave that repeats 1000 times per second as it has no harmonics.

Therefore, since a 1000 Hz sawtooth does not look nothing like a 1000 Hz sine wave, it must have other frequencies as well, as the ramp rises and falls faster than a sine wave does.

So in real life, a sawtooth wave is very useful as one of the basic waveforms in subtractive synthesizers, as it consists of odd and even harmonics of the fundamental frequency, that can be later filtered out to produce a suitable timbre.

You might be interested in looking the Wikipedia page for sawtooth wave here.

Another way to look at it is in the frequency domain. A single sine wave at 1000 Hz is energy existing only at single frequency in the frequency spectrum. And no energy at no frequency means there is no signal at all. Therefore, a signal that is not a single sine wave, must have multiple sine waves superimposed, so it will have a frequency spectrum with amplitudes defining how much energy there is at various frequencies in the spectrum, i.e. multiple sine waves at different frequencies and amplitudes.

• The "[Therefore, since a 1000 Hz sawtooth does not look nothing like a 1000 Hz sine wave, it must have other frequencies as well]" part was very instructive to me. Commented Jul 17, 2021 at 23:34