opyeb WaveLab

Guides · Fourier

Sawtooth and triangle: 1/n against 1/n²

Basis 28 Nov 2026 · Fourier analysis · 6 min read

Sawtooth and triangle are close relatives with a decisive difference in how fast their harmonics fade. The sawtooth contains every harmonic with amplitude 1/n; the triangle contains only odd harmonics with amplitude 1/n². At the fifth harmonic that is 0.2 V against 0.04 V — a 14 dB gap that only widens.

saw: y = (2/π) Σₙ₌₁^∞ sin(nωt)/n, triangle: y = (8/π²) Σ_{n odd} (−1)^((n−1)/2) sin(nωt)/n²

The sign that looks like phase

The triangle's alternating sign is the reason its third, seventh and eleventh harmonics carry a 180° phase in the synthesiser. A negative coefficient is the same sinusoid shifted by half a period, so the bench stores it as phase rather than as a signed amplitude. If you clear that phase by hand — set harmonic 3 to 0° instead of 180° — the waveform stops being a triangle and becomes a shape with a much sharper edge, even though the amplitude spectrum is identical. Amplitude alone does not determine a waveform.

Bandwidth and perceived brightness

Brightness follows the high-frequency content, roughly the amplitude at 2–5 kHz. At 220 Hz, harmonic 9 sits at 1.98 kHz: the sawtooth puts 0.111 V there and the triangle 0.0123 V, a 19 dB difference. A listener hears the sawtooth as buzzy and the triangle as a soft flute-like tone, and a spectrum analyser shows exactly that slope.

HarmonicFrequency at 220 HzSawtoothTriangle
1220 Hz1.000 V1.000 V
3660 Hz0.333 V0.111 V
51.10 kHz0.200 V0.040 V
71.54 kHz0.143 V0.020 V
91.98 kHz0.111 V0.0123 V
112.42 kHz0.0909 V0.00826 V

Distortion figures

The sawtooth's THD at twelve harmonics is √(Σ_{n=2}^{12} 1/n²) = 0.752, or 75.2 %. The triangle's is √(1/81 + 1/625 + 1/2401 + 1/6561 + 1/14641) = 0.121, or 12.1 %. A higher THD number is not a defect here: both are exact periodic shapes, and THD simply measures how much of the energy is not at the fundamental.

THD says nothing about which harmonics are responsible. Two signals with 12 % THD can sound entirely different if one puts the energy in the second harmonic and the other in the eleventh.

Practical consequences

A sawtooth is a good test signal for a filter sweep because its 1/n series has energy at every harmonic, so you hear the corner move. A triangle is a better probe for differentiating circuits: if a triangle comes out looking like a square, the differentiator is working, and the 1/n² spectrum tolerates bandwidth limits far better. Both are cheap to generate: integrate a square to get a triangle, or integrate a zero-mean pulse train to get a sawtooth.

In the synthesiser, switch between Saw and Triangle at the same f₀ and watch the lower canvas. The fundamental bar is identical; every bar after it is much shorter for the triangle, which is the entire difference between the two sounds.

Questions

Why does the triangle have phase 180° on some harmonics?

Its series alternates sign every odd term. A negative amplitude is a half-period shift, and the bench expresses it as phase so that amplitudes stay positive and comparable.

Which is closer to a real bowed string?

Neither exactly. A bowed string is closer to a sawtooth in harmonic slope, while a flute or a clarinet is closer to a triangle or a square because its odd-harmonic emphasis comes from the air column. Real instruments also shape each harmonic's phase, which no single preset captures.

Compare the two presets at 220 Hz and read the amplitude of harmonic 9 in each.

Open the studio

Written from standard Fourier analysis, digital signal processing and acoustics; the worked numbers can be reproduced in the studio linked above.

Back to the guides