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. This tool implements Web Audio AM entirely in the browser, with no plugins or installs required. The same mathematical operation appears in music production as tremolo (amplitude-modulated audio at 2–10 Hz) and in vintage synthesisers as the ring modulator, where the "1 +" offset term is removed so the carrier is fully suppressed in the output. Understanding the AM equation unlocks intuition for all of these related techniques.
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. Both sidebands are present but the carrier is absent, requiring coherent detection (a synchronized carrier reference at the receiver) rather than a simple diode envelope detector.
- SSB (single-sideband) takes DSB-SC further and filters out one sideband entirely, halving the bandwidth. SSB is used widely in amateur radio HF communications because it's more spectrally efficient and easier to copy at low signal levels. This tool generates standard AM (both sidebands present, carrier present), not SSB.
- 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. Use the online tone generator to produce a clean reference pitch, then apply this tool's slow-modulation presets to hear how tremolo changes the timbre.
- Morse code keying is AM with a square-wave message — the carrier turns on and off in time with the key.
For a direct comparison, you can also generate amplitude-modulated signals and view how sidebands move using the FFT frequency analyzer — connect the output of this generator (via a loopback or screen recording) to see the three-line AM spectrum at high resolution.
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.
What is the difference between envelope detection and coherent detection of an AM signal?
Envelope detection is the classic, simple method: a diode rectifies the AM signal and a low-pass filter follows the amplitude envelope. It requires no knowledge of the carrier phase and works with standard AM (m ≤ 100 %) where the envelope is always non-negative. Coherent detection multiplies the received signal by a locally generated replica of the carrier and low-pass filters the result. It is more complex but works with DSB-SC and SSB signals where the envelope is not a direct copy of the message. Over-modulated AM (m > 100 %) also requires coherent detection since the envelope goes negative — set m above 100 % in this tool to hear exactly why simple detection breaks.
How is AM modulation used in synthesisers and music production?
In music, AM modulation appears in two main forms. When the modulator frequency is below roughly 20 Hz (sub-audio), the amplitude varies slowly enough that listeners hear it as tremolo — a pulsing loudness effect used in guitar amplifiers and vintage organs. When the modulator enters audio range (above ~50 Hz), discrete sidebands appear and the result is called ring modulation (with carrier suppressed) or AM synthesis, both used for metallic, bell-like, or dissonant timbres. Iconic ring-modulator circuits appeared in the EMS VCS3 and Moog 1960s systems. The "Ring-mod-like" preset in this tool sets the modulator close to the carrier frequency to demonstrate the effect.
What is single-sideband (SSB) and how does it relate to AM?
SSB is derived from AM by first suppressing the carrier (DSB-SC) and then filtering out one of the two sidebands, leaving only the upper (USB) or lower (LSB) sideband. Because a single sideband carries all the information of the original message and occupies half the bandwidth of standard AM, SSB is widely used in amateur radio HF, marine, and aviation communications. Demodulating SSB requires coherent detection with a carrier re-insertion oscillator; an ordinary AM envelope detector sounds like garbled Donald Duck audio without it. This AM signal generator produces full-carrier double-sideband AM, not SSB — the sidebands appear symmetrically at fc ± fm in the spectrum plot.