commit-gnuradio
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Commit-gnuradio] r8937 - gnuradio/branches/developers/cswiger/wip/gr-at


From: cswiger
Subject: [Commit-gnuradio] r8937 - gnuradio/branches/developers/cswiger/wip/gr-atsc/src/python
Date: Fri, 18 Jul 2008 12:48:32 -0600 (MDT)

Author: cswiger
Date: 2008-07-18 12:48:32 -0600 (Fri, 18 Jul 2008)
New Revision: 8937

Added:
   gnuradio/branches/developers/cswiger/wip/gr-atsc/src/python/atsc.py
Modified:
   gnuradio/branches/developers/cswiger/wip/gr-atsc/src/python/README
Log:
Add all-in-one script for multi-processor aware scheduler


Modified: gnuradio/branches/developers/cswiger/wip/gr-atsc/src/python/README
===================================================================
--- gnuradio/branches/developers/cswiger/wip/gr-atsc/src/python/README  
2008-07-18 17:38:14 UTC (rev 8936)
+++ gnuradio/branches/developers/cswiger/wip/gr-atsc/src/python/README  
2008-07-18 18:48:32 UTC (rev 8937)
@@ -1,3 +1,5 @@
+With the advent of the multi-processor 
+
 Decoding ATSC using 16MSps rate over 4 processes
 --------------------------------------------------
 

Added: gnuradio/branches/developers/cswiger/wip/gr-atsc/src/python/atsc.py
===================================================================
--- gnuradio/branches/developers/cswiger/wip/gr-atsc/src/python/atsc.py         
                (rev 0)
+++ gnuradio/branches/developers/cswiger/wip/gr-atsc/src/python/atsc.py 
2008-07-18 18:48:32 UTC (rev 8937)
@@ -0,0 +1,110 @@
+#!/usr/bin/env /usr/bin/python
+#
+# Copyright 2008 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 decodes the atsc signal captured off-air using something like:
+#
+#  usrp_rx_cfile.py -R <side with tuner, a or b>
+#                   -d 8     set decimation to get signal at 8e6 rate
+#                   -f <center of tv signal channel freq>
+#                   -g <appropriate gain for best signal / noise>
+#                   -s output shorts
+#
+# This is the all-in-one script to use with the multi-processor aware
+# scheduler version of gnuradio-core
+#
+
+from gnuradio import gr, atsc
+import sys, os
+
+def graph (args):
+
+    print os.getpid()
+
+    nargs = len (args)
+    if nargs == 2:
+        infile = args[0]
+        outfile = args[1]
+    else:
+        sys.stderr.write('usage: atsc.py input_file output_file\n')
+        sys.exit (1)
+
+    tb = gr.top_block ()
+
+    srcf = gr.file_source (gr.sizeof_short,infile)
+    src0 = gr.interleaved_short_to_complex()
+
+    # 1/2 as wide because we're designing lp filter
+    input_rate = 16e6
+    symbol_rate = atsc.ATSC_SYMBOL_RATE/2.
+    NTAPS = 279
+    tt = gr.firdes.root_raised_cosine (2.0, input_rate, symbol_rate, .115, 
NTAPS)
+    # Matching root-raised-cosine filter also doubles sample rate for the
+    # phase locked loop
+    rrc = gr.interp_fir_filter_ccf(2, tt)
+
+    # complex frequency-phase locked loop
+    cpll = atsc.cpll()
+
+    lower_edge = 6e6 - 0.31e6
+    upper_edge = 5.81e6
+    transition_width = upper_edge - lower_edge
+    lp_coeffs = gr.firdes.low_pass (1.0,
+                       input_rate,
+                       (lower_edge + upper_edge) * 0.5,
+                       transition_width,
+                       gr.firdes.WIN_HAMMING);
+
+    lp_filter = gr.fir_filter_fff (1,lp_coeffs)
+
+    alpha = 1e-5
+    iir = gr.single_pole_iir_filter_ff(alpha)
+    remove_dc = gr.sub_ff()
+
+    btl = atsc.bit_timing_loop()
+    fsc = atsc.fs_checker()
+    eq = atsc.equalizer()
+    fsd = atsc.field_sync_demux()
+
+    viterbi = atsc.viterbi_decoder()
+    deinter = atsc.deinterleaver()
+    rs_dec = atsc.rs_decoder()
+    derand = atsc.derandomizer()
+    depad = atsc.depad()
+    dst = gr.file_sink(gr.sizeof_char,outfile)
+
+
+    tb.connect( srcf, src0, rrc, cpll, 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, dst )
+
+
+    tb.start()
+    raw_input ('Press Enter to stop\n')
+    tb.stop()
+
+if __name__ == '__main__':
+    graph (sys.argv[1:])
+


Property changes on: 
gnuradio/branches/developers/cswiger/wip/gr-atsc/src/python/atsc.py
___________________________________________________________________
Name: svn:executable
   + *





reply via email to

[Prev in Thread] Current Thread [Next in Thread]