Gnuradio ATSC Introduction and Signal Flow






Supporting Documents:

ATSC Standard 53E
What is 8VSB?
Fundamentals of 8VSB




In the 1940's, before the transistor was invented, the National Television System Committee created the NTSC standard still widely in use in the US. Today, looking forward to HDTV that is widely and rapidly being implemented, we have the Advanced Television Systems Committee, ATSC, currently Revision E (pdf format). Using modern signal processing ATSC makes much more effecient use of a 6Mhz television channel to deliver a better picture, stereo sound and other services such as program guides.

Many people have used an older version of gnuradio 0.9 to receive over-the-air digital television clips. However the original design used some expensive digitizing cards (the mc4020), plus the software in the 2.x version has much improved usability (python scripting of processing blocks) and efficiency. Also you can't even compile the 0.9 code with up to date gnu compilers - you have to use gcc 3.2 (circa RedHat 8). However, the 0.9 atsc_rx code does work fine. I have recently found two local digital TV stations I can pickup in my apartment and receive with a current production USRP with the TVRX tuner and a Radio Shack scanner antenna. After capturing some data with "usrp_rx_cfile.py" (from gnuradio-examples) another script converts the 8 MSps complex data to 20 MSps short data to emulate a real mc4020 card, suitable for the 0.9 atsc_rx software to get an mpeg transport stream "out of thin air". This works ok on a dual core processor, but does take over 12 hours of processing to create a 1/2 hour program.

The challenge now is to port the 0.9 code to the 2.0 version of gnuradio where we can better work with it, spreading the load over 4 cpu cores (a dual Opteron). It will likely still be far from "real time" TV but should approach "useful" especially with being able to keep a recording of the signal. Not to mention it's just a darned interesting system to learn.

Gnuradio 0.9 ATSC was created with plenty of testing and verification in mind. This breaks a large project up into managable units. In fact, the project involves creating a transmitter as well as receiver in order to 'loop back' each stage and verify it is working as expected.

To get the development version of gr-atsc from cvs, use:
$ export CVS_RSH="ssh"
$ cvs -z3 -d:pserver:anonymous@cvs.savannah.gnu.org:/sources/gnuradio co -P gnuradio-core
A good entry point is the python test script in gr-atsc/src/python/qa_atsc.py which creates a fake transport stream, explains the mpeg packet padding, and currently has loopback tests running on three stages. A lot of the required signal processing blocks are already implemented in gr-atsc/src/lib/atsci_* so a working 2.0 receiver is fairly far along.

Looking at the ATSC document 53E, page 56:



We currently have working and tested the Data Randomizer, Reed Solomon Encoder, and Data Interleaver. The Trellis Encoder has been largely implemented but not quite finished and tested. Other blocks to finish in the Gnuradio version are the Field Sync Mux, Symbol Mapper, Weaver Modulator head, Root Raised Cosine filter and Weaver Modulator Tail. The Weaver Modulator corresponds to the VSB (Vestigial Sideband) modulator above.

We don't intend to setup a HD transmitting station, but those are needed to step-by-step verify the stages of the receiver. Looking at another ATSC document for receiver design best practices, 54A, page 85:



Currently we have working and tested the Data De-Randomizer, Reed Solomon Decoder and Data De-Interleaver, as seen in qa_atsc.py. Yes to be finished are a Viterbi Decoder (loops back from the Trellis Encoder), a Field Sync Demux (I guess = to the Phase Tracker), Equalizer, Field Sync Checker and a Bit Timing Loop. Root Raised Cosine FIR Filters and FPLL Carrier Tracking PLL and down converters all already exist in the Gnuradio 2.0 code.




From gr-atsc/README.signal_flow:
ATSC Transmitter
================

module                  input                         output    notes
--------------------    ----------------              -------------------    --------
VrFileSource            "MPEG transport stream"       atsc_mpeg_packet
GrAtscRandomizer        atsc_mpeg_packet              atsc_mpeg_packet_no_sync    whiten data with LFSR
GrAtscRSEncoder         atsc_mpeg_packet_no_sync      atsc_mpeg_packet_rs_encoded  Reed-Soloman encoder
GrAtscInterleaver       atsc_mpeg_packet_rs_encoded   atsc_mpeg_packet_rs_encoded  convolutional interleaver
GrAtscTrellisEncoder    atsc_mpeg_packet_rs_encoded   atsc_data_segment    trellis encoder
GrAtscFieldSyncMux      atsc_data_segment             atsc_data_segment    add in field syncs
GrAtscSymbolMapper      atsc_data_segment             float    map [0,7] to +/- {1,3,5,7} and add pilot
GrWeaverModHead         float                         float,float    front half of Weaver VSB modulator
GrFIRfilterFFF (2x)     float                         float    low pass root raised cosine (matched filter)
GrWeaverModTail         float,float                   short    back half of Weaver VSB modulator
VrFileSink              short                         "16-bit passband data"

ATSC Receiver
=============

module                    input                        output     notes
--------------------      ----------------             -------------------     -------
VrFileSource              "16-bit passband data"       short
GrConvertSF               short                        float     convert short to float
GrFIRfilterFFF            float                        float     band pass root raised cosine centered at IF freq (matched filter)
GrAtscFPLL                float                        float     carrier tracking freq and phase lock loop with down converting mixer
GrFIRfilterFFF            float                        float     low pass to kill unwanted mixer image
GrRemoveDcFFF             float                        float     remove DC offset prior to symbol timing module
GrAtscBitTimingLoop3      float                        float,syminfo     track symbol & segment timing and do fractional interpolation
GrAtscFieldSyncChecker    float,syminfo                float,syminfo     look for field sync patterns
GrAtscEqualizer           float,syminfo                float,syminfo     LMS equalizer
GrAtscFieldSyncDemux      float,syminfo                atsc_soft_data_segment     remove field syncs and pack into data segments
GrAtscViterbiDecoder      atsc_soft_data_segment       atsc_mpeg_packet_rs_encoded  Viterbi decoder (12 seg delay)
GrAtscDeinterleaver       atsc_mpeg_packet_rs_encoded  atsc_mpeg_packet_rs_encoded  convolutional de-interleaver (52 seg delay)
GrAtscRSDecoder           atsc_mpeg_packet_rs_encoded  atsc_mpeg_packet_no_sync     Reed-Solomon decoder
GrAtscDerandomizer        atsc_mpeg_packet_no_sync     atsc_mpeg_packet     de-whiten with LFSR
VrFileSink                atsc_mpeg_packet             "MPEG transport stream"