A sawtooth wave is the asymmetric ramp that rises linearly from −1 to +1 (or vice versa) across the full period, then snaps back instantly to the start. Of the four classical waveforms — sine, triangle, square, sawtooth — the sawtooth is the brightest: it contains every integer harmonic of the fundamental, with the slowest 1/n amplitude roll-off. The instantaneous jump at the end of each cycle is what generates that wide harmonic content.
The amplitude rule
For the bipolar sawtooth f(t) = 2t/T − 1, the Fourier series collapses to |Hn| = 2 / (πn) for every n ≥ 1, with sine-only phase (no cosine content). H1 sits at 2/π ≈ 0.637, H2 at 1/π ≈ 0.318 (−6.02 dB), H3 at −9.54, H10 at −20, H100 at −40 dB rel H1. Compare this to the square wave's odd-only 4/(πn) and the triangle's odd-only 8/(π²n²) — the sawtooth has the densest, slowest-decaying spectrum of the three.
Rising vs falling
Mathematically, flipping direction inverts the sign of every Fourier coefficient — equivalent to a phase shift of 180°. The harmonic magnitudes are identical, so the spectrum bar chart looks the same and the audible character is indistinguishable. Visually the time-domain shape mirrors. In analog synthesis, "rising" vs "falling" matters when the sawtooth feeds an envelope-modulated filter (the ramp direction interacts with the filter sweep), but for pure listening to the raw waveform the choice is cosmetic.
Why does it sound brighter than square / triangle?
The sawtooth contains every harmonic. The square wave skips half of them (only odd). The triangle skips half AND decays much faster (1/n² instead of 1/n). Multiply those together: at H10, the sawtooth carries 5× the relative energy of the square and 25× the triangle. That extra high-frequency energy is exactly what the ear hears as "brightness" or "buzz".
Where sawtooth waves show up
- Subtractive synthesis — the canonical "fat lead" or "string" oscillator on every analog synth ever made. Pass it through a low-pass filter with a resonance peak that sweeps with an envelope, and you get the iconic synth-bass / synth-brass / synth-string sounds.
- CRT horizontal deflection — old televisions and oscilloscopes used a sawtooth to sweep the electron beam across the screen at constant speed, then snapped it back at the line/frame end (the "flyback").
- Class-D PWM carriers — switching amplifiers use a sawtooth (or triangle) as the carrier signal compared against the audio input to generate the PWM gate-drive.
- Phase-detector reference — some discriminator / phase-detector circuits use a sawtooth as the reference timebase against which an input phase is measured.
Why does flipping direction not change the spectrum?
Because the magnitude of each Fourier coefficient is direction-agnostic. The rising sawtooth has bn = −2/(πn) (negative-sine phase), the falling has bn = +2/(πn) (positive-sine phase). Take the absolute value to get |Hn| and the sign drops out — the bar chart looks identical. What changes is the time-domain phase: the rising version starts at −1 and ramps up, the falling at +1 and ramps down.
Why no odd-only or even-only sawtooth?
Because the sawtooth lacks any symmetry that would force half the coefficients to zero. A square wave at 50% duty has half-wave symmetry (f(t+T/2) = −f(t)) which kills all even harmonics. A triangle wave has the same plus continuity, killing evens AND speeding the high-order decay. The sawtooth has neither — there's no transformation that maps it back onto itself with a sign flip, so every integer harmonic contributes.
Why does the waveform look round near the cycle boundary?
Same reason as the square and triangle generators: band-limited reconstruction. The audio engine sums only the first 50 harmonics (or fewer at high fundamentals, capped at Nyquist), so the instantaneous jump at the cycle boundary becomes a finite-slope transition with Gibbs-style ringing. This is what the speaker actually plays — an infinitely sharp edge can't be reproduced at any finite sample rate.
Why does the comparison overlay look much sharper at the discontinuity?
The dashed-cyan overlays (sine / square / triangle) are drawn from their textbook analytical formulas — they have infinite bandwidth and so look mathematically perfect. The green sawtooth is band-limited to match the audio output. If you band-limited the comparison overlays the same way, the square would round its edges and the triangle would soften its corners too. The intentional "textbook vs real" contrast highlights what digital playback can and can't reproduce.
Why does the sawtooth sound harsh / aggressive?
Two reasons. First, the all-harmonic content means there's lots of energy in the upper midrange and treble bands where the ear is most sensitive (the ~2-5 kHz peak of equal-loudness curves). Second, the harmonics are dense — they're packed at every integer multiple of the fundamental, with no gaps. That density creates beating between adjacent partials when the fundamental is in the low audio band, which the brain reads as a buzzy / rough texture. Filtering it through a low-pass tames the brightness; most analog synth patches do exactly that.
Can I sum two sawtooths to get a triangle?
Not directly — that gives you a different waveform with both odd and even harmonics. But you can build a triangle by integrating a square wave (the integral of a +1/−1 square gives a +slope/−slope triangle). In analog synth design, "VCO core" oscillators often generate sawtooth natively and derive triangle and square via integrator and comparator circuits. Adding two detuned sawtooths is also a classic technique — it creates a thick "supersaw" sound used in EDM lead patches.
What's the difference between this and the triangle / square generators?
All three share the same architecture (PeriodicWave synthesis with Nyquist-aware harmonic capping, click-free start/stop, comparison overlay). The math differs: square has odd-only 4/(πn), triangle has odd-only 8/(π²n²), sawtooth has all-harmonic 2/(πn). Use the comparison overlay here to see the spectral differences side-by-side, and check the related generators below to play each shape directly.
Is this safe for speakers / ears?
Sawtooth is the loudest and brightest of the canonical waveforms — the RMS power is the same as square (≈ 0.577) but more of the energy lives in the upper midrange where ear sensitivity peaks. Default 10% volume is safe; ramp up gradually. Treat extended high-volume sawtooth listening with the same care you'd apply to other high-harmonic-content material like white noise or aggressive distorted guitar — hearing fatigue happens faster than with sine waves.