Skip to main content

Line coding and NRZ, RZ, AMI

Short answer

Line coding ensures no DC component, adequate timing content, and error detection. Unipolar NRZ has large DC and loses timing on long runs of 1s or 0s. Unipolar RZ retains DC and doubles bandwidth. AMI eliminates DC but fails to provide timing during long zero sequences, so none alone meets all requirements.

Why line coding is required before the PCM signals to be connected to the digital line? Justify that Unipolar Non Return to Zero (NRZ), Return to Zero (RZ) and bipolar Alternate Mark Inversion (AMI) codes can not be used in line coding.

Why line coding is required

The binary output of a PCM coder (simple on–off pulses) is not suitable for sending directly on a cable. Line coding converts it into a waveform that suits the line and the regenerative repeaters. The line code must give:

  • No DC component: lines are coupled through transformers and capacitors (and carry DC power for repeaters), so the signal must have no DC and little low-frequency energy.
  • Timing (clock) content: regenerative repeaters extract the clock from the transitions of the received signal; there must be enough transitions whatever the data.
  • Small bandwidth: the spectrum should be narrow to reduce attenuation and crosstalk on the cable.
  • Error monitoring: the code should have redundancy so that errors can be detected in service (e.g. bipolar violations).
  • Transparency: any data pattern, including long runs of 0s or 1s, must pass without loss of timing.
  • Simple, low-cost coding and decoding.

Waveforms of the three codes

 data:     1   0   1   1   0   0   0   0
          +---+   +-------+
 NRZ-L    |   |   |       |
 (unipol) +   +---+       +---------------  0

          +-+     +-+ +-+
 RZ       | |     | | | |
 (unipol) + +-----+ +-+ +-----------------  0

          +---+       +---+
 AMI      |   |       |   |
       ---+   +---+   +   +---+------------ 0
                  |   |   (no pulses
                  +---+    for 0s)

1. Unipolar NRZ cannot be used

In unipolar NRZ, '1' = +V for the whole bit, '0' = 0 V.

  • Large DC component: the average value is V/2V/2 for random data (and VV for a run of 1s). Lines use transformers and series capacitors (and carry DC to power repeaters), which block DC. The DC part is lost, the baseline wanders, and the decision threshold shifts, causing errors.
  • No timing for long runs: a long run of 1s or 0s has no transitions at all, so the repeater's clock-recovery circuit loses lock, causing bit slips.
  • No discrete clock line in the spectrum: its power spectrum has no component at the bit rate fbf_b, so simple tuned-circuit clock extraction is not possible.
  • No error monitoring: any pattern is legal, so in-service errors cannot be detected.
  • Most energy is at low frequency, where crosstalk on pairs is high. Hence unipolar NRZ is unsuitable.

2. Unipolar RZ cannot be used

In RZ, '1' = +V for half a bit and returns to 0; '0' = 0 V.

  • Still has DC: the average is V/4V/4 for random data, so the same baseline wander problem.
  • Long runs of 0s give no transitions, so timing is lost (runs of 1s are fine).
  • Bandwidth doubles: pulses are half as wide, so the first spectral null is at 2fb2f_b; more attenuation and crosstalk, and repeaters must be closer.
  • Half the pulse energy is lost for the same peak voltage, lowering noise margin.
  • No error detection. Though RZ does contain a clock component at fbf_b, its DC content and bandwidth rule it out.

3. Bipolar AMI cannot be used (on its own)

In AMI, '0' = 0 V, and each '1' is a pulse of alternating polarity (+, −, +, …). It solves several problems:

  • No DC: positive and negative pulses balance, so the average is zero and the spectrum is zero at DC.
  • Narrow spectrum: most energy near fb/2f_b/2.
  • Error detection: two successive 1s of the same polarity (bipolar violation) show an error.

But it fails one requirement:

  • Long runs of zeros give no pulses at all. PCM data from an idle channel or from data terminals can contain many consecutive zeros. During such a run the repeaters receive nothing, so the timing-recovery circuit drifts and loses bit synchronisation. Every following bit may then be mis-read.
  • Therefore plain AMI is not transparent; early T1 systems had to force a 1 into all-zero words ("zero code suppression"), which corrupts data and limits users to 7 bits (56 kbps) per channel.

Example – data 1 0 1 1 0 0 0 0 0 0 0 0 1: AMI gives + 0 − + 0 0 0 0 0 0 0 0 −; the eight zeros produce 8 bit periods with no pulse, and the repeater clock has nothing to lock to.

Summary

RequirementUnipolar NRZUnipolar RZBipolar AMI
Zero DCNoNoYes
Timing in long 0 runsNoNoNo
Timing in long 1 runsNoYesYes
Bandwidthfbf_b (null)2fb2f_b (null)fbf_b (peak at fb/2f_b/2)
Error monitoringNoNoYes (violations)
Suitable alone?NoNoNo

What is used instead

Modified bipolar codes that keep AMI's benefits but replace long zero strings with patterns containing deliberate bipolar violations:

  • HDB3 (High Density Bipolar 3) in E1/E2/E3: no more than 3 consecutive zeros on the line.
  • B8ZS (Bipolar 8 Zero Substitution) in T1: eight zeros replaced by 000VB0VB. The receiver recognises the violation pattern and restores the zeros, so DC balance, timing and error monitoring are all achieved.

✓ Answer checked by Claude Opus 5.5 (high effort)

All Telecommunications chapter 3 questions →