An interactive look at how a video signal is made
blog.pizzabox.computer
An interactive look at how a video signal is made
1–10 of 19 posts
Re: An interactive look at how a video signal is made
#2Edit: and which bit is the horizontal retrace? The bit on the far left hand side, before the front porch?
Re: An interactive look at how a video signal is made
#3Very interesting. I'm just learning about VGA. On the oscilloscope, I assume the front and back porch is clearly visible on the left and right hand side. What's the fuzzy bit on the left, just before the picture starts? Edit: and which bit is the horizontal retrace? The bit on the far left hand side, before the front porch?
https://www.eetimes.com/wp-content/uploads/media-1050360-c01...
Re: An interactive look at how a video signal is made
#4For about two to three years now, I've leaned very heavily into analog video signals as a hobby. It culminated into me making not just a software PAL decoder, but my own fully compliant PAL "graphics card" with an FPGA and analog circuitry. PAL might be one of the most complicated analog video signals next to SECAM (though PAL is not that far from NTSC if you understand it well already), and I wanted to really understand every step in it, including all of the math.
I of course test everything with the once ubiquitous[1] PM5544 test pattern, which is described in noticeable detail here in case you were every wondering why it looks the way it does: https://web.archive.org/web/20190907170308/http://www.radios...
It's satisfying to really understand analog TV now. I watched a lot of TV through my life, and always had the thought that while I use it so much, I had no good idea how the TV in front of me actually worked. It's also a bit bittersweet, because while generating NTSC or PAL is still useful in existing composite video situations (the motivator for the PAL graphics card was another project where I needed composite output), there are almost no broadcasts left, and it seems rather outdated in general.
One day I might make a website that explains how NTSC and PAL work in detailed but understandable way, but I keep putting it off indefinitely.
[1] If you are from Europe or other PAL countries. In the US, I think simple SMTPE color bars were more common, and a lot of the elements in the PM5544 test card don't matter for NTSC.
Re: An interactive look at how a video signal is made
#5Very interesting. I'm just learning about VGA. On the oscilloscope, I assume the front and back porch is clearly visible on the left and right hand side. What's the fuzzy bit on the left, just before the picture starts? Edit: and which bit is the horizontal retrace? The bit on the far left hand side, before the front porch?
The solution was to modulate the color difference signal (two, actually, through quadrature amplitude modulation) to the existing signal, which was from then on called "luminance" (basically the "brightness information" of the picture).
The color burst not only indicates that the signal is color, it is also what the receiver locks onto to determine the phase of the color information modulated on the luminance signal. Quadrature amplitude modulation is "carrierless", so you need the color burst as a reference.
In NTSC, if you watch the signal live on an oscilloscope, the color burst usually appears as a static shape. In PAL, it's a blurry mess, because it purposefully not only flips 180° with every line, it also gets shifted a bit. That's the result of some schemes added from NTSC to PAL to make the picture more palpable. Since the color signal (mostly[1]) occupies the same bandwidth as the luminance signal, there is noticeable crosstalk between the two.
It also works against phase errors: People who grew up in the US will know the "tint control" on the TV used to correct the hue of the picture. In PAL-land, that was not a thing anymore.
[1] The color signal tries to occupy the gaps in the spectrum of the luminance signal, which in most realistic images are the result of the line-based nature of video signals. However it can never be perfect, there will practically always be overlap such that luminance and chrominance cannot be fully separated.
Re: An interactive look at how a video signal is made
#6Very interesting. I'm just learning about VGA. On the oscilloscope, I assume the front and back porch is clearly visible on the left and right hand side. What's the fuzzy bit on the left, just before the picture starts? Edit: and which bit is the horizontal retrace? The bit on the far left hand side, before the front porch?
Not quite.
The front porch is actually the black level on the right hand side (I know, this confused me at first, too), at the end of the line, when the signal drops back to the black level. The sync pulse is the lower-than-black bit in the middle. The back porch is the portion thereafter, containing the fuzzy bit. Collectively these are called the horizontal blanking interval.
The fuzzy bit is the color burst. Color TV was a hack on the original B&W design. To put color information into the signal without making a whole new signal that existing sets couldn't decode, the color information is ̶p̶h̶a̶s̶e̶-̶m̶o̶d̶u̶l̶a̶t̶e̶d̶ quadrature-modulated upon the luma signal. You need a phase reference to decode that information, and that's what the color burst is there for. If this were a color demo, rather than the nice, neat square waves, we'd see the rest of the signal line looking similarly fuzzy. Wikipedia has a nice diagram[1].
Why is the sync pulse below the black level? Well, consider the original B&W signal. The brightness of any portion of the picture was controlled by how strong the cathode was emitting when it swept across that portion of the screen. The intensity of the picture tube's cathode is controlled directly by voltage level of the video signal[2] during the active display period (the portion of the line not part of the horizontal blanking interval). So great, we've come to the end of a line, shut off the cathode after it has swept one line across the display tube, and need to reposition it to sweep another line. Why can't we just keep the signal at the black level instead of dipping below black? Well, analog signals and circuits can be kinda fiddly. Components drift or go bad. People think they know better than the warning of no user-serviceable parts. So it's entirely possible that due to a bad or misconfigured circuit, the cathode could actually not be quite off when fed a signal at the black level. In one of those cases, if the cathode were still on during retrace, the user would see slanting lines drawn across the picture, and might rightly get annoyed at this. So, to ensure that, no really, the cathode is actually off for reals during retrace, the signal is pulled below the black level so there will be no retrace lines drawn on the picture on any sets where the brightness levels are iffy for whatever reason.[3]
1. https://en.wikipedia.org/wiki/Analog_television#Structure_of....
2. You could demonstrate this by raising/lowering the level of the square wave from/to the black/white level on the signal in this demo, and get a neat gradient effect.
3. On some sets, you actually can still force the cathode on during retrace and see the retrace lines by cranking the brightness all the way up. Probably not the best thing for the life of the tube, though.
Edit: update with corrections in anyfoo's reply, below. Also added the link to the Wikipedia diagram I had originally intended to include.
More Edit: Added an explanation of why the sync pulse is below the black level (blacker-than-black), because even though parent didn't ask, I'm pretty sure someone else is wondering (I know I used to).
Re: An interactive look at how a video signal is made
#7Very interesting. I'm just learning about VGA. On the oscilloscope, I assume the front and back porch is clearly visible on the left and right hand side. What's the fuzzy bit on the left, just before the picture starts? Edit: and which bit is the horizontal retrace? The bit on the far left hand side, before the front porch?
> On the oscilloscope, I assume the front and back porch is clearly visible on the left and right hand side. Not quite. The front porch is actually the black level on the right hand side (I know, this confused me at first, too), at the end of the line, when the signal drops back to the black level. The sync pulse is the lower-than-black bit in the middle. The back porch is the portion thereafter, containing the fuzzy…
The two signals in the quadrature amplitude modulation are the two color difference signals. While that is the intent and also usually how encoders and decoders are actually implemented, most elegantly the math works out to a different interpretation as well: You can see the phase as the hue (i.e. what color), and the amplitude as the saturation (i.e. how much color).
That alternative interpretation works extremely well to explain the whole scheme without having to explain how and why quadrature amplitude modulation works (which needs a lot of math).
Re: An interactive look at how a video signal is made
#8This is pretty cool. For about two to three years now, I've leaned very heavily into analog video signals as a hobby. It culminated into me making not just a software PAL decoder, but my own fully compliant PAL "graphics card" with an FPGA and analog circuitry. PAL might be one of the most complicated analog video signals next to SECAM (though PAL is not that far from NTSC if you understand it well already), and I wa…
I've been meaning to do the same thing.
I had to learn a lot about NTSC/PAL just so I could calculate the correct aspect ratios for GameCube/Wii games in Dolphin Emulator.
It was a little annoying because none of the standards actually seemed to define which part of the signal had a 4:3 aspect ratio.
I actually implemented a small idealized emulation of the flyback transformers so I could still produce results if a game (or more likely homebrew) was to reconfigure VI for a non-standard timings with non number of vertical lines.
Though you probably know more about color encoding than me.
The main thing I really want to explain to people is how the 240p signal that older consoles output work when the TV is "expecting" an interlaced signal.
Re: An interactive look at how a video signal is made
#9Re: An interactive look at how a video signal is made
#10Ben Eater has a great video[1] about building a video card from simple gates and other basic components. It goes into some detail about how a VGA signal is generated. [1]: https://www.youtube.com/watch?v=l7rce6IQDWs