summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rwxr-xr-xgnuradio-examples/python/ofdm/gr_plot_ofdm.py20
-rwxr-xr-xgnuradio-examples/python/pfb/channelize.py19
-rwxr-xr-xgnuradio-examples/python/pfb/chirp_channelize.py19
-rwxr-xr-xgnuradio-examples/python/pfb/decimate.py23
-rwxr-xr-xgnuradio-examples/python/pfb/fmtest.py42
-rwxr-xr-xgnuradio-examples/python/pfb/interpolate.py23
-rwxr-xr-xgnuradio-examples/python/pfb/resampler.py34
-rwxr-xr-xgnuradio-examples/python/pfb/synth_filter.py14
-rwxr-xr-xgnuradio-examples/python/pfb/synth_to_chan.py14
-rwxr-xr-xgnuradio-examples/python/tags/test_file_tags.py28
-rwxr-xr-xgr-qtgui/apps/qt_digital.py39
-rwxr-xr-xgr-qtgui/apps/uhd_display.py2
-rwxr-xr-xgr-qtgui/examples/pyqt_example_c.py32
-rwxr-xr-xgr-qtgui/examples/pyqt_example_f.py32
-rwxr-xr-xgr-qtgui/examples/pyqt_time_c.py32
-rwxr-xr-xgr-qtgui/examples/pyqt_time_f.py32
-rwxr-xr-xgr-trellis/src/examples/fsm_utils.py7
-rwxr-xr-xgr-trellis/src/examples/test_cpm.py15
18 files changed, 364 insertions, 63 deletions
diff --git a/gnuradio-examples/python/ofdm/gr_plot_ofdm.py b/gnuradio-examples/python/ofdm/gr_plot_ofdm.py
index e3b347189..b24855148 100755
--- a/gnuradio-examples/python/ofdm/gr_plot_ofdm.py
+++ b/gnuradio-examples/python/ofdm/gr_plot_ofdm.py
@@ -20,14 +20,24 @@
# Boston, MA 02110-1301, USA.
#
-import scipy, pylab, math
-import struct, sys
-from pylab import *
-from matplotlib.font_manager import fontManager, FontProperties
+import math, struct, sys
from optparse import OptionParser
-from scipy import fftpack
from math import log10
+try:
+ import scipy
+ from scipy import fftpack
+except ImportError:
+ print "Error: Program requires scipy (see: www.scipy.org)."
+ sys.exit(1)
+
+try:
+ from pylab import *
+ from matplotlib.font_manager import fontManager, FontProperties
+except ImportError:
+ print "Error: Program requires matplotlib (see: matplotlib.sourceforge.net)."
+ sys.exit(1)
+
matplotlib.interactive(True)
matplotlib.use('TkAgg')
diff --git a/gnuradio-examples/python/pfb/channelize.py b/gnuradio-examples/python/pfb/channelize.py
index f845c05c6..999e5d20e 100755
--- a/gnuradio-examples/python/pfb/channelize.py
+++ b/gnuradio-examples/python/pfb/channelize.py
@@ -21,10 +21,21 @@
#
from gnuradio import gr, blks2
-import os, time
-import scipy, pylab
-from scipy import fftpack
-from pylab import mlab
+import sys, time
+
+try:
+ import scipy
+ from scipy import fftpack
+except ImportError:
+ print "Error: Program requires scipy (see: www.scipy.org)."
+ sys.exit(1)
+
+try:
+ import pylab
+ from pylab import mlab
+except ImportError:
+ print "Error: Program requires matplotlib (see: matplotlib.sourceforge.net)."
+ sys.exit(1)
class pfb_top_block(gr.top_block):
def __init__(self):
diff --git a/gnuradio-examples/python/pfb/chirp_channelize.py b/gnuradio-examples/python/pfb/chirp_channelize.py
index edebf5f59..951255d3b 100755
--- a/gnuradio-examples/python/pfb/chirp_channelize.py
+++ b/gnuradio-examples/python/pfb/chirp_channelize.py
@@ -21,10 +21,21 @@
#
from gnuradio import gr, blks2
-import os, time
-import scipy, pylab
-from scipy import fftpack
-from pylab import mlab
+import sys, time
+
+try:
+ import scipy
+ from scipy import fftpack
+except ImportError:
+ print "Error: Program requires scipy (see: www.scipy.org)."
+ sys.exit(1)
+
+try:
+ import pylab
+ from pylab import mlab
+except ImportError:
+ print "Error: Program requires matplotlib (see: matplotlib.sourceforge.net)."
+ sys.exit(1)
class pfb_top_block(gr.top_block):
def __init__(self):
diff --git a/gnuradio-examples/python/pfb/decimate.py b/gnuradio-examples/python/pfb/decimate.py
index cb5d61b72..643a2c241 100755
--- a/gnuradio-examples/python/pfb/decimate.py
+++ b/gnuradio-examples/python/pfb/decimate.py
@@ -21,14 +21,21 @@
#
from gnuradio import gr, blks2
-import os
-import scipy, pylab
-from scipy import fftpack
-from pylab import mlab
-import time
-
-#print os.getpid()
-#raw_input()
+import sys, time
+
+try:
+ import scipy
+ from scipy import fftpack
+except ImportError:
+ print "Error: Program requires scipy (see: www.scipy.org)."
+ sys.exit(1)
+
+try:
+ import pylab
+ from pylab import mlab
+except ImportError:
+ print "Error: Program requires matplotlib (see: matplotlib.sourceforge.net)."
+ sys.exit(1)
class pfb_top_block(gr.top_block):
def __init__(self):
diff --git a/gnuradio-examples/python/pfb/fmtest.py b/gnuradio-examples/python/pfb/fmtest.py
index 97df0e0f5..635ee4e9e 100755
--- a/gnuradio-examples/python/pfb/fmtest.py
+++ b/gnuradio-examples/python/pfb/fmtest.py
@@ -1,14 +1,42 @@
#!/usr/bin/env python
#
+# Copyright 2009 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, blks2
+import sys, math, time
+
+try:
+ import scipy
+ from scipy import fftpack
+except ImportError:
+ print "Error: Program requires scipy (see: www.scipy.org)."
+ sys.exit(1)
+
+try:
+ import pylab
+except ImportError:
+ print "Error: Program requires matplotlib (see: matplotlib.sourceforge.net)."
+ sys.exit(1)
-from gnuradio import gr, eng_notation
-from gnuradio import blks2
-from gnuradio.eng_option import eng_option
-from optparse import OptionParser
-import math, time, sys, scipy, pylab
-from scipy import fftpack
-
class fmtx(gr.hier_block2):
def __init__(self, lo_freq, audio_rate, if_rate):
diff --git a/gnuradio-examples/python/pfb/interpolate.py b/gnuradio-examples/python/pfb/interpolate.py
index a7a2522f8..370cf26a7 100755
--- a/gnuradio-examples/python/pfb/interpolate.py
+++ b/gnuradio-examples/python/pfb/interpolate.py
@@ -21,14 +21,21 @@
#
from gnuradio import gr, blks2
-import os
-import scipy, pylab
-from scipy import fftpack
-from pylab import mlab
-import time
-
-#print os.getpid()
-#raw_input()
+import sys, time
+
+try:
+ import scipy
+ from scipy import fftpack
+except ImportError:
+ print "Error: Program requires scipy (see: www.scipy.org)."
+ sys.exit(1)
+
+try:
+ import pylab
+ from pylab import mlab
+except ImportError:
+ print "Error: Program requires matplotlib (see: matplotlib.sourceforge.net)."
+ sys.exit(1)
class pfb_top_block(gr.top_block):
def __init__(self):
diff --git a/gnuradio-examples/python/pfb/resampler.py b/gnuradio-examples/python/pfb/resampler.py
index 6be7cf14e..7b296ca71 100755
--- a/gnuradio-examples/python/pfb/resampler.py
+++ b/gnuradio-examples/python/pfb/resampler.py
@@ -1,7 +1,39 @@
#!/usr/bin/env python
+#
+# Copyright 2009 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, blks2
-import scipy, pylab
+import sys
+
+try:
+ import scipy
+except ImportError:
+ print "Error: Program requires scipy (see: www.scipy.org)."
+ sys.exit(1)
+
+try:
+ import pylab
+except ImportError:
+ print "Error: Program requires matplotlib (see: matplotlib.sourceforge.net)."
+ sys.exit(1)
class mytb(gr.top_block):
def __init__(self, fs_in, fs_out, fc, N=10000):
diff --git a/gnuradio-examples/python/pfb/synth_filter.py b/gnuradio-examples/python/pfb/synth_filter.py
index a1562f9ea..074d9cb2c 100755
--- a/gnuradio-examples/python/pfb/synth_filter.py
+++ b/gnuradio-examples/python/pfb/synth_filter.py
@@ -21,7 +21,19 @@
#
from gnuradio import gr, blks2
-import scipy, pylab
+import sys
+
+try:
+ import scipy
+except ImportError:
+ print "Error: Program requires scipy (see: www.scipy.org)."
+ sys.exit(1)
+
+try:
+ import pylab
+except ImportError:
+ print "Error: Program requires matplotlib (see: matplotlib.sourceforge.net)."
+ sys.exit(1)
def main():
N = 1000000
diff --git a/gnuradio-examples/python/pfb/synth_to_chan.py b/gnuradio-examples/python/pfb/synth_to_chan.py
index 1beda1a54..7e454d903 100755
--- a/gnuradio-examples/python/pfb/synth_to_chan.py
+++ b/gnuradio-examples/python/pfb/synth_to_chan.py
@@ -21,7 +21,19 @@
#
from gnuradio import gr, blks2
-import scipy, pylab
+import sys
+
+try:
+ import scipy
+except ImportError:
+ print "Error: Program requires scipy (see: www.scipy.org)."
+ sys.exit(1)
+
+try:
+ import pylab
+except ImportError:
+ print "Error: Program requires matplotlib (see: matplotlib.sourceforge.net)."
+ sys.exit(1)
def main():
N = 1000000
diff --git a/gnuradio-examples/python/tags/test_file_tags.py b/gnuradio-examples/python/tags/test_file_tags.py
index 4ff4549ef..446986cd7 100755
--- a/gnuradio-examples/python/tags/test_file_tags.py
+++ b/gnuradio-examples/python/tags/test_file_tags.py
@@ -1,7 +1,33 @@
#!/usr/bin/env python
+#
+# Copyright 2011 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
-import scipy
+import sys
+
+try:
+ import scipy
+except ImportError:
+ print "Error: Program requires scipy (see: www.scipy.org)."
+ sys.exit(1)
def main():
data = scipy.arange(0, 32000, 1).tolist()
diff --git a/gr-qtgui/apps/qt_digital.py b/gr-qtgui/apps/qt_digital.py
index 99c799f2a..2bc039a31 100755
--- a/gr-qtgui/apps/qt_digital.py
+++ b/gr-qtgui/apps/qt_digital.py
@@ -1,11 +1,42 @@
#!/usr/bin/env python
+#
+# Copyright 2011 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, blks2
-from gnuradio import qtgui
from gnuradio import eng_notation
-from PyQt4 import QtGui, QtCore
-import sys, sip
-import scipy
+import sys
+
+try:
+ from gnuradio import qtgui
+ from PyQt4 import QtGui, QtCore
+ import sip
+except ImportError:
+ print "Error: Program requires PyQt4 and gr-qtgui."
+ sys.exit(1)
+
+try:
+ import scipy
+except ImportError:
+ print "Error: Program requires scipy (see: www.scipy.org)."
+ sys.exit(1)
try:
from qt_digital_window import Ui_DigitalWindow
diff --git a/gr-qtgui/apps/uhd_display.py b/gr-qtgui/apps/uhd_display.py
index 1d69586ef..806914797 100755
--- a/gr-qtgui/apps/uhd_display.py
+++ b/gr-qtgui/apps/uhd_display.py
@@ -33,7 +33,7 @@ try:
from PyQt4 import QtGui, QtCore
import sip
except ImportError:
- print "Please install gr-qtgui."
+ print "Error: Program requires PyQt4 and gr-qtgui."
sys.exit(1)
try:
diff --git a/gr-qtgui/examples/pyqt_example_c.py b/gr-qtgui/examples/pyqt_example_c.py
index 607ab12ee..553d346c9 100755
--- a/gr-qtgui/examples/pyqt_example_c.py
+++ b/gr-qtgui/examples/pyqt_example_c.py
@@ -1,9 +1,35 @@
#!/usr/bin/env python
+#
+# Copyright 2011 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
-from gnuradio import qtgui
-from PyQt4 import QtGui, QtCore
-import sys, sip
+import sys
+
+try:
+ from gnuradio import qtgui
+ from PyQt4 import QtGui, QtCore
+ import sip
+except ImportError:
+ print "Error: Program requires PyQt4 and gr-qtgui."
+ sys.exit(1)
class dialog_box(QtGui.QWidget):
def __init__(self, display, control):
diff --git a/gr-qtgui/examples/pyqt_example_f.py b/gr-qtgui/examples/pyqt_example_f.py
index 2d957c85a..5e432fe78 100755
--- a/gr-qtgui/examples/pyqt_example_f.py
+++ b/gr-qtgui/examples/pyqt_example_f.py
@@ -1,9 +1,35 @@
#!/usr/bin/env python
+#
+# Copyright 2011 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
-from gnuradio import qtgui
-from PyQt4 import QtGui, QtCore
-import sys, sip
+import sys
+
+try:
+ from gnuradio import qtgui
+ from PyQt4 import QtGui, QtCore
+ import sip
+except ImportError:
+ print "Error: Program requires PyQt4 and gr-qtgui."
+ sys.exit(1)
class dialog_box(QtGui.QWidget):
def __init__(self, display, control):
diff --git a/gr-qtgui/examples/pyqt_time_c.py b/gr-qtgui/examples/pyqt_time_c.py
index fa7d60e81..a47302d19 100755
--- a/gr-qtgui/examples/pyqt_time_c.py
+++ b/gr-qtgui/examples/pyqt_time_c.py
@@ -1,9 +1,35 @@
#!/usr/bin/env python
+#
+# Copyright 2011 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
-from gnuradio import qtgui
-from PyQt4 import QtGui, QtCore
-import sys, sip
+import sys
+
+try:
+ from gnuradio import qtgui
+ from PyQt4 import QtGui, QtCore
+ import sip
+except ImportError:
+ print "Error: Program requires PyQt4 and gr-qtgui."
+ sys.exit(1)
class dialog_box(QtGui.QWidget):
def __init__(self, display, control):
diff --git a/gr-qtgui/examples/pyqt_time_f.py b/gr-qtgui/examples/pyqt_time_f.py
index 1b9efa10d..835b42a75 100755
--- a/gr-qtgui/examples/pyqt_time_f.py
+++ b/gr-qtgui/examples/pyqt_time_f.py
@@ -1,9 +1,35 @@
#!/usr/bin/env python
+#
+# Copyright 2011 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
-from gnuradio import qtgui
-from PyQt4 import QtGui, QtCore
-import sys, sip
+import sys
+
+try:
+ from gnuradio import qtgui
+ from PyQt4 import QtGui, QtCore
+ import sip
+except ImportError:
+ print "Error: Program requires PyQt4 and gr-qtgui."
+ sys.exit(1)
class dialog_box(QtGui.QWidget):
def __init__(self, display, control):
diff --git a/gr-trellis/src/examples/fsm_utils.py b/gr-trellis/src/examples/fsm_utils.py
index e3426637c..e9243f899 100755
--- a/gr-trellis/src/examples/fsm_utils.py
+++ b/gr-trellis/src/examples/fsm_utils.py
@@ -26,10 +26,15 @@ import math
import sys
import operator
import numpy
-import scipy.linalg
from gnuradio import trellis
+try:
+ import scipy.linalg
+except ImportError:
+ print "Error: Program requires scipy (see: www.scipy.org)."
+ sys.exit(1)
+
######################################################################
diff --git a/gr-trellis/src/examples/test_cpm.py b/gr-trellis/src/examples/test_cpm.py
index ec432d4ff..b5bdaae44 100755
--- a/gr-trellis/src/examples/test_cpm.py
+++ b/gr-trellis/src/examples/test_cpm.py
@@ -13,10 +13,15 @@ from gnuradio.gr import firdes
from grc_gnuradio import blks2 as grc_blks2
import math
import numpy
-import scipy.stats
import fsm_utils
from gnuradio import trellis
+try:
+ import scipy.stats
+except ImportError:
+ print "Error: Program requires scipy (see: www.scipy.org)."
+ sys.exit(1)
+
def run_test(seed,blocksize):
tb = gr.top_block()
@@ -83,7 +88,7 @@ def run_test(seed,blocksize):
##################################################
# Blocks
##################################################
- random_source_x_0 = gr.vector_source_b(data, False)
+ random_source_x_0 = gr.vector_source_b(data.tolist(), False)
gr_chunks_to_symbols_xx_0 = gr.chunks_to_symbols_bf((-1, 1), 1)
gr_interp_fir_filter_xxx_0 = gr.interp_fir_filter_fff(Q, p)
gr_frequency_modulator_fc_0 = gr.frequency_modulator_fc(2*math.pi*h*(1.0/Q))
@@ -96,9 +101,9 @@ def run_test(seed,blocksize):
# only works for N=2, do it manually for N>2...
gr_fir_filter_xxx_0_0 = gr.fir_filter_ccc(Q, MF[0].conjugate())
gr_fir_filter_xxx_0_0_0 = gr.fir_filter_ccc(Q, MF[1].conjugate())
- gr_streams_to_stream_0 = gr.streams_to_stream(gr.sizeof_gr_complex*1, N)
- gr_skiphead_0 = gr.skiphead(gr.sizeof_gr_complex*1, N*(1+0))
- viterbi = trellis.viterbi_combined_cb(f, head+blocksize+tail, 0, -1, N, constellation, trellis.TRELLIS_EUCLIDEAN)
+ gr_streams_to_stream_0 = gr.streams_to_stream(gr.sizeof_gr_complex*1, int(N))
+ gr_skiphead_0 = gr.skiphead(gr.sizeof_gr_complex*1, int(N*(1+0)))
+ viterbi = trellis.viterbi_combined_cb(f, head+blocksize+tail, 0, -1, int(N), constellation, trellis.TRELLIS_EUCLIDEAN)
gr_vector_sink_x_0 = gr.vector_sink_b()