commit-gnuradio
[Top][All Lists]
Advanced

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

[Commit-gnuradio] [gnuradio] 02/04: digital: examples will fail without


From: git
Subject: [Commit-gnuradio] [gnuradio] 02/04: digital: examples will fail without some Python packages but need sys module to exit properly.
Date: Fri, 7 Mar 2014 00:23:59 +0000 (UTC)

This is an automated email from the git hooks/post-receive script.

trondeau pushed a commit to branch maint
in repository gnuradio.

commit fe1624a3d6355063e118631f76dadcba0106c957
Author: Tom Rondeau <address@hidden>
Date:   Thu Mar 6 11:15:36 2014 -0500

    digital: examples will fail without some Python packages but need sys 
module to exit properly.
---
 gr-digital/examples/berawgn.py        | 11 ++++++-----
 gr-digital/examples/example_costas.py | 15 ++++++++-------
 gr-digital/examples/example_fll.py    | 15 ++++++++-------
 gr-digital/examples/example_timing.py | 21 +++++++++++----------
 4 files changed, 33 insertions(+), 29 deletions(-)

diff --git a/gr-digital/examples/berawgn.py b/gr-digital/examples/berawgn.py
index 7fd1a23..f1b2319 100755
--- a/gr-digital/examples/berawgn.py
+++ b/gr-digital/examples/berawgn.py
@@ -1,24 +1,24 @@
 #!/usr/bin/env python
 #
 # Copyright 2012,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 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., 51 Franklin Street,
 # Boston, MA 02110-1301, USA.
-# 
+#
 
 """
 BER simulation for QPSK signals, compare to theoretical values.
@@ -38,6 +38,7 @@ import numpy
 from gnuradio import gr, digital
 from gnuradio import analog
 from gnuradio import blocks
+import sys
 
 try:
     from scipy.special import erfc
diff --git a/gr-digital/examples/example_costas.py 
b/gr-digital/examples/example_costas.py
index dbb5e42..9a65691 100755
--- a/gr-digital/examples/example_costas.py
+++ b/gr-digital/examples/example_costas.py
@@ -1,24 +1,24 @@
 #!/usr/bin/env python
 #
 # Copyright 2011-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 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., 51 Franklin Street,
 # Boston, MA 02110-1301, USA.
-# 
+#
 
 from gnuradio import gr, digital, filter
 from gnuradio import blocks
@@ -26,6 +26,7 @@ from gnuradio import channels
 from gnuradio import eng_notation
 from gnuradio.eng_option import eng_option
 from optparse import OptionParser
+import sys
 
 try:
     import scipy
@@ -100,7 +101,7 @@ def main():
 
     # adjust this to align with the data.
     data_cst = scipy.array(3*[0,]+list(put.vsnk_cst.data()))
-    
+
     # Plot the Costas loop's LO frequency
     f1 = pylab.figure(1, figsize=(12,10), facecolor='w')
     s1 = f1.add_subplot(2,2,1)
@@ -129,7 +130,7 @@ def main():
     s4.set_ylabel("Real Part of Signals")
 
     pylab.show()
-    
+
 if __name__ == "__main__":
     try:
         main()
diff --git a/gr-digital/examples/example_fll.py 
b/gr-digital/examples/example_fll.py
index 4fb12f5..1c8234c 100755
--- a/gr-digital/examples/example_fll.py
+++ b/gr-digital/examples/example_fll.py
@@ -1,24 +1,24 @@
 #!/usr/bin/env python
 #
 # Copyright 2011-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 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., 51 Franklin Street,
 # Boston, MA 02110-1301, USA.
-# 
+#
 
 from gnuradio import gr, digital, filter
 from gnuradio import blocks
@@ -26,6 +26,7 @@ from gnuradio import channels
 from gnuradio import eng_notation
 from gnuradio.eng_option import eng_option
 from optparse import OptionParser
+import sys
 
 try:
     import scipy
@@ -106,7 +107,7 @@ def main():
     # adjust this to align with the data. There are 2 filters of
     # ntaps long and the channel introduces another 4 sample delay.
     data_fll = scipy.array(put.vsnk_fll.data()[2*options.ntaps-4:])
-    
+
     # Plot the FLL's LO frequency
     f1 = pylab.figure(1, figsize=(12,10))
     s1 = f1.add_subplot(2,2,1)
@@ -139,7 +140,7 @@ def main():
     s4.set_ylabel("Real Part of Signals")
 
     pylab.show()
-    
+
 if __name__ == "__main__":
     try:
         main()
diff --git a/gr-digital/examples/example_timing.py 
b/gr-digital/examples/example_timing.py
index b45efd6..94a4938 100755
--- a/gr-digital/examples/example_timing.py
+++ b/gr-digital/examples/example_timing.py
@@ -1,24 +1,24 @@
 #!/usr/bin/env python
 #
 # Copyright 2011-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 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., 51 Franklin Street,
 # Boston, MA 02110-1301, USA.
-# 
+#
 
 from gnuradio import gr, digital, filter
 from gnuradio import blocks
@@ -26,6 +26,7 @@ from gnuradio import channels
 from gnuradio import eng_notation
 from gnuradio.eng_option import eng_option
 from optparse import OptionParser
+import sys
 
 try:
     import scipy
@@ -53,7 +54,7 @@ class example_timing(gr.top_block):
         nfilts = 32
         rrc_taps_rx = filter.firdes.root_raised_cosine(
             nfilts, sps*nfilts, 1.0, rolloff, ntaps*nfilts)
-            
+
         data = 2.0*scipy.random.randint(0, 2, N) - 1.0
         data = scipy.exp(1j*poffset) * data
 
@@ -68,7 +69,7 @@ class example_timing(gr.top_block):
             self.taps = self.clk.taps()
             self.dtaps = self.clk.diff_taps()
 
-            self.delay = int(scipy.ceil(((len(rrc_taps)-1)/2 + 
+            self.delay = int(scipy.ceil(((len(rrc_taps)-1)/2 +
                                          (len(self.taps[0])-1)/2)/float(sps))) 
+ 1
 
 
@@ -79,7 +80,7 @@ class example_timing(gr.top_block):
             self.connect((self.clk,1), self.vsnk_err)
             self.connect((self.clk,2), self.vsnk_rat)
             self.connect((self.clk,3), self.vsnk_phs)
-            
+
         else: # mode == 1
             mu = 0.5
             gain_mu = bw
@@ -208,7 +209,7 @@ def main():
         data_err = scipy.array(put.vsnk_err.data()[20:])
 
         f1 = pylab.figure(1, figsize=(12,10), facecolor='w')
-        
+
         # Plot the IQ symbols
         s1 = f1.add_subplot(2,2,1)
         s1.plot(data_src.real, data_src.imag, "o")
@@ -236,7 +237,7 @@ def main():
         s3.set_ylabel("Error")
 
     pylab.show()
-    
+
 if __name__ == "__main__":
     try:
         main()



reply via email to

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