Skip to content
Tutorials Center
My learning

Topics

Lesson 46 of 57 ยท Data Communication

Modulation and Transmission Impairments

Learn how bits travel on a real channel: baseband vs broadband, ASK/FSK/PSK and AM/FM/PM modulation, attenuation, distortion, noise, SNR, Nyquist and Shannon limits.

The last lesson turned bits into voltage levels. That is enough for a short cable, but a radio link, a telephone line or a fiber cannot carry an arbitrary square wave. The channel passes only some frequencies, shares its space with other users, and damages the signal on the way. This lesson covers the two halves of the problem: modulation, which fits the signal to the channel, and transmission impairments, which describe what the channel does to it. Both are simulated in Python so that you can see the numbers.

Baseband and broadband

A signal that is sent as it is produced, such as the voltages from a line code, is a baseband signal. It occupies the frequencies from near zero up to some limit, and it uses the whole channel, so only one signal can use the wire at a time. Ethernet on a twisted pair is a typical baseband system.

A broadband system shifts signals to a frequency band chosen for the channel. It does so by modulating a carrier: a steady sine wave at a high frequency whose amplitude, frequency or phase is changed by the information. There are three good reasons for this:

  • The channel only passes certain frequencies. A voice-grade telephone line passes roughly 300 to 3400 Hz, and a radio antenna needs a high frequency to be a practical size.
  • Sharing. Different signals can use different carriers on the same medium (frequency-division multiplexing): that is how radio stations and cable television channels coexist.
  • Better behavior. Some modulations resist noise better than the raw signal.

The device that modulates at the sender and demodulates at the receiver is a modem (modulator-demodulator).

Digital modulation: ASK, FSK, PSK

When the message is a bit stream, the carrier is switched between a few states. The names say what is varied:

Scheme What changes Example for one bit
ASK (amplitude shift keying) the amplitude 1 = carrier on, 0 = carrier off
FSK (frequency shift keying) the frequency 1 = high tone, 0 = low tone
PSK (phase shift keying) the phase 1 = phase 0, 0 = phase 180 degrees

QAM (quadrature amplitude modulation) combines amplitude and phase changes so that one signal element can carry several bits, which is how modems, cable and Wi-Fi reach high data rates. Each element is called a symbol; the baud rate is symbols per second and the bit rate is the baud rate times the number of bits per symbol.

The program builds all three, passes the signal through an increasing amount of random noise, and counts the bit errors at the receiver. The receiver multiplies each bit period by a copy of the expected tone and sums the result (a correlation), then decides.

Python ASK, FSK and PSK against noise

Press Run (or Ctrl + Enter) to see the result here.

Program input ยท what you'd type while the program runs

Type the answers before you press Run, one per line. Each time the program reads a line (with input()), it gets the next line from this box.

Without noise all three decode perfectly. As the noise grows, PSK degrades most slowly: its two states are as far apart as possible (a flip of 180 degrees), whereas ASK has to tell "small" from "nothing" and FSK needs two matching measurements to disagree. The numbers are random samples, so your counts may differ slightly, but the ordering is stable: PSK first, and ASK and FSK close together behind it.

Analog modulation: AM, FM, PM

If the message is itself an analog signal (voice, music), the carrier's property follows the message continuously:

  • AM (amplitude modulation): the carrier amplitude follows the message, (1 + m ยท message) ยท cos(2ฯ€ f_c t), where m is the modulation index. Simple to build and to receive (an envelope detector is just a rectifier and a smoothing filter), but noise adds directly to the amplitude, which is what you hear as crackle on an AM radio.
  • FM (frequency modulation): the carrier's frequency swings around f_c in proportion to the message. The amplitude stays constant, so most amplitude noise can simply be clipped away, which is why FM sounds cleaner but uses more bandwidth.
  • PM (phase modulation): the carrier's phase follows the message. FM and PM are close relatives: an FM signal is a PM signal driven by the integral of the message.

The next program makes an AM signal and an FM signal from the same 20 Hz tone, then measures the modulation index from the envelope and the frequency swing from zero crossings.

Python AM envelope and FM frequency swing

Press Run (or Ctrl + Enter) to see the result here.

Program input ยท what you'd type while the program runs

Type the answers before you press Run, one per line. Each time the program reads a line (with input()), it gets the next line from this box.

The envelope of the AM signal swings between about 0.41 and 1.60, so the receiver recovers the modulation index 0.6 from the ratio. The FM signal keeps a constant amplitude, yet counting zero crossings shows that its frequency moves between 300 and 500 Hz around the 400 Hz carrier, following the message. (The measurement window is only 10 ms, so the frequency resolution is a coarse 100 Hz; a real receiver uses a discriminator or a phase-locked loop.)

Transmission impairments

Whatever the modulation, the signal that arrives is not the one that left. The three main impairments are:

Attenuation. The signal loses strength with distance, because the medium absorbs and radiates energy. Loss is measured in decibels: dB = 10 ยท log10(P_out / P_in), so a loss of 3 dB halves the power and 10 dB leaves one tenth. Decibels add up along the path, which makes them convenient. A signal that has become too weak is restored by amplifiers (analog links) or repeaters (digital links, which regenerate clean bits). Attenuation also depends on frequency, which leads to the next problem.

Distortion. Each frequency component of a signal travels at its own speed and with its own loss, so the shape changes. In delay distortion the components arrive at slightly different times, so a clean pulse spreads out in time and overlaps its neighbors (intersymbol interference); in optical fiber the same effect is called dispersion. Equalizers at the receiver compensate for it.

Noise. Unwanted signals add to the wanted one:

  • Thermal noise comes from the random motion of electrons and exists in every conductor, growing with temperature and bandwidth.
  • Crosstalk is a signal leaking from a neighboring wire; twisting the pairs reduces it.
  • Impulse noise is a short, strong spike from lightning, switching or a motor: it destroys a few bits at once, which is why error-correcting codes and interleaving are used.
  • Intermodulation noise appears when a nonlinear device mixes several carriers and creates new frequencies.

The quality of a link is summarized by the signal-to-noise ratio SNR = P_signal / P_noise, usually given in dB. Since attenuation lowers the signal and the noise stays, SNR drops along the cable.

How fast can a channel go?

Two classic formulas connect the channel to the data rate. Nyquist is for a noiseless channel of bandwidth B using L signal levels: the maximum bit rate is 2 ยท B ยท log2(L). More levels carry more bits per symbol. Shannon is for a real, noisy channel: the maximum error-free rate is C = B ยท log2(1 + SNR), whatever clever coding you use. Noise, not the number of levels, is the final limit.

Python Decibels, SNR, Nyquist and Shannon

Press Run (or Ctrl + Enter) to see the result here.

Program input ยท what you'd type while the program runs

Type the answers before you press Run, one per line. Each time the program reads a line (with input()), it gets the next line from this box.

The first block shows the dB scale in action: every 10 dB of loss divides the power by ten, and the SNR falls by the same 10 dB for every 5 km. The last two blocks show why a voice line of 3000 Hz tops out around 30 kbit/s at 30 dB SNR. To reach that rate, Nyquist's formula would need about 32 signal levels, which is hard to distinguish in noise: the two limits agree on where the practical ceiling is. That is why modems use QAM with many symbols and strong error correction, and why higher rates need more bandwidth (a wider channel) rather than cleverer tricks.

Check your understanding

Quick check ยท 5 questions

of 5 answered You scored / 5 ยท perfect!

  1. 1. What is the main difference between baseband and broadband transmission?

    A baseband signal occupies frequencies from near zero and uses the whole channel. Broadband modulates a carrier, which lets several signals share the medium.
  2. 2. In PSK, what carries the information?

    Phase shift keying switches the carrier phase, for instance between 0 and 180 degrees.
  3. 3. A cable attenuates a signal by 20 dB. What fraction of the power arrives?

    10 dB is a factor of 10 in power, so 20 dB is a factor of 100. One hundredth of the power arrives.
  4. 4. Which impairment is a short, strong spike that corrupts several bits in a row?

    Impulse noise (lightning, motors, switching) hits briefly but strongly, producing burst errors.
  5. 5. What does the Shannon formula C = B log2(1 + SNR) tell you?

    Shannon capacity is the upper limit of reliable data rate for a given bandwidth and signal-to-noise ratio.

Summary

  • Baseband sends the line-coded signal directly; broadband modulates a carrier so that a signal fits a channel's frequency band and several signals can share a medium.
  • ASK, FSK and PSK vary the amplitude, frequency or phase of a carrier to send bits; QAM combines amplitude and phase to carry several bits per symbol. PSK resists noise best in the simulation.
  • AM, FM and PM do the same for analog messages; FM and PM are less sensitive to amplitude noise.
  • Attenuation (measured in dB), distortion (frequency-dependent delay and loss) and noise (thermal, crosstalk, impulse, intermodulation) damage a signal in transit; SNR summarizes the result.
  • Nyquist limits a noiseless channel by 2B log2(L), and Shannon limits a noisy one by B log2(1 + SNR).

Next: Designing an ALU