diff options
author | Andrew F. Davis <glneolistmail@gmail.com> | 2013-07-14 14:46:28 -0400 |
---|---|---|
committer | Andrew F. Davis <glneolistmail@gmail.com> | 2013-07-14 14:46:28 -0400 |
commit | a2b93f07d85558399c50c4d377dfb3f75ceeeaa2 (patch) | |
tree | 909b8d33001f4a8c39965375aa7d1a0e49b06671 /gr-atsc | |
parent | 7f21a6fe54e82bed594c5f1432fe0ac7eeae7ad9 (diff) |
Created atsc_rx.py and removed obsolete scripts
Several bug fixes and speedups rolled into one ATSC
decoder script. The old method included separately
launched scripts linked with named pipes, this was
tedious and slowed down decoding, so I have moved
their functionality into one flowgraph.
Diffstat (limited to 'gr-atsc')
-rw-r--r-- | gr-atsc/python/atsc/CMakeLists.txt | 6 | ||||
-rw-r--r-- | gr-atsc/python/atsc/README | 25 | ||||
-rw-r--r-- | gr-atsc/python/atsc/all_atsc.py | 142 | ||||
-rwxr-xr-x | gr-atsc/python/atsc/atsc_rx.py | 134 | ||||
-rwxr-xr-x | gr-atsc/python/atsc/btl-fsd.py | 48 | ||||
-rwxr-xr-x | gr-atsc/python/atsc/fpll.py | 88 | ||||
-rwxr-xr-x | gr-atsc/python/atsc/interp.py | 66 | ||||
-rwxr-xr-x | gr-atsc/python/atsc/interp_short.py | 78 | ||||
-rwxr-xr-x | gr-atsc/python/atsc/viterbi-out.py | 58 | ||||
-rwxr-xr-x | gr-atsc/python/atsc/xlate.py | 58 |
10 files changed, 140 insertions, 563 deletions
diff --git a/gr-atsc/python/atsc/CMakeLists.txt b/gr-atsc/python/atsc/CMakeLists.txt index 881a3bb9fc..ab19b13e2d 100644 --- a/gr-atsc/python/atsc/CMakeLists.txt +++ b/gr-atsc/python/atsc/CMakeLists.txt @@ -32,11 +32,7 @@ GR_PYTHON_INSTALL( GR_PYTHON_INSTALL( PROGRAMS - btl-fsd.py - fpll.py - interp.py - xlate.py - viterbi-out.py + atsc_rx.py DESTINATION ${GR_PKG_DATA_DIR}/examples/atsc COMPONENT "atsc_examples" ) diff --git a/gr-atsc/python/atsc/README b/gr-atsc/python/atsc/README index 74d6ba134c..38772c2f10 100644 --- a/gr-atsc/python/atsc/README +++ b/gr-atsc/python/atsc/README @@ -1,11 +1,11 @@ -Decoding ATSC using 19.2MSps rate over 5 processes --------------------------------------------------- +Decoding ATSC using 6.4MSps rate +--------------------------------- 1) Verify signal, adjust antenna and find best gain setting using uhd_fft.py, station frequency from the fcc video database, and sample rate to 6.4e6. 2) Capture data - adjust gain (-g) frequency (-f) and which side -the tvrx is on to fit your local setup: +the daughterboard is on to fit your local setup: uhd_rx_cfile.py -s --samp-rate=6.4e6 -g 65 -f 503e6 atsc_data_6-4m_complex @@ -14,21 +14,6 @@ striped sata drives. Make sure there are no or very few Ou overruns. Saving the raw usrp data in 'short' form halves the disk space/bus bandwidth that the usual complex form uses. -3) Make pipes: - -mkfifo /tmp/atsc_pipe_1 -mkfifo /tmp/atsc_pipe_2 -mkfifo /tmp/atsc_pipe_3 -mkfifo /tmp/atsc_pipe_4 -mkfifo /tmp/atsc_pipe_5 - -4) In seperate windows run processes: - -./interp_short.py <input rf data at 6.4Msps> -./xlate.py -./fpll.py -./btl-fsd.py -./viterbi-out.py <output mpeg transport stream> - - +3) Run atsc_rx.py: +./atsc_rx.py atsc_data_6-4m_complex outfile.ts
\ No newline at end of file diff --git a/gr-atsc/python/atsc/all_atsc.py b/gr-atsc/python/atsc/all_atsc.py deleted file mode 100644 index 7cac785149..0000000000 --- a/gr-atsc/python/atsc/all_atsc.py +++ /dev/null @@ -1,142 +0,0 @@ -#!/usr/bin/env /usr/bin/python -# -# Copyright 2004 Free Software Foundation, Inc. -# -# This file is part of GNU Radio -# -# GNU Radio is free software; you can redistribute it and/or modify -# it under the terms of the GNU General Public License as published by -# the Free Software Foundation; either version 2, or (at your option) -# any later version. -# -# GNU Radio is distributed in the hope that it will be useful, -# but WITHOUT ANY WARRANTY; without even the implied warranty of -# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -# GNU General Public License for more details. -# -# You should have received a copy of the GNU General Public License -# along with GNU Radio; see the file COPYING. If not, write to -# the Free Software Foundation, Inc., 59 Temple Place - Suite 330, -# Boston, MA 02111-1307, USA. -# -# This module starts the atsc processing chain taking the captured -# off-air signal created with: -# -# uhd_rx_cfile.py --samp-rate=6.4e6 -# -f <center of tv signal channel freq> -# -g <appropriate gain for best signal / noise> -# -s output shorts -# -# All this module does is multiply the sample rate by 3, from 6.4e6 to -# 19.2e6 complex samples / sec, then lowpass filter with a cutoff of 3.2MHz -# and a transition band width of .5MHz. Center of the tv channels is -# then at 0 with edges at -3.2MHz and 3.2MHz. - -from gnuradio import gr, atsc -from gnuradio import filter -from gnuradio import blocks -import sys, os, math - -def graph (args): - - nargs = len(args) - if nargs == 2: - infile = args[0] - outfile = args[1] - else: - raise ValueError('usage: interp.py input_file output_file\n') - - tb = gr.top_block () - - # Convert to a from shorts to a stream of complex numbers. - srcf = blocks.file_source (gr.sizeof_short,infile) - s2ss = blocks.stream_to_streams(gr.sizeof_short,2) - s2f1 = blocks.short_to_float() - s2f2 = blocks.short_to_float() - src0 = blocks.float_to_complex() - tb.connect(srcf, s2ss) - tb.connect((s2ss, 0), s2f1, (src0, 0)) - tb.connect((s2ss, 1), s2f2, (src0, 1)) - - # Low pass filter it and increase sample rate by a factor of 3. - lp_coeffs = filter.firdes.low_pass ( 3, 19.2e6, 3.2e6, .5e6, filter.firdes.WIN_HAMMING ) - lp = filter.interp_fir_filter_ccf ( 3, lp_coeffs ) - tb.connect(src0, lp) - - # Upconvert it. - duc_coeffs = filter.firdes.low_pass ( 1, 19.2e6, 9e6, 1e6, filter.firdes.WIN_HAMMING ) - duc = filter.freq_xlating_fir_filter_ccf ( 1, duc_coeffs, 5.75e6, 19.2e6 ) - # Discard the imaginary component. - c2f = blocks.complex_to_float() - tb.connect(lp, duc, c2f) - - # Frequency Phase Lock Loop - input_rate = 19.2e6 - IF_freq = 5.75e6 - # 1/2 as wide because we're designing lp filter - symbol_rate = atsc.ATSC_SYMBOL_RATE/2. - NTAPS = 279 - tt = filter.firdes.root_raised_cosine (1.0, input_rate, symbol_rate, .115, NTAPS) - # heterodyne the low pass coefficients up to the specified bandpass - # center frequency. Note that when we do this, the filter bandwidth - # is effectively twice the low pass (2.69 * 2 = 5.38) and hence - # matches the diagram in the ATSC spec. - arg = 2. * math.pi * IF_freq / input_rate - t=[] - for i in range(len(tt)): - t += [tt[i] * 2. * math.cos(arg * i)] - rrc = filter.fir_filter_fff(1, t) - - fpll = atsc.fpll() - - pilot_freq = IF_freq - 3e6 + 0.31e6 - lower_edge = 6e6 - 0.31e6 - upper_edge = IF_freq - 3e6 + pilot_freq - transition_width = upper_edge - lower_edge - lp_coeffs = filter.firdes.low_pass(1.0, - input_rate, - (lower_edge + upper_edge) * 0.5, - transition_width, - filter.firdes.WIN_HAMMING); - - lp_filter = filter.fir_filter_fff(1,lp_coeffs) - - alpha = 1e-5 - iir = filter.single_pole_iir_filter_ff(alpha) - remove_dc = blocks.sub_ff() - - tb.connect(c2f, fpll, lp_filter) - tb.connect(lp_filter, iir) - tb.connect(lp_filter, (remove_dc,0)) - tb.connect(iir, (remove_dc,1)) - - # Bit Timing Loop, Field Sync Checker and Equalizer - - btl = atsc.bit_timing_loop() - fsc = atsc.fs_checker() - eq = atsc.equalizer() - fsd = atsc.field_sync_demux() - - tb.connect(remove_dc, btl) - tb.connect((btl, 0),(fsc, 0),(eq, 0),(fsd, 0)) - tb.connect((btl, 1),(fsc, 1),(eq, 1),(fsd, 1)) - - # Viterbi - - viterbi = atsc.viterbi_decoder() - deinter = atsc.deinterleaver() - rs_dec = atsc.rs_decoder() - derand = atsc.derandomizer() - depad = atsc.depad() - dst = blocks.file_sink(gr.sizeof_char, outfile) - tb.connect(fsd, viterbi, deinter, rs_dec, derand, depad, dst) - - dst2 = blocks.file_sink(gr.sizeof_gr_complex, "atsc_complex.data") - tb.connect(src0, dst2) - - tb.run () - -if __name__ == '__main__': - graph (sys.argv[1:]) - - diff --git a/gr-atsc/python/atsc/atsc_rx.py b/gr-atsc/python/atsc/atsc_rx.py new file mode 100755 index 0000000000..377c4daa29 --- /dev/null +++ b/gr-atsc/python/atsc/atsc_rx.py @@ -0,0 +1,134 @@ +#!/usr/bin/env /usr/bin/python +# +# Copyright 2004, 2013 Free Software Foundation, Inc. +# +# This file is part of GNU Radio +# +# GNU Radio is free software; you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation; either version 2, or (at your option) +# any later version. +# +# GNU Radio is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with GNU Radio; see the file COPYING. If not, write to +# the Free Software Foundation, Inc., 59 Temple Place - Suite 330, +# Boston, MA 02111-1307, USA. +# +# This module starts the atsc processing chain taking the captured +# off-air signal created with: +# +# uhd_rx_cfile.py --samp-rate=6.4e6 +# -f <center of tv signal channel freq> +# -g <appropriate gain for best signal / noise> +# -s output shorts +# +# This python script converts from interleaved shorts to the complex data type, +# then multiplies the sample rate by 3, from 6.4e6 to 19.2e6 +# complex samples / sec, then lowpass filters with a cutoff of 3.2MHz +# and a transition band width of .5MHz. Center of the tv channels is +# now at 0 with edges at -3.2MHz and 3.2MHz. This puts the pilot at +# -3MHz + 309KHz. Next a root raised cosine filter is aplied to match the one +# in the transmitter and thus reduce ISI. The phased locked loop then locks to +# the pilot and outputs just the real part of the signal ( as information is +# not stored in the phase with atsc ), this is then feed to the bit lock +# loop, this looks for the bit sync marker put at the beginning of every segment +# field, this then adjusts the timing so the amplitude will be sampled at the +# correct sample ( sub-sample is used in this case ). +# +# Output is float. + +from gnuradio import gr, analog, atsc +from gnuradio import blocks +from gnuradio import filter +import sys, math, os + +def graph (args): + + print os.getpid() + + nargs = len(args) + if nargs == 2: + infile = args[0] + outfile = args[1] + else: + raise ValueError('usage: interp.py input_file output_file.ts\n') + + input_rate = 19.2e6 + IF_freq = 5.75e6 + + tb = gr.top_block() + + # Read from input file + srcf = blocks.file_source(gr.sizeof_short, infile) + + # Convert interleaved shorts (I,Q,I,Q) to complex + is2c = blocks.interleaved_short_to_complex() + + # 1/2 as wide because we're designing lp filter + symbol_rate = atsc.ATSC_SYMBOL_RATE/2. + NTAPS = 279 + tt = filter.firdes.root_raised_cosine (1.0, input_rate / 3, symbol_rate, .1152, NTAPS) + rrc = filter.fir_filter_ccf(1, tt) + + # Interpolate Filter our 6MHz wide signal centered at 0 + ilp_coeffs = filter.firdes.low_pass(1, input_rate, 3.2e6, .5e6, filter.firdes.WIN_HAMMING) + ilp = filter.interp_fir_filter_ccf(3, ilp_coeffs) + + # Move the center frequency to 5.75MHz ( this wont be needed soon ) + duc_coeffs = filter.firdes.low_pass ( 1, 19.2e6, 9e6, 1e6, filter.firdes.WIN_HAMMING ) + duc = filter.freq_xlating_fir_filter_ccf ( 1, duc_coeffs, -5.75e6, 19.2e6 ) + + # fpll input is float + c2f = blocks.complex_to_float() + + # Phase locked loop + fpll = atsc.fpll() + + # Clean fpll output + lp_coeffs2 = filter.firdes.low_pass (1.0, + input_rate, + 5.75e6, + 120e3, + filter.firdes.WIN_HAMMING); + lp_filter = filter.fir_filter_fff (1, lp_coeffs2) + + # Remove pilot ( at DC now ) + iir = filter.single_pole_iir_filter_ff(1e-5) + remove_dc = blocks.sub_ff() + + # Bit Timing Loop, Field Sync Checker and Equalizer + btl = atsc.bit_timing_loop() + fsc = atsc.fs_checker() + eq = atsc.equalizer() + fsd = atsc.field_sync_demux() + + # Viterbi + viterbi = atsc.viterbi_decoder() + deinter = atsc.deinterleaver() + rs_dec = atsc.rs_decoder() + derand = atsc.derandomizer() + depad = atsc.depad() + + # Write to output file + outf = blocks.file_sink(gr.sizeof_char,outfile) + + # Connect it all together + tb.connect( srcf, is2c, rrc, ilp, duc, c2f, fpll, lp_filter) + tb.connect( lp_filter, iir ) + tb.connect( lp_filter, (remove_dc, 0) ) + tb.connect( iir, (remove_dc, 1) ) + tb.connect( remove_dc, btl ) + tb.connect( (btl, 0), (fsc, 0), (eq, 0), (fsd,0) ) + tb.connect( (btl, 1), (fsc, 1), (eq, 1), (fsd,1) ) + tb.connect( fsd, viterbi, deinter, rs_dec, derand, depad, outf ) + + tb.run() + +if __name__ == '__main__': + graph (sys.argv[1:]) + diff --git a/gr-atsc/python/atsc/btl-fsd.py b/gr-atsc/python/atsc/btl-fsd.py deleted file mode 100755 index 6bcab3dce3..0000000000 --- a/gr-atsc/python/atsc/btl-fsd.py +++ /dev/null @@ -1,48 +0,0 @@ -#!/usr/bin/env python -# -# Copyright 2004,2005,2007 Free Software Foundation, Inc. -# -# This file is part of GNU Radio -# -# GNU Radio is free software; you can redistribute it and/or modify -# it under the terms of the GNU General Public License as published by -# the Free Software Foundation; either version 3, or (at your option) -# any later version. -# -# GNU Radio is distributed in the hope that it will be useful, -# but WITHOUT ANY WARRANTY; without even the implied warranty of -# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -# GNU General Public License for more details. -# -# You should have received a copy of the GNU General Public License -# along with GNU Radio; see the file COPYING. If not, write to -# the Free Software Foundation, Inc., 59 Temple Place - Suite 330, -# Boston, MA 02111-1307, USA. -# - -from gnuradio import gr -from gnuradio import atsc -from gnuradio import blocks -import os - -print os.getpid() - -tb = gr.top_block() - -btl = atsc.bit_timing_loop() -fsc = atsc.fs_checker() -eq = atsc.equalizer() -fsd = atsc.field_sync_demux() - -out_data = blocks.file_sink(atsc.sizeof_atsc_soft_data_segment,"/tmp/atsc_pipe_5") - -inp = blocks.file_source(gr.sizeof_float,"/tmp/atsc_pipe_3") - -tb.connect(inp,btl) -tb.connect((btl,0),(fsc,0),(eq,0),(fsd,0)) -tb.connect((btl,1),(fsc,1),(eq,1),(fsd,1)) -tb.connect(fsd,out_data) - -tb.run() - - diff --git a/gr-atsc/python/atsc/fpll.py b/gr-atsc/python/atsc/fpll.py deleted file mode 100755 index dee81da13d..0000000000 --- a/gr-atsc/python/atsc/fpll.py +++ /dev/null @@ -1,88 +0,0 @@ -#!/usr/bin/env python -# -# Copyright 2004,2005 Free Software Foundation, Inc. -# -# This file is part of GNU Radio -# -# GNU Radio is free software; you can redistribute it and/or modify -# it under the terms of the GNU General Public License as published by -# the Free Software Foundation; either version 3, or (at your option) -# any later version. -# -# GNU Radio is distributed in the hope that it will be useful, -# but WITHOUT ANY WARRANTY; without even the implied warranty of -# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -# GNU General Public License for more details. -# -# You should have received a copy of the GNU General Public License -# along with GNU Radio; see the file COPYING. If not, write to -# the Free Software Foundation, Inc., 59 Temple Place - Suite 330, -# Boston, MA 02111-1307, USA. -# - -from gnuradio import gr, atsc -from gnuradio import blocks -from gnuradio import filter -import math, os - -def main(): - - print os.getpid() - - tb = gr.top_block() - - u = blocks.file_source(gr.sizeof_float,"/tmp/atsc_pipe_2") - - input_rate = 19.2e6 - IF_freq = 5.75e6 - - - # 1/2 as wide because we're designing lp filter - symbol_rate = atsc.ATSC_SYMBOL_RATE/2. - NTAPS = 279 - tt = filter.firdes.root_raised_cosine (1.0, input_rate, symbol_rate, .115, NTAPS) - # heterodyne the low pass coefficients up to the specified bandpass - # center frequency. Note that when we do this, the filter bandwidth - # is effectively twice the low pass (2.69 * 2 = 5.38) and hence - # matches the diagram in the ATSC spec. - arg = 2. * math.pi * IF_freq / input_rate - t=[] - for i in range(len(tt)): - t += [tt[i] * 2. * math.cos(arg * i)] - rrc = filter.fir_filter_fff(1, t) - - fpll = atsc.fpll() - - pilot_freq = IF_freq - 3e6 + 0.31e6 - lower_edge = 6e6 - 0.31e6 - upper_edge = IF_freq - 3e6 + pilot_freq - transition_width = upper_edge - lower_edge - lp_coeffs = filter.firdes.low_pass (1.0, - input_rate, - (lower_edge + upper_edge) * 0.5, - transition_width, - filter.firdes.WIN_HAMMING); - - lp_filter = filter.fir_filter_fff (1,lp_coeffs) - - alpha = 1e-5 - iir = filter.single_pole_iir_filter_ff(alpha) - remove_dc = blocks.sub_ff() - - out = blocks.file_sink(gr.sizeof_float,"/tmp/atsc_pipe_3") - # out = blocks.file_sink(gr.sizeof_float,"/mnt/sata/atsc_data_float") - - tb.connect(u, fpll, lp_filter) - tb.connect(lp_filter, iir) - tb.connect(lp_filter, (remove_dc,0)) - tb.connect(iir, (remove_dc,1)) - tb.connect(remove_dc, out) - - tb.run() - - -if __name__ == '__main__': - main () - - - diff --git a/gr-atsc/python/atsc/interp.py b/gr-atsc/python/atsc/interp.py deleted file mode 100755 index ee2d234892..0000000000 --- a/gr-atsc/python/atsc/interp.py +++ /dev/null @@ -1,66 +0,0 @@ -#!/usr/bin/env /usr/bin/python -# -# Copyright 2004,2007 Free Software Foundation, Inc. -# -# This file is part of GNU Radio -# -# GNU Radio is free software; you can redistribute it and/or modify -# it under the terms of the GNU General Public License as published by -# the Free Software Foundation; either version 3, or (at your option) -# any later version. -# -# GNU Radio is distributed in the hope that it will be useful, -# but WITHOUT ANY WARRANTY; without even the implied warranty of -# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -# GNU General Public License for more details. -# -# You should have received a copy of the GNU General Public License -# along with GNU Radio; see the file COPYING. If not, write to -# the Free Software Foundation, Inc., 59 Temple Place - Suite 330, -# Boston, MA 02111-1307, USA. -# -# This module starts the atsc processing chain taking the captured -# off-air signal created with: -# -# uhd_rx_cfile.py --samp-rate=6.4e6 -# -f <center of tv signal channel freq> -# -g <appropriate gain for best signal / noise> -# -# All this module does is multiply the sample rate by 3, from 6.4e6 to -# 19.2e6 complex samples / sec, then lowpass filter with a cutoff of 3.2MHz -# and a transition band width of .5MHz. Center of the tv channels is -# then at 0 with edges at -3.2MHz and 3.2MHz. - -from gnuradio import gr -from gnuradio import blocks -import sys - -def graph(args): - - nargs = len(args) - if nargs == 1: - infile = args[0] - else: - sys.stderr.write('usage: interp.py input_file\n') - sys.exit(1) - - tb = gr.top_block() - - src0 = blocks.file_source(gr.sizeof_gr_complex, infile) - - lp_coeffs = filter.firdes.low_pass(3, 19.2e6, 3.2e6, .5e6, - filter.firdes.WIN_HAMMING ) - lp = filter.interp_fir_filter_ccf(1, lp_coeffs) - - file = blocks.file_sink(gr.sizeof_gr_complex, "/tmp/atsc_pipe_1") - - tb.connect(src0, lp, file) - - tb.start() - raw_input('Head End: Press Enter to stop') - tb.stop() - -if __name__ == '__main__': - graph(sys.argv[1:]) - - diff --git a/gr-atsc/python/atsc/interp_short.py b/gr-atsc/python/atsc/interp_short.py deleted file mode 100755 index d07b941c12..0000000000 --- a/gr-atsc/python/atsc/interp_short.py +++ /dev/null @@ -1,78 +0,0 @@ -#!/usr/bin/env /usr/bin/python -# -# Copyright 2004 Free Software Foundation, Inc. -# -# This file is part of GNU Radio -# -# GNU Radio is free software; you can redistribute it and/or modify -# it under the terms of the GNU General Public License as published by -# the Free Software Foundation; either version 2, or (at your option) -# any later version. -# -# GNU Radio is distributed in the hope that it will be useful, -# but WITHOUT ANY WARRANTY; without even the implied warranty of -# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -# GNU General Public License for more details. -# -# You should have received a copy of the GNU General Public License -# along with GNU Radio; see the file COPYING. If not, write to -# the Free Software Foundation, Inc., 59 Temple Place - Suite 330, -# Boston, MA 02111-1307, USA. -# -# This module starts the atsc processing chain taking the captured -# off-air signal created with: -# -# uhd_rx_cfile.py --samp-rate=6.4e6 -# -f <center of tv signal channel freq> -# -g <appropriate gain for best signal / noise> -# -s output shorts -# -# All this module does is multiply the sample rate by 3, from 6.4e6 to -# 19.2e6 complex samples / sec, then lowpass filter with a cutoff of 3.2MHz -# and a transition band width of .5MHz. Center of the tv channels is -# then at 0 with edges at -3.2MHz and 3.2MHz. - -from gnuradio import gr -from gnuradio import blocks -from gnuradio import filter -import sys, os - -def graph (args): - - print os.getpid() - - nargs = len (args) - if nargs == 1: - infile = args[0] - else: - sys.stderr.write('usage: interp.py input_file\n') - sys.exit (1) - - tb = gr.top_block() - - srcf = blocks.file_source(gr.sizeof_short,infile) - s2ss = blocks.stream_to_streams(gr.sizeof_short,2) - s2f1 = blocks.short_to_float() - s2f2 = blocks.short_to_float() - src0 = blocks.float_to_complex() - - - lp_coeffs = filter.firdes.low_pass(3, 19.2e6, 3.2e6, .5e6, - filter.firdes.WIN_HAMMING) - lp = filter.interp_fir_filter_ccf(3, lp_coeffs) - - file = blocks.file_sink(gr.sizeof_gr_complex,"/tmp/atsc_pipe_1") - - tb.connect( srcf, s2ss ) - tb.connect( (s2ss, 0), s2f1, (src0,0) ) - tb.connect( (s2ss, 1), s2f2, (src0,1) ) - tb.connect( src0, lp, file) - - tb.start() - raw_input ('Head End: Press Enter to stop') - tb.stop() - -if __name__ == '__main__': - graph (sys.argv[1:]) - - diff --git a/gr-atsc/python/atsc/viterbi-out.py b/gr-atsc/python/atsc/viterbi-out.py deleted file mode 100755 index cc60ffda42..0000000000 --- a/gr-atsc/python/atsc/viterbi-out.py +++ /dev/null @@ -1,58 +0,0 @@ -#!/usr/bin/env python -# -# Copyright 2004,2006,2007 Free Software Foundation, Inc. -# -# This file is part of GNU Radio -# -# GNU Radio is free software; you can redistribute it and/or modify -# it under the terms of the GNU General Public License as published by -# the Free Software Foundation; either version 3, or (at your option) -# any later version. -# -# GNU Radio is distributed in the hope that it will be useful, -# but WITHOUT ANY WARRANTY; without even the implied warranty of -# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -# GNU General Public License for more details. -# -# You should have received a copy of the GNU General Public License -# along with GNU Radio; see the file COPYING. If not, write to -# the Free Software Foundation, Inc., 59 Temple Place - Suite 330, -# Boston, MA 02111-1307, USA. -# - -from gnuradio import gr, atsc -from gnuradio import blocks -import sys, os - -def main(args): - - print os.getpid() - - nargs = len (args) - if nargs == 1: - outfile = args[0] - else: - sys.stderr.write ('usage: viterbi_out.py output_file\n') - sys.exit (1) - - tb = gr.top_block() - - src = blocks.file_source(atsc.sizeof_atsc_soft_data_segment, "/tmp/atsc_pipe_5") - viterbi = atsc.viterbi_decoder() - deinter = atsc.deinterleaver() - rs_dec = atsc.rs_decoder() - derand = atsc.derandomizer() - depad = atsc.depad() - dst = blocks.file_sink(gr.sizeof_char,outfile) - tb.connect(src, viterbi, deinter, rs_dec, derand, depad, dst) - tb.run () - - -if __name__ == '__main__': - main(sys.argv[1:]) - - - - - - diff --git a/gr-atsc/python/atsc/xlate.py b/gr-atsc/python/atsc/xlate.py deleted file mode 100755 index eb04ecc68a..0000000000 --- a/gr-atsc/python/atsc/xlate.py +++ /dev/null @@ -1,58 +0,0 @@ -#!/usr/bin/env /usr/bin/python -# -# Copyright 2004,2007 Free Software Foundation, Inc. -# -# This file is part of GNU Radio -# -# GNU Radio is free software; you can redistribute it and/or modify -# it under the terms of the GNU General Public License as published by -# the Free Software Foundation; either version 3, or (at your option) -# any later version. -# -# GNU Radio is distributed in the hope that it will be useful, -# but WITHOUT ANY WARRANTY; without even the implied warranty of -# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -# GNU General Public License for more details. -# -# You should have received a copy of the GNU General Public License -# along with GNU Radio; see the file COPYING. If not, write to -# the Free Software Foundation, Inc., 59 Temple Place - Suite 330, -# Boston, MA 02111-1307, USA. -# -# This module upconverts the 19.2e6 sample rate signal from a center -# of 0 to 5.75e6 and converts to float, to prepare the signal for -# the old gnuradio 0.9 block (bit timing loop, field sync checker, -# equalizer and field sync demux), effectively simulating an -# mc4020 card, except the sample rate is 19.2e6 instead of 20e6. -# -# The signal is then centered on 5.75e6 with edges at 5.75 + 3.2 = 8.95MHz -# and 5.75 - 3.2 = 2.55Mhz, low pass filtered with cutoff at 9Mhz and a -# transition band width of 1Mhz. -# -# Input complex -3.2 to 3.2Mhz, output float 2.55 to 8.95Mhz. - -from gnuradio import gr -from gnuradio import filter -from gnuradio import blocks -import os - -def graph (): - print os.getpid() - sampling_freq = 19200000 - - tb = gr.top_block () - - src0 = blocks.file_source(gr.sizeof_gr_complex,"/tmp/atsc_pipe_1") - - duc_coeffs = filter.firdes.low_pass( 1, 19.2e6, 9e6, 1e6, filter.firdes.WIN_HAMMING ) - duc = filter.freq_xlating_fir_filter_ccf( 1, duc_coeffs, 5.75e6, 19.2e6 ) - - c2f = blocks.complex_to_float() - file = blocks.file_sink(gr.sizeof_float,"/tmp/atsc_pipe_2") - - tb.connect( src0, duc, c2f, file ) - - tb.run() - -if __name__ == '__main__': - graph () |