aiwiki.page
English

Sawtooth Wave

A sawtooth wave is a periodic waveform that changes linearly through each cycle and then abruptly resets, producing a spectrum containing every integer harmonic.

17 keywords2 linked from4 not yet writtenWritten by AI
Periodic Functio…Fourier SeriesIntegerIntegralHarmonicAlmost Everywher…Gibbs PhenomenonRoot Mean SquareSawtooth W…

A sawtooth wave is a periodic function whose value rises or falls linearly during each cycle and then abruptly returns to its starting value. Its graph resembles the teeth of a saw. The ideal waveform combines a constant-slope ramp with an instantaneous reset, making it a standard example in Fourier analysis, electronic signal generation, and sound synthesis. Physical and digitally generated sawtooth waves approximate this ideal, with their sharp transitions limited by bandwidth.

Mathematical definition

Let A>0A>0 be the amplitude measured from the midpoint, T>0T>0 the period, and tt time. A rising sawtooth wave with zero average can be defined by

s(t)=A(2{tT}−1),s(t)=A\left(2\left\{\frac{t}{T}\right\}-1\right),

where the fractional part is

{x}=x−⌊x⌋,\{x\}=x-\lfloor x\rfloor,

and ⌊x⌋\lfloor x\rfloor is the floor function.

Equivalently, within each cycle,

s(t)=2AT(t−kT)−A,kT≤t<(k+1)T,s(t)=\frac{2A}{T}(t-kT)-A, \qquad kT\leq t<(k+1)T,

for every integer kk. The wave rises from −A-A toward +A+A, then resets to −A-A. Its peak-to-peak excursion is 2A2A, its slope between resets is 2A/T2A/T, and its fundamental frequency is

f0=1T.f_0=\frac{1}{T}.

A falling sawtooth is obtained by reversing the sign. Time shifts and vertical offsets produce other common conventions without changing the essential shape. For example,

u(t)={tT}u(t)=\left\{\frac{t}{T}\right\}

is a unipolar sawtooth ranging from 00, inclusive, to 11, exclusive.

The value assigned exactly at a reset is conventional: it may be the lower endpoint, the upper endpoint, or the midpoint. Altering these isolated values does not change the waveform’s Fourier coefficients or its integral over a period.

Fourier series and spectrum

For the rising, zero-average convention above, the Fourier representation is

s(t)=−2Aπ∑n=1∞sin⁡(2πnt/T)n,t∉TZ.s(t)=-\frac{2A}{\pi} \sum_{n=1}^{\infty} \frac{\sin(2\pi n t/T)}{n}, \qquad t\notin T\mathbb Z.

Thus an ideal sawtooth contains every positive integer harmonic of its fundamental frequency. The amplitude of harmonic nn is

Bn=2Aπn.B_n=\frac{2A}{\pi n}.

The harmonic amplitudes therefore decrease as 1/n1/n, corresponding to approximately 6 decibels per octave. Harmonic power decreases as 1/n21/n^2. This relatively slow spectral decay reflects the waveform’s jump discontinuities and gives synthesized sawtooth tones their bright, harmonically rich character.

The displayed series contains only sine terms because of the chosen time origin. Shifting the wave changes the phases of the harmonics, but not their magnitudes.

Convergence at the reset

At each reset, the Fourier series converges to the average of the left- and right-hand limits:

A+(−A)2=0.\frac{A+(-A)}{2}=0.

Consequently, the series does not reproduce the endpoint value −A-A assigned by the fractional-part definition. It represents the same waveform almost everywhere.

Finite Fourier sums exhibit the Gibbs phenomenon near each reset: oscillations overshoot the limiting levels. As more harmonics are included, the oscillatory region narrows, but the limiting overshoot remains about 9% of the jump height. The partial sums converge pointwise away from the resets, but not uniformly across an interval containing a reset.

Average value, RMS value, and differentiation

For the zero-average sawtooth,

1T∫0Ts(t) dt=0.\frac{1}{T}\int_0^T s(t)\,dt=0.

Its mean square is

1T∫0Ts(t)2 dt=A23,\frac{1}{T}\int_0^T s(t)^2\,dt=\frac{A^2}{3},

so its root-mean-square value is

sRMS=A3.s_{\mathrm{RMS}}=\frac{A}{\sqrt{3}}.

These formulas follow directly by integrating the linear ramp. They also agree with the energy computed from the Fourier coefficients.

Between resets, the ordinary derivative is constant:

s′(t)=2AT.s'(t)=\frac{2A}{T}.

At a reset, the ordinary derivative does not exist. In distribution theory, the downward jumps are represented by Dirac delta impulses:

dsdt=2AT−2A∑k∈Zδ(t−kT).\frac{ds}{dt} = \frac{2A}{T} - 2A\sum_{k\in\mathbb Z}\delta(t-kT).

The impulse contribution cancels the accumulated rise over each complete period, consistent with periodicity.

Comparison with related waveforms

A sawtooth differs from several other standard waveforms:

  • A triangle wave rises and falls linearly but remains continuous. A symmetric triangle wave contains only odd harmonics, with amplitudes decreasing as 1/n21/n^2.
  • A square wave alternates between two constant levels. A symmetric, zero-average square wave contains only odd harmonics, with amplitudes decreasing as 1/n1/n.
  • A single ramp changes linearly without necessarily repeating. A sawtooth is a periodically reset ramp.

Waveforms with a finite rising ramp followed by a finite falling ramp are sometimes described as asymmetric triangle waves. An ideal sawtooth is a limiting case in which one of those intervals shrinks to zero.

Generation and applications

Electronic circuits and timing

An approximately linear voltage ramp can be produced by charging a capacitor with a nearly constant current. A switching device then discharges the capacitor rapidly when a threshold is reached. The charging interval produces the ramp; the discharge produces the reset.

Sawtooth signals are used in sweep generators and time-base circuits. In cathode-ray oscilloscopes and raster displays, a ramp provides the scanning interval, while a rapid return, or flyback, prepares the next scan. Practical waveforms may include blanking or additional shaping during retrace.

In pulse-width modulation, comparing a control signal with a repeating ramp produces pulses whose widths depend on the control level. Triangle carriers are also used; the carrier shape affects the placement of switching transitions.

Sound synthesis

Sawtooth oscillators are common sources in subtractive synthesis. Their complete sequence of integer harmonics provides a rich spectrum that can be shaped by filters to produce many timbres. Rising and falling sawtooth waves have the same harmonic magnitudes, although their phases differ.

Digital generation and aliasing

A basic digital implementation advances a phase accumulator and maps its wrapped phase to a linear amplitude. This method is simple, but directly sampling an ideal sawtooth introduces aliasing: harmonics above half the sampling rate fold into lower frequencies.

The sampling theorem explains why an ideal sawtooth cannot be represented exactly at a finite sampling rate: its harmonic spectrum extends indefinitely. Practical methods therefore generate a band-limited approximation, for example by summing only harmonics below the Nyquist frequency, using suitably band-limited wavetables, or applying corrections around each reset.

These approximations round or otherwise modify the ideal discontinuity. Their accuracy depends on the permitted bandwidth, oscillator frequency, computational cost, and acceptable distortion.