Jul. 3rd, 2020

joshua0: (Default)
a QAMconstellation atop a channel equalization graph

You know how it goes, sometimes. (Maybe.) You get an idea for a thing you want to try, and it's just kind of barely outside of your grasp -- your skills, your knowledge, whatever it is, just don't quite get you there. You take a stab at it, and you get stuck somewhere along the way. Two things can go next here, really, when this happens. Option 1, of course, is that you give up, take whatever you learned from it, and you go about your life. This is an eminently reasonable response that eminently reasonable people have. No shade here, honestly, seriously.

But sometimes, for whatever reason, Option 1 is off the table. Option 2 is insidious, and basically involves the thing plaguing you for years. Lots of years. You come back and take another go at it every once in a while, and maybe you get a little further each time. Or maybe not. Either way, an innocent toy project, more and more, becomes a nemesis. I dunno if this happens to anyone else, but, well, uh, this happened to me. 11 years ago. And out of nowhere, this time around, I have, at last, defeated it.

About 15 years ago, this madman French guy, Fabrice Bellard (perhaps better known for being the guy behind both of QEMU and FFMPEG), built some "magic DVB-T images". Basically, the way they work is that they abuse the fact that VGA graphics cards have a really high-speed digital-to-analog converter -- and that, while converting signals along, they make a lot of high-frequency harmonics -- to broadcast a digital TV radio signal, if only you'll hook up your graphics card's output pin to your digital TV receiver's antenna input pin, and configure your graphics card just so and display his image on "screen". This is a clearly bonkers idea, but shockingly, it actually works: you can "broadcast" a completely valid DVB-T signal from just your PC.
somethingthat looks nothing like a QAM constellation

Around July 2009, I took an intro-to-signals-and-systems class, and decided that, since I had taken a 200-level class on the matter, I clearly knew everything I needed to know on the subject, and that I could probably write a toy to demodulate this signal that Mr. Bellard posted, even without having any DVB-T hardware (or any DVB-T specific knowledge, for that matter). I wrote some very simple tools, and instantly got stuck. I took another swing in August 2009, and didn't have a whole lot more luck; I was lost in a world of Fourier transforms and orthogonal frequency division multiplexing and inter-symbol interference and channel equalization and something was wrong but I didn't know what.

My git history shows that around May 2011, I picked it up again, apparently one Sunday morning at 7 in the morning. I assumed I must've been on a flight somewhere -- that's when I always seem to pick this up. One commit message gave me the hint that I must've beaten myself up pretty good at finding that some of the actual heavy-duty math was basically right, but "...the number of bytes copied per row was incorrect". I put it down for a few months, walking away until October of that year, and then again around Thanksgiving.

Another few years passed. October 2015. Something got me stuck, but I didn't know what. Channel equalization or something like that was back haunting me again; another few years pass. These Trying Times In Which We're All In It Together were filling me with burnout; on a plane to Boston to visit my folks, I had no interest in doing any work that I had committed to anyone else that I'd do, and paging through my disk and looking for a distraction, I found my nemesis again.

* * *

You know, the funny thing about projects like these is the sense of anticlimax. Spending 11 years flipping through an opaque specification and a handful of papers to implement carrier recovery algorithms and what-the-hell-ever else. Then, all of the sudden, you run strings, and you get: Ballard's Network; Balears Picture. You've cracked the last piece of it. Anyone else who's heard you think about this project before has long since forgotten, and anyway, it's not anyone else's mortal enemy, it's you that it's been haunting. Sometimes there's that flash, "ok, that was cool. Why in the hell did I do that?"

I did learn a lot. I feel a lot more confident in my understanding of how digital signal processing works, I'll say that. OFDM felt like a magical concept, and even any kind of practical use of a Fourier transform seemed far from my grasp.

All of this is to say, though, that I oughta do this more often. There's this weird void now where this project was. I wonder what I'll fill it with. I've had my eye on trying to understand error-correction codes, and the math behind them; that one's been stalking me for a while, too. There are lots of things that haunt me, really, and have for years. Maybe some of them always will. But knocking off 11 years worth of one of them might just be a symbol for some of the others.

The code is on my GitHub, if you want.

Tags:
Page generated Jul. 3rd, 2025 08:55 pm
Powered by Dreamwidth Studios