commit-gnuradio
[Top][All Lists]
Advanced

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

[Commit-gnuradio] r8415 - gnuradio/trunk/gr-atsc/src/python


From: cswiger
Subject: [Commit-gnuradio] r8415 - gnuradio/trunk/gr-atsc/src/python
Date: Tue, 13 May 2008 08:14:09 -0600 (MDT)

Author: cswiger
Date: 2008-05-13 08:14:08 -0600 (Tue, 13 May 2008)
New Revision: 8415

Added:
   gnuradio/trunk/gr-atsc/src/python/interp_short.py
Modified:
   gnuradio/trunk/gr-atsc/src/python/README
Log:
Added interp_short.py and update README 


Modified: gnuradio/trunk/gr-atsc/src/python/README
===================================================================
--- gnuradio/trunk/gr-atsc/src/python/README    2008-05-13 09:33:14 UTC (rev 
8414)
+++ gnuradio/trunk/gr-atsc/src/python/README    2008-05-13 14:14:08 UTC (rev 
8415)
@@ -7,10 +7,12 @@
 2) Capture data - adjust gain (-g) frequency (-f) and which side
 the tvrx is on to fit your local setup:
 
-usrp_rx_cfile.py -R B -d 10 -g 65 -f 503e6 atsc_data_6-4m_complex 
+usrp_rx_cfile.py -s -R B -d 10 -g 65 -f 503e6 atsc_data_6-4m_complex 
 
 You probably still need fast disks to take the data, like a raid-0 set of
-striped sata drives. Make sure there are no or very few Ou overruns.
+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:
 
@@ -22,7 +24,7 @@
 
 4) In seperate windows run processes:
 
-./interp.py <input rf data at 6.4Msps>
+./interp_short.py <input rf data at 6.4Msps>
 ./xlate.py
 ./fpll.py
 ./btl-fsd.py

Added: gnuradio/trunk/gr-atsc/src/python/interp_short.py
===================================================================
--- gnuradio/trunk/gr-atsc/src/python/interp_short.py                           
(rev 0)
+++ gnuradio/trunk/gr-atsc/src/python/interp_short.py   2008-05-13 14:14:08 UTC 
(rev 8415)
@@ -0,0 +1,85 @@
+#!/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:
+#
+#  usrp_rx_cfile.py -R <side with tuner, a or b>
+#                   -d 10     set decimation to get signal at 6.4e6 rate
+#                   -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
+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)
+
+    sampling_freq = 6400000
+
+    fg = gr.flow_graph ()
+
+    srcf = gr.file_source (gr.sizeof_short,infile)
+    s2ss = gr.stream_to_streams(gr.sizeof_short,2)
+    s2f1 = gr.short_to_float()
+    s2f2 = gr.short_to_float()
+    src0 = gr.float_to_complex()
+
+    src1 = gr.sig_source_c (sampling_freq, gr.GR_CONST_WAVE, 1, 0)
+    src2 = gr.sig_source_c (sampling_freq, gr.GR_CONST_WAVE, 1, 0)
+
+    interlv = gr.interleave(gr.sizeof_gr_complex)
+
+    lp_coeffs = gr.firdes.low_pass ( 3, 19.2e6, 3.2e6, .5e6, 
gr.firdes.WIN_HAMMING )
+    lp = gr.fir_filter_ccf ( 1, lp_coeffs )
+
+    file = gr.file_sink(gr.sizeof_gr_complex,"/tmp/atsc_pipe_1")
+
+    fg.connect( srcf, s2ss )
+    fg.connect( (s2ss, 0), s2f1)
+    fg.connect( (s2ss, 1), s2f2)
+    fg.connect( s2f1, (src0,0) )
+    fg.connect( s2f2, (src0,1) )
+    fg.connect( src0, (interlv, 0) )
+    fg.connect( src1, (interlv, 1) )
+    fg.connect( src2, (interlv, 2) )
+    fg.connect( interlv, lp, file )
+
+    fg.start()
+    raw_input ('Head End: Press Enter to stop')
+    fg.stop()
+
+if __name__ == '__main__':
+    graph (sys.argv[1:])
+
+


Property changes on: gnuradio/trunk/gr-atsc/src/python/interp_short.py
___________________________________________________________________
Name: svn:executable
   + *





reply via email to

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