Message and carrier
Message A is a 1 kHz tone: m(t) = cos(2π·1000·t) volts. Its spectrum is one line at 1 kHz. A signal that sits near 0 Hz like this is called baseband.
An oscillator makes a fast, steady wave: the carrier, c(t) = cos(2π·10000·t). On its own it carries no news. Its job is to move the message up to a frequency that antennas can send.
Mixing: DSB-SC and AM
A mixer multiplies: s(t) = m(t)·c(t). The carrier now swells and shrinks inside the dashed outline ±m(t). Since cos a·cos b = ½cos(a−b) + ½cos(a+b), the product is two tones: 9 kHz and 11 kHz.
There is no line at 10 kHz: the carrier is suppressed. The copies below and above it are the lower and upper sidebands. This is double-sideband suppressed-carrier (DSB-SC) modulation. It takes 2 × 1 kHz = 2 kHz of spectrum.
Conventional AM sends s(t) = [1 + μ·m(t)]·c(t) with modulation index μ = 0.5 (how deep the outline swings). Now a 1 V carrier line sits between sidebands of 0.25 V. The outline 1 + 0.5·m(t) stays between 0.5 and 1.5: never below zero.
Because the outline never crosses zero, a diode and a capacitor can follow it: an envelope detector, the classic cheap radio. The price is power: the carrier line takes 88.9% of it and carries no message. Only 11.1% is sideband.
Getting the message back
DSB-SC has no clean outline to follow, so the receiver multiplies by its own 10 kHz carrier: y(t) = s(t)·c(t) = m/2 + (m/2)·cos(2π·20000·t). One copy lands back at 1 kHz; another goes up to 20 kHz. The two carriers must be in phase.
A low-pass filter passes frequencies below 2.5 kHz and blocks the rest. The 19 and 21 kHz lines vanish and m(t)/2 comes out: the message, at half size. An amplifier can restore the size.
Sharing the channel
Station B sends a 2 kHz tone on a 15 kHz carrier, at the same time. Its sidebands land at 13 and 17 kHz, clear of A's 9 to 11 kHz, with a 2 kHz guard band between. Sharing by frequency is FDM.
Mixing with 10 kHz moves A to 1 kHz, but B only to 3 and 7 kHz (and 23, 27 kHz). The 2.5 kHz low-pass keeps A alone. To hear B instead, tune the receiver's oscillator to 15 kHz: B returns at 2 kHz.
Time division (TDM) shares the channel differently: each message is sampled 8000 times a second and the samples take turns: A, B, A, B. Each slot lasts 62.5 µs. FDM gives each user a band; TDM gives each a time slot.
Mixing in code
With numpy, mixing is one multiplication of two arrays. np.fft.rfft gives the spectrum: 800 samples at 80 kHz put a line every 100 Hz, and the only two lines are at 9000 and 11000 Hz.
The working
# step 1/12 · message m(t) = cos(2π·1000·t) (volts, t in seconds) spectrum: one line, 1 V at 1 kHz baseband = the frequencies sit near 0 Hz (speech: about 0.3 to 3.4 kHz) to send it by radio, an antenna about a quarter wavelength long works well: λ = c / f = 3×10⁸ / 1000 = 300 km. Too big.
The frequencies are scaled down so the waves can be drawn: a 1 kHz message on a 10 kHz carrier. Real AM broadcast carriers sit between about 0.5 and 1.7 MHz. Every curve and spectrum line is computed from this model; the spectra are real DFTs. Tokens and radio crests move in slow motion and are not to scale; the plots show the true waves.