The Mathematics of Sound Synthesis
Dave Deriso · 2026
A synthesizer builds complex sounds from simple mathematical operations on waveforms. At its core, every technique is a variation on the same idea: take a periodic signal and transform it by adding, multiplying, or reshaping to produce something with more texture. This post walks through five classic synthesis techniques — plus a novel one based on time warp functions, derives the math behind each, and provides interactive demos so you can see and hear the results.
Additive synthesis
The oldest idea in synthesis traces back to Fourier: any periodic sound can be decomposed into a sum of sinusoids. Additive synthesis builds sounds by reversing this process — stacking harmonics on top of a fundamental frequency.
Given a fundamental frequency , we sum harmonics with amplitudes :
The shape of the resulting waveform depends entirely on the harmonic amplitudes. Setting produces a sawtooth-like wave. Setting rolls off faster, yielding a softer tone. With for all , every harmonic contributes equally — a bright, buzzy timbre.
The rolloff exponent controls the spectral slope via . At the spectrum is flat; as increases, higher harmonics decay faster and the sound becomes more mellow. Try adjusting the number of harmonics and the rolloff below.
Amplitude modulation (AM)
Amplitude modulation multiplies a high-frequency carrier signal by a slowly varying envelope derived from a lower-frequency modulator. The classic AM formula is:
Here is the carrier frequency, is the modulator frequency, and is the modulation depth. The factor of 1 keeps the envelope non-negative (for ), preserving the carrier's pitch.
Expanding via the product-to-sum identity reveals what happens in the frequency domain:
The output contains three frequencies: the original carrier at , plus two sidebands at . When is low (a few Hz), you hear a tremolo effect — the volume pulses rhythmically. As increases into the audible range, the sidebands become distinct tones, producing the characteristic metallic quality of AM.
Frequency modulation (FM)
While AM varies the amplitude of a carrier, FM varies its instantaneous frequency. The modulator signal is injected directly into the phase argument of the carrier:
The parameter is the modulation index, which controls how far the carrier's instantaneous frequency deviates from . The instantaneous frequency is the time derivative of the phase:
So the carrier frequency oscillates between and . The frequency deviation determines the bandwidth of the resulting spectrum.
Using the Jacobi-Anger expansion, the FM signal can be decomposed into an infinite series of sidebands:
where are Bessel functions of the first kind. At low , only a few sidebands are significant and the sound is relatively pure. As increases, more sidebands appear and the spectrum becomes richer and brighter. This is the mechanism behind the Yamaha DX7 and much of 1980s electronic music.
Ring modulation
Ring modulation is the simplest nonlinear operation: multiply two signals directly, without the DC offset that AM uses:
Applying the product-to-sum trigonometric identity:
The output contains only the sum and difference frequencies — neither original frequency survives. This is what gives ring modulation its distinctively inharmonic, metallic character. When the two frequencies are not harmonically related, the sum and difference tones are not integer multiples of a common fundamental, so the result sounds dissonant and bell-like.
Ring modulation is named after the ring of diodes used in early analog implementations. It was famously used for the Dalek voices in Doctor Who and remains a staple of electronic and experimental music.
Pulse width modulation (PWM)
A square wave alternates between +1 and −1. The duty cycle controls what fraction of each period the wave spends at +1. At we get a symmetric square wave; at other values, we get a pulse wave.
We can express a pulse wave by thresholding a sinusoid:
The Fourier series of a pulse wave with duty cycle is:
The term acts as a spectral envelope: it zeros out harmonics where is an integer. At , every even harmonic vanishes (since for even ), producing the hollow, clarinet-like tone of a standard square wave. As the duty cycle shifts, different harmonics are suppressed or emphasized, sweeping through a continuum of timbres.
Slowly modulating the duty cycle with an LFO produces the classic PWM chorus effect heard in analog polysynths — a shimmering, animated pad sound that never quite sits still.
Time warping
All the techniques above manipulate a signal's amplitude or frequency. Time warping takes a different approach: instead of changing what a signal does, it changes when it does it. We reparametrize time itself, stretching and compressing different parts of the waveform. This is a new approach to sound synthesis based on some of the ideas in my general dynamic time warping paper.
A time warp function is a mapping from original time to “warped” time. The identity means no warping has occurred --time proceeds normally. Any other monotonically increasing function that preserves the endpoints, and , produces a valid time warp, where time still moves forward, but at a varying rate.
Given a signal , we compose it with the warp function to obtain a time-warped signal:
Where , time moves faster than normal and the signal is compressed — frequencies increase locally. Where , time slows down and the signal stretches out. The instantaneous frequency at time is scaled by , so a single warp function can create pitch sweeps, chirps, and rhythmic distortions that would be difficult to achieve with conventional modulation.
To ensure musically useful results, we typically impose three constraints on :
- Boundary conditions: and — the signal starts and ends at the same points.
- Monotonicity: — time never runs backwards.
- Slope bounds: — limits how extreme the local time-stretching can be.
In practice, we control the warp strength with an intensity parameter that blends between the identity and the full warp:
At , we recover the identity and time proceeds normally. At , the full warp is applied. Values in between produce a smooth interpolation, allowing continuous control over the warping effect.
The interactive demo below lets you explore different warp functions. The left chart shows against the identity (dashed line); the right chart shows the original and time-warped signals. Try selecting different functions and adjusting the intensity to see how each reshapes the waveform.
So far we have applied independently to each cycle of the waveform. But we can extend the warp to span cycles at once. Given a signal with period , we group consecutive periods into a single block of length and apply the warp across the entire block:
At , each cycle is warped identically — the result is periodic and harmonically rich, but uniform. As increases, the warp function stretches across more cycles, creating asymmetries between them: some cycles compress while others expand, producing evolving timbral patterns that repeat every periods rather than every one. Higher values yield longer-range pitch sweeps and rhythmic irregularities within each repeating unit.
When applied to synthesis, time warping creates timbral effects that sit somewhere between FM and granular techniques. Gentle warps produce vibrato-like pitch undulations; aggressive warps fracture a waveform into something entirely new.
Putting it together
These six techniques — additive synthesis, amplitude modulation, frequency modulation, ring modulation, pulse width modulation, and time warping — form the core vocabulary of sound synthesis. Each is a different way of mapping simple mathematical operations to perceptually rich timbral changes:
- Additive builds up from harmonics — direct control over spectral content, at the cost of many oscillators.
- AM creates sidebands by modulating amplitude — efficient but limited to two extra spectral components.
- FM creates arbitrarily many sidebands from just two oscillators — the most powerful spectral tool per unit of complexity.
- Ring mod eliminates the original frequencies entirely — ideal for inharmonic, metallic textures.
- PWM reshapes a single oscillator's waveform — a timbral sweep from a single parameter.
- Time warping reparametrizes time itself — local pitch and rhythm shifts from a single monotonic function.
Modern synthesizers combine these primitives freely: FM operators feeding into ring-modulated carriers, additive resynthesis driving PWM voices, AM envelopes shaping FM timbres, time warps morphing between presets. The math is always the same — sines, products, sums, and compositions — but the sonic possibilities are vast.