videoskilletdecisions Open the app ↗
On this page

0015 — The AC-coupled separator drives a phase comparator

Status#

Accepted.

Context#

The scrambled channel's tearing did not follow the picture. The carrier scrambler lifts the sync tip to about 40 IRE at 6 dB, so the fixed slicer at -20 IRE finds no edge on any line, the flywheel free-runs, and every line takes the same phase-noise walk. The blanking interval landed in about the same place on every line and drew a straight grey bar, whatever the picture held.

On a real set with a capacitor-coupled separator the coupling capacitor charges to the deepest thing on the line. Once the tip has been lifted, that is the picture's dark areas, so the separator passes them as sync and the line oscillator is pulled toward them. Sync-suppression scrambling depended on this: the set tears along the shadows in the picture.

Two cheaper attempts failed.

Decision#

Add a third separator, syncSlicer 2, and leave the other two as they were.

The separator slices 10 IRE above the level its capacitor has charged to, with no ceiling on that level. On a clean line this is -30 IRE. On a scrambled line it is a little above the picture's black. At 20 IRE above, it passed every shadow on the carnival clip and the picture tore past recognition.

The separated line goes to a phase comparator, and the edge hunt does not drive the oscillator. The comparator multiplies the whole separated line by a line-rate sinusoid centred where the oscillator expects its pulse. A pulse anywhere on the line therefore pulls according to where it sits relative to the oscillator, and a dark area half a line away pushes the oscillator off. The comparator's output depends only on the separated line's first harmonic, so sync_measure computes that harmonic in parallel and the serial walk in sync spends a few multiplies per line on it. The error is divided by the separated width, with a floor at one pulse width, because the comparator holds its output on a capacitor: a broad dark area charges the capacitor to the reference's average across it and pulls toward its own middle, about as hard as a pulse does.

The comparator drives the oscillator's frequency through a proportional path and an integrating capacitor. A loop that moved phase alone slewed at the pull-in limit on nearly every scrambled line and drew straight zigzags. With the integrator, the oscillator keeps its frequency from line to line and overshoots each pull, so a tear curves. The integrator's state is timing[AFC_VEL].

The AGC is keyed off the set's flyback, the position the oscillator drew the line at a frame earlier. A keyed AGC gate is a flyback pulse, so on an unlocked set it samples picture where it expects tip and porch, reads a shallow sync, and turns the gain up to its limit. In the earlier version the AGC was keyed off the edge hunt, which on a scrambled line found the leftmost dark edge, a position unrelated to where the set was drawing.

Consequences#

Amendment: the keyed clamp and the carrier AGC#

An independent review of the first version found the grey bar moved but not changed. It was still the same flat mid-grey, now swinging in smooth curves, and the extra saturation came mostly from the AGC sitting at its limit and blowing the picture out to cream and white. The AGC keyed porch - tip on picture, which averages to about zero, so the gain could only pin.

Two circuits were added to the AC-coupled set, both keyed by its own flyback:

The picture is darker. Mean HSL lightness on carnival fell from 49% to 28%, because the key mostly lands on average picture and the clamp pulls that to black; saturation rose to 62%, though HSL saturation inflates in dark pixels. The set has no brightness control to raise the clamp's reference, which is how a viewer would have answered it.

The review's two bugs are fixed as well. A drifted oscillator offset under -999 read as "no edge" at the AGC key, and switching away from the AC-coupled separator carried its loop filter and a tip reference above blanking into one frame of the other separators. Every other preset still renders bit-identical frames. The clamp's taps are staged once per decode workgroup, and decode on the scrambled channel went from 0.454 to 0.500 ms (gpuprof, best of runs).