Square vs triangle wave: odd harmonics done two ways

Square and triangle both have only odd harmonics, but the triangle's harmonics decay much faster, so it sounds softer. Same pitch, same harmonic series, different character because of the decay rate.

Buzz versus mellow, both using only odd harmonics.

Square and triangle waves both contain only odd harmonics, but they sound nothing alike. A square wave's harmonics fall off slowly (1/n), so the upper harmonics stay strong and the tone reads as bright and buzzy. A triangle wave's harmonics fall off faster (1/n-squared), so the upper harmonics fade quickly and the tone reads as soft and mellow. Same pitch, same harmonic series, completely different character because of the rate of harmonic decay.

By TechCompare · Updated

Try this comparison with our tools

Frequency Generator

Your browser does not support the Web Audio API.
A
Preset A
440 Hz square
Preview
B
Preset B
440 Hz triangle
Preview

Open the full Frequency Generator ↗

Option A
Square wave
Wins 1 of 6 compared specs
Option B
Triangle wave
Wins 0 of 6 compared specs

Side-by-side specs

SpecSquare waveTriangle wave
Fundamental frequencySameSame
Harmonic contentOdd harmonicsOdd harmonics
Harmonic decay rate1/n (slow)1/n-squared (fast)
RMS at peak 1.01.0 (better on this spec)0.577
CharacterBuzzy, brightMellow, soft
Best forSynth leads, chiptunePads, soft modulation

How they differ

Both shapes are built from odd harmonics - the fundamental plus the third, fifth, seventh, and so on. The square wave amplitudes follow 1/n (one over the harmonic number), so the third harmonic is at one-third the fundamental amplitude. The triangle wave amplitudes follow 1/n-squared, so the third harmonic is at one-ninth the fundamental amplitude. That faster decay is what makes the triangle wave softer - the upper harmonics that give the square wave its buzz are negligible. A triangle wave is also closer to a sine in perceived loudness at the same peak amplitude (RMS 0.577 versus 0.707 for sine, 1.0 for square), so it sits between the two extremes in both timbre and loudness.

Verdict

The triangle wave is a square wave with most of its upper harmonics suppressed. Use a square wave when you want buzzy character, a triangle wave when you want the same odd-harmonic structure but softer, or a sine when you want no harmonics at all.

Hear square vs triangle at 440 Hz

Which should you pick?

Choose Square wave

Pick a square wave when the buzzy, brass-like character is what you want: synth leads, chiptune patches, harmonic-distortion tests.

Choose Triangle wave

Pick a triangle wave when you want the odd-harmonic flavor without the harshness: synth pads, soft flute-like tones, gentle modulation sources.

Related comparisons