How the PAL Colour Video System Works

This is a bit of background for those interested in the workings of my Commodore 64 PAL video decoder.

PAL video encoding process and waveforms

Luminance and Colour Difference

For backwards compatibility with monochrome television, instead of encoding R, G and B directly, three other signals are derived: luminance (Y), and two colour difference signals R-Y and B-Y. These are weighted so that for a monochrome signal, R-Y and B-Y are both zero.

Colour Subcarrier

Colour information is transmitted by adding a colour subcarrier to the luminance. The subcarrier is modulated with R-Y and B-Y using quadrature amplitude modulation. This means that R-Y and B-Y are used to amplitude modulate two carriers of the same frequency but with a 90 degree phase difference. Balanced modulation is used, so that the carrier is suppressed. Mathematically, the chrominance signal C is given by

C = (R-Y) sin 2πft + (B-Y) cos 2πft

where f is the colour subcarrier frequency (about 4.43MHz for PAL). Note that if R-Y and B-Y are both zero, then C is zero, and the composite video signal consists only of luminance.

The following diagram depicts C as a vector, whose projections onto the axes represent R-Y and B-Y. You can also think of the phase of the vector as representing the hue of the colour, and its length the saturation.

Colour Burst

To demodulate the subcarrier, the receiver needs a phase reference. This is provided by inserting a sample of subcarrier having a known phase just after the horizontal sync pulse. This is known as the colour burst.

PAL Switching

We're not quite done yet. There is one more twist, designed to reduce the problem of phase errors in the received chrominance signal. This can happen if, for example, you're getting a signal directly from the transmitter and also bouncing off a nearby building. The reflected signal takes slightly longer to arrive, so it's shifted in phase with respect to the line-of-sight signal. Adding them together gives a vector in a slightly different direction, resulting in a hue error. (This problem is why some people say that NTSC stands for "Never Twice the Same Colour".)

In the PAL system, the phase of the R-Y component is inverted on alternate lines (hence "Phase Alternating Line"). This has the effect of reflecting the chrominance vector about the B-Y axis. Then, in the receiver, the chrominance for the current line is averaged with a copy of the chrominance from the previous line with R-Y inverted again. This cancels out the phase error, at the expense of a slight change in saturation, which is much less noticeable.

So that the receiver can tell whether an odd or even line is being received (known as "ident"), the phase of the colour burst alternates between 135 and -135 relative to B-Y (this is called a "swinging burst").

Swinging Burst

Cancelling a phase error . Here c1 is the intended chrominance vector, c1' is the received one. Averaging c1' and the reflected c2' gives a vector with the same phase as c1.

Decoding Process

Here's a diagram of what goes on in the receiver to recover R, G and B from the composite video signal.

First, filters are used to separate the luminance and chrominance. (If separate luminance and chrominance are already available, as they are in my C64 video decoder, this step is omitted.)

A phase-locked loop keeps a local subcarrier oscillator aligned with the average phase of the colour burst. The local oscillator produces two reference carriers 90 degrees apart for demodulating the R-Y and G-Y components. The phase of the colour burst is also used to detect whether an odd or even line is being received. A flip flop stores this information and uses it to switch the phase of the input to the R-Y demodulator appropriately.

Chrominance from the previous line is added to the current line at the input of the B-Y demodulator, and subtracted at the R-Y demodulator, thereby mirroring the delayed chrominance about the B-Y axis as required to achieve phase error cancellation as described above.

The luminance is usually passed through a short delay line to compensate for the fact that the chrominance is delayed by having to go through more processing.

Some arithmetic is performed on R-Y and B-Y to recover G-Y, and finally Y is added to all of them to produce R, G and B.