Tempest for ATSC

Recently I have become intrigued by the little 75-ohm coax plug on my plasma TV. To me, television programming isn’t worth nearly what Comcast charges for cable. I mostly watch DVDs, or television shows downloaded over the interweb. After reading about the fairly powerful digital television coverage in the bay area, I decided to plonk down $35 on a little amplified UHF antenna.

It’s a bit finicky at times, but I can receive at least 3 or 4 channels in crisp digital-cable-like HDTV quality. It’s really amazing how much data you can pump over the airwaves with the right compression and modulation. What’s more amazing, though, is that the ATSC tuner gives me a much sharper picture than I get over component video. Sure, HDMI would be ideal, but my TV doesn’t seem content with your average DVI signal.

So, how hard would it be to generate my own ATSC signal? I’d effectively be piping MPEG-2 data directly into the television’s logic board- if it could be done cheaply, it could be a really revolutionary way for HTPC hobbyists to get high quality video into any modern digital television. After thumbing through the ATSC spec, it looks like nearly the entire modulation job could be done by a sufficiently powerful CPU. Indeed, the GNU Radio project already has code for a software-only ATSC modulator and demodulator. All you’d need would be a 3-bit or higher D/A converter at about 10 MHz, a modulator, and a couple oscillators at very particular frequencies. Heck, this could be a $20 USB dongle.

Then, I happened upon what might be the coolest hack I’ve ever seen. Fabrice Bellard, the guy behind QEMU, wrote a software modulator for PAL, SECAM, and DVB-T. Sure, the GNU Radio project has had that for a while. The really novel part about this hack is that it uses the video card as both a DAC and an RF output stage!

Here on the other side of the pond from Fabrice I only have NTSC and ATSC television equipment, but nevertheless I felt like giving this hack a try. No source code unfortunately, but the images that result from the modulation process are available. I set up the PAL test image, and stuck an oscilloscope probe into the VGA port. Hey, this looks like it might be a valid video signal. Then I cart in a little 13″ television and start tuning around. I hit channel 7, and there’s a greyscale rendition of Lena! The vertical hold is almost nonexistent, but it sure ain’t bad for an NTSC television trying to display a PAL signal coming straight out of a GeForce 6200’s VGA port.

Then, I realize I haven’t even connected the other end of the coax cable. This whole time, my cheap scope probe has been acting as a transmitter antenna and the half-connected coax as a receive antenna. Lena has been travelling over about a foot of air. I plug the other end in, and the signal gets a whole lot less noisy.

It’s unfortunate that Fabrice didn’t include source, but I’m sure he has his reasons. The demo has inspired me, though. This isn’t the first time I’ve seen video outputs used in strange and unusual ways: long ago I coerced the LCD controller on a 68EZ328 (2nd generation Palm Pilot CPU) to generate a VGA signal. The horizontal and vertical blanking signals were painted right into the framebuffer. What really tickles me about this demo is that it’s exploiting the EMI given off by the card to modulate the finished RF signal.

Anyway, I think I’ll try my hand at an NTSC version of the demo… and eventually ATSC. I’m curious how much CPU power it would take to play back an MPEG stream in real-time this way. Worst case, it might require pre-processing to turn the MPEG stream into a raw stream of 8VSB codes. Could the modulation process be accelerated with fragment programs? This would definitely be the first time I’ve heard of OpenGL used to accelerate a radio.