Thursday, April 28, 2011

NTSC demystified - Math - Part 4

This post targets largely electrical engineers and involves a bit of math and basics of analog communication. A more formal treatment of the NTSC color signal along with results, which will assist digital NTSC color signal generation is presented.

Let us focus on the active video part of the NTSC signal.The technique employed for sending color information to the TV is analog QAM. The signal is given by

This is not a precise definition[1]. I've chosen this for mathematical simplicity. Here Y, I ,Q are time-varying. Y represents luminance at that point on the line, I the in-phase component of chroma and Q, the quadrature component of chroma.

Given R, G, B , we can determine Y,I,Q and vice versa[1]. Representing the chroma signal in terms of one carrier signal, we have,
The color at a particular point is decided by both the amplitude and phase of the color carrier. If the RGB of a point is known, using the transformatio matrix[1] , we can obtain Y,I,Q. Similarly, if luma level (Y) ,Carrier Amplitude and phase of the carrier are known, from the above equations, we can obtain YIQ and convert this to RGB. A graph drawn from such calculations is shown below.
Clearly, the phase angle of the carrier represents hue and amplitude represents saturation.

Let us now consider a square wave and represent that using the fourier series.


If 1/T = f = 3.579545 MHz is the fundamental, higher harmonics are odd multiples of the fundamental frequency. These will be 10.73Mhz, 17.89Mhz and so on. All of these are removed by the chroma band pass filter in a TV. All that remains after filtering will be the fundamental.

So, as far as the TV color detecting circuit is concerned, a color carrier square wave looks identical to a sine color carrier.

Let us now see some numerical examples of the way QAM works.

Suppose phase angle 0 is to be produced, then I = 0 and Q = 1. ( This is as per our earlier definition and NOT on NTSC signal definition[1] ).
Suppose phase angle 45 is to be produced, I = 1 and Q = 1.

Similarly, if I = 2 and Q = 1, phase angle is 63.44 degrees.

By mixing Sine and Cosine waves of different amplitudes, hue can be spanned.

Using the previous result, all hue can be generated by mixing square waves of phases 0 , 90 degress with their amplitude scaled appropriately.

References
1. SX PONG by Rickard Gunee
2. AVR PAL Color Generator by Jakub Trznadel
3. NTSC Tutorials

No comments:

Post a Comment