From ee95b600ea6dfc9fc0fab067f24e4f102de750fc Mon Sep 17 00:00:00 2001 From: Thomas Harte Date: Sun, 6 Jan 2019 19:11:18 -0500 Subject: [PATCH] Added some words on trigonometric decoding. --- Composite-Video.md | 39 +++++++++++++++++++++++++++++++++++++-- 1 file changed, 37 insertions(+), 2 deletions(-) diff --git a/Composite-Video.md b/Composite-Video.md index 67b73b4..92fe07b 100644 --- a/Composite-Video.md +++ b/Composite-Video.md @@ -87,11 +87,46 @@ Being able to recover colour from the colour channels as above requires that the ### Separating Colour and Brightness Various approaches are available, including: -* standard frequency filtering; and -* a comb filter. +* standard frequency filtering; +* a comb filter; and +* trigonmetric decoding. +#### Frequency Filtering +Applying a low-pass filter below the colour subcarrier frequency can be used to extract luminance information; that can be subtracted from the complete signal to leave the colour signal. + +#### Comb Filter The comb filter uses the observation that an entirely consistent colour signal of frequency n Mhz would add an opposite amount of signal at time (t + 1/2n) as at time t. Therefore the average of two samples can be used as brightness, and the difference between that and the source signal is colour. +#### Trigonometric Decode +The formula for composite encoding joins three independent variables as a function of phase; therefore the three can be derived given three separate samples plus knowledge of phase. Assuming that the three samples are placed so that they observe the same luminance and colour, e.g.: + + s1 = y + q * sin(a) + r * cos(a) + s2 = y + q * sin(b) + r * cos(b) + s3 = y + q * sin(c) + r * cos(c) + + => s1 - s2 = (y + q * sin(a) + r * cos(a)) - (y + q * sin(b) + r * cos(b)) + = q*( sin(a) - sin(b) ) + r*( cos(a) - cos(b) ) [1] + => s2 - s3 = q*( sin(b) - sin(c) ) + r*( cos(b) - cos(c) ) [2] + + [1] => s1 - s2 - r*( cos(a) - cos(b) ) = q*( sin(a) - sin(b) ) + => q = ( s1 - s2 - r*( cos(a) - cos(b) ) ) / ( sin(a) - sin(b) ) + + [2] => q = ( s2 - s3 - r*( cos(b) - cos(c) ) ) / ( sin(b) - sin(c) ) + + => ( s1 - s2 - r*( cos(a) - cos(b) ) ) / ( sin(a) - sin(b) ) + = ( s2 - s3 - r*( cos(b) - cos(c) ) ) / ( sin(b) - sin(c) ) + + => ( sin(b) - sin(c) ) * ( s1 - s2 - r*( cos(a) - cos(b) ) ) + = ( sin(a) - sin(b) ) * ( s2 - s3 - r*( cos(b) - cos(c) ) ) + + => ( sin(b) - sin(c) ) * ( s1 - s2 ) - ( sin(a) - sin(b) ) * ( s2 - s3 ) + = r * ( cos(a) - cos(b) ) * ( sin(b) - sin(c) ) - r * ( cos(b) - cos(c) ) * ( sin(a) - sin(b) ) + + => r = ( ( sin(b) - sin(c) ) * ( s1 - s2 ) - ( sin(a) - sin(b) ) * ( s2 - s3 ) ) / + ( cos(a) - cos(b) ) * ( sin(b) - sin(c) ) - ( cos(b) - cos(c) ) * ( sin(a) - sin(b) ) + +With the other colour component, q, being a variation on the same result and y being found by similar means. + ## PAL PAL is a development of NTSC that gives greater resilience to phase errors induced by indirect radio signal receipt. This was manifested in the equipment as NTSC sets needing a 'tint' control, with which the viewer would manually shift the whole colour palette to account for those errors. PAL sets had no such control, being resistant to those errors.