Sync and blanking level error
How malformed composite-video references make a receiver misplace the picture in time or recover the wrong brightness range.
Visible effect
Timing moves the picture; the level reference moves its brightness range
Before it can display a composite line, the receiver must recover two answers from the signal: when does the line begin? and which voltage is the reference below the picture? Sync supplies the timing answer. The quiet back porch supplies the level answer.
Use the controls separately. First set Blanking-level error to Nominal and reduce Sync-pulse depth. The picture geometry becomes unstable because the receiver is losing timing, while its brightness scale remains unchanged. Then restore nominal sync and move only the blanking level. Geometry stays fixed, but the recovered brightness range moves.
A transmitted porch that is too high makes the clamped picture darker and clips shadow detail first. A porch that is too low raises blacks. With weak sync, possible receiver responses include sideways bending, tears, phase slips, and vertical roll. Their exact order belongs to the receiver, not to the transmitted pulse alone.
Physics
Each line tells the receiver where time and picture level begin
A receiver cannot infer the picture's position and brightness from active pixels alone. As How analogue television carries an image explains, every composite-videoOne baseband waveform carrying luma, encoded colour, blanking, and synchronizing information together. line also carries timing and reference intervals. The horizontal sync pulse marks the line boundary. Blanking covers the time in which no picture should be drawn, and the quiet back porch gives the receiver a repeatable level just before active picture begins.
The receiver first separates the sync pulses from the rest of the waveform. It judges a pulse by how far it extends below blanking, so the relevant quantity is their difference rather than either absolute voltage. If that depth becomes too small, the receiver loses a dependable timing mark. Its line generator may drift or slip, moving rows sideways; its field generator may lose the frame boundary and let the picture roll vertically. Later descriptions call the correcting line circuit horizontal AFC. Different circuit designs fail in different ways, so hook, tearing, and roll are examples rather than fixed stages.
The clamp answers the separate level question. Transmission may remove the waveform's original absolute voltage, so the receiver samples the back porch and moves it to a chosen reference. Everything in active picture moves with it. If the transmitter placed the porch too high relative to the picture, the clamp must move it farther downward; picture values move downward too, crushing blacks. A porch placed too low makes the opposite error and raises blacks.
This is why the playground has two independent controls. Sync depth changes the reliability of the timing marks. Blanking-level error changes the distance between the porch and the picture. A real transmitter fault can disturb either one or both; noise and automatic gain control elsewhere in the chain can change how strongly a receiver exposes the result.
Mathematics
One level sets timing margin; the other sets the recovered luma origin
VS is the sync-tip level and VB is blanking, so sync depth Ds is written as a positive magnitude. ΔB is the transmitted porch error relative to active picture, and VW is the nominal blanking-to-peak-white excursion. After the receiver clamps the porch, normalized luma Y′ moves by −ΔB/VW.
The horizontal displacement Δxn is zero at nominal 40 IRE depth. As this chosen receiver model moves toward its lost-lock floor near 12 IRE, a slowly advancing oscillator phase produces a progressively larger coherent offset from line to line. A decaying offset near the top stands in for one possible AFC pull-in transient, while a continuous low-frequency phase error bends neighbouring lines together. This model retains field lock until the severe end of the response; another receiver need not do so. The parameters vary continuously, but phase wrapping can still create an abrupt tear, just as a real synchronizing loop can slip a cycle.
Shader
A disclosed receiver proxy turns malformed references into a visible picture
The shader starts with an already demodulated picture. It converts the chosen sync depth into a lock-failure factor across the disclosed 12–40 IRE response. Deterministic terms then create line-phase drift, a top-weighted pull-in error, and a smooth low-frequency phase bend across rows. Severe failure advances the vertical source coordinate with time to roll the frame. Separately, the shader converts RGB to luma and colour difference, subtracts the blanking error from luma, and reconstructs colour. With nominal sync and zero blanking error, every remap reduces exactly to the source picture.
// WHAT: Show the picture recovered when sync depth or the relative blanking
// reference is wrong at the transmitter output.
// HOW: A fixed-threshold sync separator controls coherent line-phase drift;
// receiver back-porch clamping subtracts the transmitted porch error from luma.
// WHY: A common DC shift would be removed by clamping, while a porch-to-picture
// error survives as a wrong recovered black reference.
vec3 rgbToSyncVideo(vec3 rgb) {
float y = dot(rgb, vec3(0.299, 0.587, 0.114));
return vec3(y, 0.492 * (rgb.b - y), 0.877 * (rgb.r - y));
}
vec3 syncVideoToRgb(vec3 video) {
float r = video.x + video.z / 0.877;
float b = video.x + video.y / 0.492;
float g = (video.x - 0.299 * r - 0.114 * b) / 0.587;
return vec3(r, g, b);
}
vec3 applySyncBlankingLevelError(
vec2 sourceUv,
float syncDepthIre,
float blankingErrorIre
) {
// The broad 12–40 IRE response keeps the control readable: it represents
// progressively shrinking timing margin across a family of receivers.
float lockFailure = 1.0 - smoothstep(12.0, 40.0, syncDepthIre);
// This chosen receiver proxy retains field lock longer than line lock. That
// ordering is a model choice: actual separator and oscillator circuits vary.
float verticalUnlock = smoothstep(0.68, 1.0, lockFailure);
float rolledY = fract(sourceUv.y + verticalUnlock * (0.12 * u_time + 0.08));
float lineIndex = floor(rolledY * u_sourceSize.y);
// Below the assumed separator margin, the horizontal oscillator drifts
// coherently from line to line. This is deliberately not random line jitter.
float phase = fract(lineIndex * (0.0008 + 0.0042 * lockFailure) + 0.15);
float freeRun = lockFailure * u_sourceSize.x * 0.055 * (phase - 0.5);
// One possible horizontal-AFC transient is an error after the field boundary
// that pulls back toward line lock. Concentrating it near the top shows that
// response without claiming that every weak-sync receiver produces a hook.
float distanceFromTop = 1.0 - rolledY;
float topPull = lockFailure * lockFailure * exp(-distanceFromTop * 13.0)
* u_sourceSize.x * 0.09;
// Neighbouring lines follow one continuous low-frequency phase error. Cubing
// the sinusoid concentrates the bend without quantizing it into fixed bands.
float tearStrength = smoothstep(0.32, 0.82, lockFailure);
float tearPhase = sin(lineIndex * 0.077 + u_time * 0.7);
float tear = tearStrength * tearPhase * tearPhase * tearPhase
* u_sourceSize.x * 0.022;
float shiftPixels = freeRun + topPull + tear;
vec2 shiftedUv = vec2(
sourceUv.x - shiftPixels / u_sourceSize.x,
rolledY
);
vec3 video = rgbToSyncVideo(texture(u_source, shiftedUv).rgb);
// The receiver clamps the erroneous back porch to its reference. A porch
// sent too high therefore pushes active-picture luma down by the same amount.
video.x = clamp(video.x - blankingErrorIre / 100.0, 0.0, 1.0);
return syncVideoToRgb(video);
}- Source textureDemodulated gamma-coded video
- Receiver timing and clamp proxyOne fullscreen render pass
- Evaluate sync-separator margin
- Advance continuous free-running line phase
- Sample at the displaced horizontal coordinate
- Clamp luma against the erroneous porch reference
- Reconstruct RGB and mix the effect
- Display output
Why these steps are here
- Map positive sync depth below blanking through a disclosed separator-margin curve.
- Build coherent line drift, top-of-raster pull, and a continuous low-frequency bend across neighbouring lines.
- Release the vertical phase only for severe sync loss, then sample the remapped raster.
- Subtract the relative porch error from luma, matching receiver back-porch clamping.
- Preserve colour-difference components and reconstruct RGB.
Notes
- The controls use IRE as a normalized composite-video scale. The nominal 40 IRE sync depth is familiar from conventional 525-line and 625-line examples, but absolute voltages and black setup are standard-specific.
- The broad transition from secure lock at 40 IRE to lost lock near 12 IRE is a declared teaching assumption, not a universal receiver specification. It makes the whole control useful while standing in for receivers that differ in slicing, automatic gain control, noise immunity, flywheel action, and hold range.
- Top pull, continuous line bending, horizontal phase slips, and vertical roll are possible receiver symptoms combined in one illustrative response. They are not a mandatory sequence. Top pull in particular depends on horizontal-AFC dynamics and interaction around the field boundary, not on sync amplitude alone.
- The modeled amplitudes change smoothly; an abrupt seam appears only when oscillator phase wraps. The model does not reproduce a particular loop circuit, interlaced-field transient, random line jitter, or complete loss of raster.
- The playground begins after ideal demodulation. A malformed composite waveform can also alter the transmitted RF envelope and interact with channel noise and receiver AGC.
- Positive blanking error means the transmitted porch is high relative to active picture. Clamping it downward darkens the picture; negative error lifts the recovered luma origin.
- Black level and blanking level coincide in many 625-line systems. Historical NTSC with 7.5 IRE setup places reference black above the 0 IRE blanking level, so those terms must not be used interchangeably.
References
ITU-R BT.1700 — composite analogue television signals — authoritative signal definitions and nominal waveform relationships for conventional NTSC, PAL, and SECAM composite television systems.
Tektronix — NTSC Video Measurements — measurement primer showing sync, blanking, setup, and peak-white levels and explaining waveform clamping.
ITU-R BT.470 — conventional analogue television systems — authoritative reference for the differing line, field, modulation, and signal conventions of conventional television systems.
RCA Institutes — Television Servicing course — receiver-service reference distinguishing loss of sync, horizontal tearing, vertical roll, oscillator faults, and sync-separator faults.