Amplitude modulation (AM) is the simpler cousin of FM: instead of varying a carrier's frequency, you vary its amplitude with a slower "message" signal. The math is straightforward and the spectrum is much sparser than FM — just three lines for the sine × sine case — which makes AM ideal for teaching the basics of modulation theory and ideal for the kind of analog radio broadcasting that started in the 1920s.
The AM equation
For a sine carrier modulated by a sine message:
y(t) = cos(2πfct) · (1 + m · cos(2πfmt))
Three parameters control everything:
- fc — carrier frequency. The audible pitch when modulation is gentle.
- fm — message (modulator) frequency. Determines the spacing between the carrier and its sidebands.
- m — modulation depth (also called modulation index). 0 = no modulation; 1 = 100 % (the envelope just touches zero at its trough); > 1 = over-modulation (envelope goes negative, the carrier momentarily flips phase, audible distortion ensues).
Why exactly three spectral lines
Expanding the multiplication using the product-to-sum trig identity:
y(t) = cos(2πfct) + (m/2)·cos(2π(fc+fm)t) + (m/2)·cos(2π(fc−fm)t)
That's exactly three sinusoids: the carrier (amplitude 1), an upper sideband at fc + fm (amplitude m/2), and a lower sideband at fc − fm (amplitude m/2). For non-sine carriers each harmonic of the carrier acquires its own sideband pair, so square / sawtooth carriers produce a much busier spectrum. For non-sine modulators, each harmonic of the message creates its own sideband pair around the carrier.
Over-modulation and envelope inversion
The envelope is (1 + m·cos(...)), which ranges from (1 − m) at the trough to (1 + m) at the peak. While m ≤ 1, the envelope stays non-negative and the AM signal carries the message faithfully. At m = 1 the envelope just kisses zero. Above m = 1 the envelope goes negative: mathematically the carrier flips phase for the part of each cycle where the envelope is below zero, which adds audible distortion and breaks reception on a standard envelope-detecting AM receiver. The tool flashes a warning badge whenever m exceeds 100 %.
Connections to other modulation schemes
- Ring modulation (m → ∞ limit, or carrier × message without the "1 +") suppresses the carrier and leaves only the sidebands. Set m = 2 here to approximate this.
- DSB-SC (double-sideband suppressed-carrier) is the formal version of "ring modulation" used in single-sideband radio. Same suppressed-carrier idea.
- Tremolo in music is AM with a very slow message (3–10 Hz). The envelope is heard as periodic loudness variation rather than as discrete sidebands.
- Morse code keying is AM with a square-wave message — the carrier turns on and off in time with the key.
Why are there exactly three spectral lines for sine × sine AM?
The product-to-sum trig identity expands cos(A)·cos(B) into ½cos(A−B) + ½cos(A+B). Apply that to the cos(carrier)·cos(message) cross term in the AM expression and you get one component at fc+fm and one at fc−fm, each with amplitude m/2. Add the unmodulated carrier and you have exactly three sinusoids in total. FM, by contrast, gives an infinite Bessel-function series; AM's economy is one of its conceptual attractions.
What does "100 % modulation" really mean?
It's the point where the modulation depth m = 1, so the envelope (1 + m·cos) drops to zero at its trough. The carrier amplitude momentarily vanishes — the receiver sees full silence twice per message cycle. Below 100 % the envelope is always positive; above 100 % the envelope goes negative and the AM math no longer represents a "well-behaved" amplitude-modulated signal.
Why does the spectrum look richer when I switch the carrier to square?
A square wave is mathematically a sum of odd harmonics (1f, 3f, 5f, 7f, ...). Each one of those harmonics independently gets AM-modulated, so you see three lines per harmonic: a tall central one at the harmonic frequency, plus a sideband pair at harmonic ± fm. With many harmonics in play the spectrum looks busy, but every individual triplet still obeys the AM rule.
Why does the over-modulated AM sound so dirty?
When m > 1 the envelope (1 + m·cos) goes negative for part of each message cycle. The carrier "flips" sign during those intervals — adding sharp transitions at the zero-crossings. Sharp transitions imply high-frequency content, so the spectrum sprouts new harmonics that weren't in the original 3-line setup. An ordinary AM receiver (which extracts the envelope) hears this as severe distortion.
What's the difference between this AM tool and the FM tool?
AM varies amplitude with the message; FM varies frequency. AM produces exactly 3 spectral lines for sine × sine (carrier + 2 sidebands); FM produces an infinite Bessel-function sideband series whose width grows with modulation index. For the same compute budget FM can synthesise much richer timbres, which is why digital synthesisers chose FM, while AM dominated early radio because it's easier to detect with a simple diode envelope detector.
Why does the lower sideband marker jump to a positive frequency when message > carrier?
Because that's where the actual sideband ends up. The mathematical expression cos(2π(fc−fm)t) for negative (fc−fm) equals cos(2π·|fc−fm|·t) by cosine evenness — the negative-frequency line "folds back" to a positive-frequency line. So if you set carrier 200 Hz and message 300 Hz, the lower sideband appears at |200 − 300| = 100 Hz (between DC and the carrier), and the marker tracks it there. Same idea for an upper sideband that would exceed Nyquist: the audio hardware aliases it back to 2·Nyquist − raw position and the marker follows the aliased line.
Why doesn't the time-domain plot always show a clean envelope?
The plot draws the last 4096 audio samples (about 85 ms at 48 kHz). For the envelope to be visible you need several modulation cycles to fit in that window — message frequency of about 50 Hz or higher makes 4+ envelope cycles visible. Slower modulation (e.g. 1 Hz) only shows a fraction of an envelope cycle, so the plot looks like a steady oscillation that's slowly drifting in amplitude.
Can I use this for an actual AM transmitter or radio simulation?
It's an educational synth, not an RF transmitter. The audio it produces is the mathematical AM signal at audible frequencies (carrier ≤ 5 kHz). A real AM broadcaster does the same math at hundreds of kHz to MHz, then sends it up an antenna. The principles are identical, but Web Audio's sample rate (typically 48 kHz) precludes operating at real broadcast frequencies — pair this with software-defined-radio tooling for transmission simulation.