Forum: GNU Radio ATSC decoder example in GR 3.7.1

8e98d2e11a8ef1f9cb289af66393ffa9?d=identicon&s=25 Ethan Trewhitt (Guest)
on 2013-10-16 04:02
(Received via mailing list)
As a part of my quest to understand some of the examples in GR (and
eventually contribute some well-commented GRC examples of my own),
I've been messing around with the atsc_rx.py script. Unfortunately,
since I have a USRP2, I can't sample at 6.4Msps like the script wants.
Instead, I tried sampling a strong local TV station at 10Msps and
resampling at 6.4Msps, but the result is a ton of errors in the
script's output and a large TS file that I can't make sense of.

I tried the following steps. First, capture a few seconds of raw TV
signal (channel 39 in my area is the physical frequency of WSB):

   uhd_rx_cfile -f 623M --samp-rate=10M -s wsb.iq

In a local copy of atsc_rx.py, I added the following filter:

   resamp = filter.fractional_resampler_cc(0, 10/6.4)

Then I added the resampler to the graph at the bottom of the script:

   tb.connect( srcf, is2c, resamp, rrc, ilp, duc, c2f, fpll, lp_filter)

Finally I ran the script:

   ./atsc_rx.py wsb.iq wsb.ts

The console fills with errors related to the ATSC stream:

8404
Using Volk machine: avx_64_mmx_orc
Setting initial_freq: 3065000.000000
atsc_field_sync_demux: synced (FIELD-1) at 426209 [delta = 426209]
atsc_viterbi_decoder: new starting offset = 0
atsc_field_sync_demux: lost sync at  464481
!!! atsci_equalizer: expected field sync, didn't find one
atsc_field_sync_demux: segment number overflow
atsc_viterbi_decoder: new starting offset = 7
!!! atsci_equalizer: expected field sync, didn't find one
atsc_field_sync_demux: segment number overflow
atsc_field_sync_demux: lost sync at 1225761
atsc_viterbi_decoder: new starting offset = 1...

(and so on, many times over)

I tried playing the output TS in vlc and reading it with avconv, but
both programs found tons of errors with the file and couldn't do
anything useful with it. For the record, with some tweaking of the Tx
settings, I was able to transmit the captured IQ file over the air and
play the clip on a nearby TV (on a different, unused channel), so I
know the data is in there somewhere.

My eventual goal is to turn this script into a GRC version, complete
with GRC xml files for the ATSC blocks currently included in GR.
However, I can't begin this process without having it working in the
first place. Is there anyone out there who understands the current
script and can modify it to work with an adjustable input sample rate?
That would go a long way toward helping me understand it all. Thanks
in advance.

Ethan T (courtarro)
C539637020fd56193dd6daec746c4a84?d=identicon&s=25 Tom Rondeau (Guest)
on 2013-10-22 22:44
(Received via mailing list)
On Tue, Oct 15, 2013 at 10:01 PM, Ethan Trewhitt
<gnuradio@potophobia.net> wrote:
> As a part of my quest to understand some of the examples in GR (and
> eventually contribute some well-commented GRC examples of my own),
> I've been messing around with the atsc_rx.py script. Unfortunately,
> since I have a USRP2, I can't sample at 6.4Msps like the script wants.
> Instead, I tried sampling a strong local TV station at 10Msps and
> resampling at 6.4Msps, but the result is a ton of errors in the
> script's output and a large TS file that I can't make sense of.

Hi Ethan,

I just wanted to point out that we've been working with Andrew Davis
on fixing up ATSC to a) work better and b) work with 3.7. He's made a
good start on things here:

https://github.com/glneo/gnuradio/tree/atscfixup

There's still work to be done, and Johnathan and I have been talking
about how to best get this into GNU Radio. If you're pursuing this
project, definitely look here and maybe talk directly with Andrew.
He's apparently gotten pretty busy with school work this semester, so
having another person working on this might be really good to finish
it up.

Thanks,
Tom
Please log in before posting. Registration is free and takes only a minute.
Existing account

NEW: Do you have a Google/GoogleMail, Yahoo or Facebook account? No registration required!
Log in with Google account | Log in with Yahoo account | Log in with Facebook account
No account? Register here.