4 ms·
It's surprisingly straightforward - take your input composite signal C and multiply it by a sin wave and a cosine wave (both of frequency 3.58MHz). Then take th
by ajenner 11y ago
It's surprisingly straightforward - take your input composite signal C and multiply it by a sin wave and a cosine wave (both of frequency 3.58MHz). Then take the three resulting waveforms (C, Csin(f) and Ccos(f)) and filter them to remove frequencies of 3.58MHz and above. If your sample rate is 14.318MHz (4 pixels per color carrier cycle) then any filter kernel that is a polynomial of (1,1,1,1) will work for this. I use (1,4,7,8,7,4,1). The resulting three waveforms are Y, I and Q which you can plug into the matrix at http://en.wikipedia.org/wiki/YIQ http://en.wikipedia.org/wiki/YIQ to get RGB. You'll need to fix up the phase to get the right colours (this is what the color burst pulse does in the actual hardware). You might have to swap sin and cos as well, I'm just writing this from memory.
- grapeshot 11y agoThis is basically correct but the I and Q signals need to be filtered much more drastically (down to a bandwidth of about 1.5 mhz) to avoid artifacts, and more luma detail can be obtained by using a comb filter (summing adjacent lines to cancel the color signal since the phase on each line is shifted by 180 degrees from the previous).
- ajenner 11y agoThis is true for proper standards-compliant NTSC signals, but a comb filter won't help you for CGA since the CGA card generates an integer number of color carrier cycles per scanline (228, not 227.5). So the phase isn't reversed each line and there's no way to get any extra detail.