joshua0: (Default)
[personal profile] joshua0
So, I had expected that on the airplane I would do something like sift through photos and write up a travelogue, or something like that. But, as they say, after three days without programming, life becomes meaningless... and looking at my tdl list output, I saw:

51 Revisit Fabrice's DVB-T thing.

A couple years ago (timestamps read around July 2009), I went to try to write a decoder for Fabrice Bellard's Magic DVB-T Images -- in a nutshell, he decided to build on the ideas of the TEMPEST-style broadcasting of music with a CRT, and to move up from there to using a VGA card's DAC to 'broadcast' a digital video (DVB-T) signal. I figured it would be a good test of how well I understood signals and the like if I could decode it myself, and so I began banging out code to do it. (Ultimately, if I got it very right, I could potentially write an encoder and port it to run on one of my FPGAs or something.)

Last I left off on this project, I was stuck; the pilot frequencies didn't line up, and the constellations that I got out of it looked something like this:

Uglystarfield
not QAM! nope nope nope nope nope.


On the plane, I started hacking on this again, and I came across the same 'stuck' point. I began writing up a post, calling for help from anyone who might know anyone who might know this sort of thing... and in true cardboard dog mode, I started to write a paragraph: "The problem can't be in the tool pgmtoraw because...", and then found the bug. So, instead of screenshots and tales of failure, here are some screenshots of success.

The "first light" was when I finally stopped injecting zeroes in the wrong places, and started putting them in the right places; this made all of the subcarrier frequencies at least be spaced properly in my downmixed output. Given the right guard alignment, I got this when I looked for a known pilot carrier:

Pilot constellation
Pilot constellation GET!


Plotted on this is all of the (real,imaginary) pairs on a single subcarrier; the locations of all valid pairs is a "constellation". You can see that this turned into a circle, where it really should be a single dot; this is because there is phase noise, which results in the single dot impulse being swung in a circle.

When I corrected the frequency offset to line the carriers up properly, I got this when I looked at a data carrier:

QAM constellation, with pilot
Now that's what I call QAM.


Exciting! (The dot at 0 degrees, by the way, is a pilot; this carrier also contains a scattered pilot cell, as per section 4.5.3 of the DVB-T spec.)

One more interesting thing to look at is this:
TPS signal constellation
TPS reports.


This is a TPS -- Transmission Parameter Signalling -- carrier. It contains a sequence of 68 bits or so that is repeatedly transmitted; it contains data about the constellation of other carrier (which we can obviously see is 16-QAM) and other decode information (which we can't visually determine from a constellation). I think this carrier is what I am most likely to attempt to decode next.

Anyway, this is exciting. The only concerning thing here is that the subcarriers apparently have 'phase wander'; each subcarrier seems to walk away from the next by around 5 or 6 degrees. I suspect that there is a real issue here that is being masked by the existence of the guard interval, but I don't know what it is.

We'll see what happens when I play with this more.
Page generated Feb. 12th, 2026 06:25 pm
Powered by Dreamwidth Studios