RZ Codes

Understanding Return-to-Zero codes and how they improve clock recovery.

The Problem with Non-Stop Signals

While simple line codes like NRZ (Non-Return-to-Zero) are easy to implement, they suffer from a major flaw: a long, uninterrupted sequence of identical bits (1111111111111111) creates a constant voltage level on the line. With no changes in the signal, the receiver can lose its timing reference, a phenomenon known as loss of .

Return-to-Zero (RZ) coding was developed to solve this very problem by forcing a change in the signal during each bit that carries energy.

How Unipolar RZ Works

The simplest variant is Unipolar RZ. It modifies the NRZ signal by making the pulse for a logical '1' last for only a fraction of the bit duration, typically one-half. After the pulse, the signal "returns to zero" for the remainder of the bit period.

Encoding Rules

The signals representing the symbols are defined as follows, where TT is the bit duration:

  • Logical '1': Represented by a positive pulse +V+V for the first half of the bit duration (0.5T0.5T), followed by a return to 0V0V for the second half.
    Formula: g1(t)=+V⋅Π(t;0.5T)g_1(t) = +V \cdot \Pi(t; 0.5T)
  • Logical '0': Represented by a zero voltage level for the entire bit duration.
    Formula: g0(t)=0g_0(t) = 0

Interactive RZ Encoding Example

Enter binary sequence (0s and 1s only)

Current Bit: 1
+5V-5V0V10110100
Unipolar RZ: 1 → +V for 0.5T, 0 → 0V

DC Component

Unipolar RZ:1.25V

Spectral Information

Clock Frequency:1.00 Hz
Main Lobe Bandwidth:0 - 1.00 Hz

The RZ Spectrum: A Double-Edged Sword

The unique structure of the RZ signal has a profound impact on its frequency spectrum, bringing both a significant advantage and a major disadvantage.

Spectrum Analysis

  • Advantage - Clock Recovery (++): The spectrum of an RZ signal contains a distinct, discrete spectral line (a spike) at the clock frequency (fclk=1/Tf_{clk} = 1/T). This acts like a built-in "metronome" that the receiver's circuitry can easily lock onto using a simple filter. This makes clock recovery from an RZ signal much more reliable than from an NRZ signal.
  • Disadvantage - Increased Bandwidth (--): The price for this improved synchronization is a wider bandwidth requirement. Because the pulses are shorter (half the bit duration), the signal's main spectral lobe is twice as wide as that of an NRZ signal, extending to 2fclk2f_{clk}. This makes RZ coding less spectrally efficient.
  • Disadvantage - DC Component (-): The unipolar version of RZ has a data-dependent , which can be problematic for some transmission systems.
  • Limitation - Long Zero Sequences (-): A long string of zeros still produces a flat, zero-voltage line, which can lead to a loss of synchronization, just like in NRZ. More advanced codes like AMI and HDB-3 were created to solve this specific issue.
    RZ Codes | Teleinf Edu