From 54d6b9281dc233e0b2acf26884073d973b7663de Mon Sep 17 00:00:00 2001 From: jcorgan Date: Tue, 4 Sep 2007 02:43:56 +0000 Subject: [PATCH] Merged r6271:6278 from jcorgan/t182 into trunk. Implements ticket:182. Created new top-level component, gr-utils, to hold commonly used utility scripts (originally in gnuradio-examples). These now install into the system path, allowing their use from wherever. Reorganization of gnuradio-examples component: * Commonly used utility scripts moved from python/usrp into gr-utils. * Examples now install into $(prefix)/share/gnuradio/examples/... * Channel coding examples moved into gr-trellis/src/examples, now install from there, only if gr-atsc itself is going to built and installed. * ATSC example scripts now install into example hierarchy * Cruft has been moved into 'limbo' in repository, do not get installed Trunk passes 'make distcheck'. git-svn-id: http://gnuradio.org/svn/gnuradio/trunk@6279 221aa14e-8319-0410-a670-987f0aec2ac5 --- Makefile.common | 3 + config/grc_gnuradio_examples.m4 | 2 - config/grc_gr_trellis.m4 | 2 + config/grc_gr_utils.m4 | 50 ++++++++++ configure.ac | 1 + gnuradio-examples/python/Makefile.am | 24 ++++- .../python/apps/hf_explorer/Makefile.am | 4 + .../python/apps/hf_radio/Makefile.am | 4 + gnuradio-examples/python/audio/Makefile.am | 7 +- .../python/audio/dial_squelch.py | 89 ------------------ gnuradio-examples/python/audio/dialtone_v.py | 71 -------------- gnuradio-examples/python/digital/Makefile.am | 5 + .../python/digital_voice/Makefile.am | 5 + .../python/multi-antenna/Makefile.am | 5 + .../python/multi_usrp/Makefile.am | 12 ++- gnuradio-examples/python/ofdm/Makefile.am | 5 + gnuradio-examples/python/usrp/Makefile.am | 23 +---- .../python/usrp/{ => limbo}/am_rcv.py | 0 .../python/usrp/{ => limbo}/ayfabtu.dat | Bin .../python/usrp/{ => limbo}/ayfabtu.py | 0 .../python/usrp/{ => limbo}/flexrf_debug.py | 0 .../python/usrp/{ => limbo}/flexrf_siggen.py | 0 .../python/usrp/{ => limbo}/siggen_min2.py | 0 .../usrp/{ => limbo}/test_dft_analysis.py | 0 .../python/usrp/{ => limbo}/test_dft_synth.py | 0 .../usrp/{ => limbo}/tvrx_am_rcv_gui.py | 0 .../python/usrp/{ => limbo}/usrp_fft_old.py | 0 gr-atsc/src/python/Makefile.am | 24 ++++- gr-trellis/src/Makefile.am | 2 +- .../src/examples}/Makefile.am | 17 +++- .../src/examples}/README | 0 .../src/examples}/fsm_files/Makefile.am | 4 + .../src/examples}/fsm_files/awgn1o2_128.fsm | 0 .../src/examples}/fsm_files/awgn1o2_16.fsm | 0 .../src/examples}/fsm_files/awgn1o2_4.fsm | 0 .../src/examples}/fsm_files/awgn1o2_8.fsm | 0 .../src/examples}/fsm_files/awgn2o3_16.fsm | 0 .../src/examples}/fsm_files/awgn2o3_4.fsm | 0 .../src/examples}/fsm_files/awgn2o3_4_msb.fsm | 0 .../examples}/fsm_files/awgn2o3_4_msbG.fsm | 0 .../src/examples}/fsm_files/awgn2o3_8.fsm | 0 .../src/examples}/fsm_files/awgn2o4_4.fsm | 0 .../src/examples}/fsm_files/disconnected.fsm | 0 .../src/examples}/fsm_files/irregular.fsm | 0 .../src/examples}/fsm_files/rep3.fsm | 0 .../src/examples}/fsm_files/rep5.fsm | 0 .../src/examples}/fsm_files/simple.fsm | 0 .../src/examples}/fsm_utils.py | 0 .../src/examples}/test_sccc_hard.py | 0 .../src/examples}/test_sccc_soft.py | 0 .../src/examples}/test_sccc_turbo.py | 0 .../src/examples}/test_tcm.py | 0 .../src/examples}/test_tcm1.py | 0 .../src/examples}/test_tcm2.py | 0 .../src/examples}/test_tcm_combined.py | 0 .../src/examples}/test_tcm_parallel.py | 0 .../src/examples}/test_turbo_equalization.py | 0 .../src/examples}/test_turbo_equalization1.py | 0 .../src/examples}/test_turbo_equalization2.py | 0 .../examples}/test_viterbi_equalization.py | 0 .../examples}/test_viterbi_equalization1.py | 0 gr-utils/Makefile.am | 22 +++++ gr-utils/src/Makefile.am | 22 +++++ gr-utils/src/lib/Makefile.am | 20 ++++ gr-utils/src/python/Makefile.am | 35 +++++++ .../src/python/usrp_benchmark_usb.py | 0 .../usrp => gr-utils/src/python}/usrp_fft.py | 0 .../src/python}/usrp_oscope.py | 0 gr-utils/src/python/usrp_print_db.py | 42 +++++++++ .../src/python}/usrp_rx_cfile.py | 0 .../src/python}/usrp_rx_nogui.py | 0 .../src/python}/usrp_siggen.py | 0 .../src/python/usrp_test_counting.py | 0 .../src/python/usrp_test_loop.py | 0 .../src/python/usrp_test_loop_lfsr.py | 0 usrp/host/apps/print-db | 19 ---- 76 files changed, 308 insertions(+), 211 deletions(-) create mode 100644 config/grc_gr_utils.m4 delete mode 100755 gnuradio-examples/python/audio/dial_squelch.py delete mode 100755 gnuradio-examples/python/audio/dialtone_v.py rename gnuradio-examples/python/usrp/{ => limbo}/am_rcv.py (100%) rename gnuradio-examples/python/usrp/{ => limbo}/ayfabtu.dat (100%) rename gnuradio-examples/python/usrp/{ => limbo}/ayfabtu.py (100%) rename gnuradio-examples/python/usrp/{ => limbo}/flexrf_debug.py (100%) rename gnuradio-examples/python/usrp/{ => limbo}/flexrf_siggen.py (100%) rename gnuradio-examples/python/usrp/{ => limbo}/siggen_min2.py (100%) rename gnuradio-examples/python/usrp/{ => limbo}/test_dft_analysis.py (100%) rename gnuradio-examples/python/usrp/{ => limbo}/test_dft_synth.py (100%) rename gnuradio-examples/python/usrp/{ => limbo}/tvrx_am_rcv_gui.py (100%) rename gnuradio-examples/python/usrp/{ => limbo}/usrp_fft_old.py (100%) rename {gnuradio-examples/python/channel-coding => gr-trellis/src/examples}/Makefile.am (78%) rename {gnuradio-examples/python/channel-coding => gr-trellis/src/examples}/README (100%) rename {gnuradio-examples/python/channel-coding => gr-trellis/src/examples}/fsm_files/Makefile.am (90%) rename {gnuradio-examples/python/channel-coding => gr-trellis/src/examples}/fsm_files/awgn1o2_128.fsm (100%) rename {gnuradio-examples/python/channel-coding => gr-trellis/src/examples}/fsm_files/awgn1o2_16.fsm (100%) rename {gnuradio-examples/python/channel-coding => gr-trellis/src/examples}/fsm_files/awgn1o2_4.fsm (100%) rename {gnuradio-examples/python/channel-coding => gr-trellis/src/examples}/fsm_files/awgn1o2_8.fsm (100%) rename {gnuradio-examples/python/channel-coding => gr-trellis/src/examples}/fsm_files/awgn2o3_16.fsm (100%) rename {gnuradio-examples/python/channel-coding => gr-trellis/src/examples}/fsm_files/awgn2o3_4.fsm (100%) rename {gnuradio-examples/python/channel-coding => gr-trellis/src/examples}/fsm_files/awgn2o3_4_msb.fsm (100%) rename {gnuradio-examples/python/channel-coding => gr-trellis/src/examples}/fsm_files/awgn2o3_4_msbG.fsm (100%) rename {gnuradio-examples/python/channel-coding => gr-trellis/src/examples}/fsm_files/awgn2o3_8.fsm (100%) rename {gnuradio-examples/python/channel-coding => gr-trellis/src/examples}/fsm_files/awgn2o4_4.fsm (100%) rename {gnuradio-examples/python/channel-coding => gr-trellis/src/examples}/fsm_files/disconnected.fsm (100%) rename {gnuradio-examples/python/channel-coding => gr-trellis/src/examples}/fsm_files/irregular.fsm (100%) rename {gnuradio-examples/python/channel-coding => gr-trellis/src/examples}/fsm_files/rep3.fsm (100%) rename {gnuradio-examples/python/channel-coding => gr-trellis/src/examples}/fsm_files/rep5.fsm (100%) rename {gnuradio-examples/python/channel-coding => gr-trellis/src/examples}/fsm_files/simple.fsm (100%) rename {gnuradio-examples/python/channel-coding => gr-trellis/src/examples}/fsm_utils.py (100%) rename {gnuradio-examples/python/channel-coding => gr-trellis/src/examples}/test_sccc_hard.py (100%) rename {gnuradio-examples/python/channel-coding => gr-trellis/src/examples}/test_sccc_soft.py (100%) rename {gnuradio-examples/python/channel-coding => gr-trellis/src/examples}/test_sccc_turbo.py (100%) rename {gnuradio-examples/python/channel-coding => gr-trellis/src/examples}/test_tcm.py (100%) rename {gnuradio-examples/python/channel-coding => gr-trellis/src/examples}/test_tcm1.py (100%) rename {gnuradio-examples/python/channel-coding => gr-trellis/src/examples}/test_tcm2.py (100%) rename {gnuradio-examples/python/channel-coding => gr-trellis/src/examples}/test_tcm_combined.py (100%) rename {gnuradio-examples/python/channel-coding => gr-trellis/src/examples}/test_tcm_parallel.py (100%) rename {gnuradio-examples/python/channel-coding => gr-trellis/src/examples}/test_turbo_equalization.py (100%) rename {gnuradio-examples/python/channel-coding => gr-trellis/src/examples}/test_turbo_equalization1.py (100%) rename {gnuradio-examples/python/channel-coding => gr-trellis/src/examples}/test_turbo_equalization2.py (100%) rename {gnuradio-examples/python/channel-coding => gr-trellis/src/examples}/test_viterbi_equalization.py (100%) rename {gnuradio-examples/python/channel-coding => gr-trellis/src/examples}/test_viterbi_equalization1.py (100%) create mode 100644 gr-utils/Makefile.am create mode 100644 gr-utils/src/Makefile.am create mode 100644 gr-utils/src/lib/Makefile.am create mode 100644 gr-utils/src/python/Makefile.am rename gnuradio-examples/python/usrp/benchmark_usb.py => gr-utils/src/python/usrp_benchmark_usb.py (100%) rename {gnuradio-examples/python/usrp => gr-utils/src/python}/usrp_fft.py (100%) rename {gnuradio-examples/python/usrp => gr-utils/src/python}/usrp_oscope.py (100%) create mode 100755 gr-utils/src/python/usrp_print_db.py rename {gnuradio-examples/python/usrp => gr-utils/src/python}/usrp_rx_cfile.py (100%) rename {gnuradio-examples/python/usrp => gr-utils/src/python}/usrp_rx_nogui.py (100%) rename {gnuradio-examples/python/usrp => gr-utils/src/python}/usrp_siggen.py (100%) rename gnuradio-examples/python/usrp/test_counting.py => gr-utils/src/python/usrp_test_counting.py (100%) rename gnuradio-examples/python/usrp/test_digital_loopback_counting.py => gr-utils/src/python/usrp_test_loop.py (100%) rename gnuradio-examples/python/usrp/test_digital_loopback_lfsr.py => gr-utils/src/python/usrp_test_loop_lfsr.py (100%) delete mode 100755 usrp/host/apps/print-db diff --git a/Makefile.common b/Makefile.common index a90dbaa4..2976e36d 100644 --- a/Makefile.common +++ b/Makefile.common @@ -96,3 +96,6 @@ RM=$(RM_PROG) -f RUN_GUILE = GUILE_LOAD_PATH="@abs_top_srcdir@/pmt/src/scheme:@abs_top_srcdir@/mblock/src/scheme" @GUILE@ -e main -s COMPILE_MBH = $(RUN_GUILE) $(top_srcdir)/mblock/src/scheme/gnuradio/compile-mbh.scm + +# Base directory for example applications +exampledir = $(datadir)/gnuradio/examples diff --git a/config/grc_gnuradio_examples.m4 b/config/grc_gnuradio_examples.m4 index 7b66f747..20d50fe5 100644 --- a/config/grc_gnuradio_examples.m4 +++ b/config/grc_gnuradio_examples.m4 @@ -28,8 +28,6 @@ AC_DEFUN([GRC_GNURADIO_EXAMPLES],[ gnuradio-examples/python/apps/hf_radio/Makefile \ gnuradio-examples/python/apps/Makefile \ gnuradio-examples/python/audio/Makefile \ - gnuradio-examples/python/channel-coding/Makefile \ - gnuradio-examples/python/channel-coding/fsm_files/Makefile \ gnuradio-examples/python/digital/Makefile \ gnuradio-examples/python/digital_voice/Makefile \ gnuradio-examples/python/hier/Makefile \ diff --git a/config/grc_gr_trellis.m4 b/config/grc_gr_trellis.m4 index 752f8593..cde1f1cc 100644 --- a/config/grc_gr_trellis.m4 +++ b/config/grc_gr_trellis.m4 @@ -27,6 +27,8 @@ AC_DEFUN([GRC_GR_TRELLIS],[ gr-trellis/src/lib/Makefile \ gr-trellis/src/python/Makefile \ gr-trellis/src/python/run_tests \ + gr-trellis/src/examples/Makefile \ + gr-trellis/src/examples/fsm_files/Makefile ]) passed=yes diff --git a/config/grc_gr_utils.m4 b/config/grc_gr_utils.m4 new file mode 100644 index 00000000..e5b3a6af --- /dev/null +++ b/config/grc_gr_utils.m4 @@ -0,0 +1,50 @@ +# Copyright 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., 51 Franklin Street, +# Boston, MA 02110-1301, USA. + +AC_DEFUN([GRC_GR_UTILS],[ + GRC_ENABLE([gr-utils]) + + AC_CONFIG_FILES([ \ + gr-utils/Makefile \ + gr-utils/src/Makefile \ + gr-utils/src/lib/Makefile \ + gr-utils/src/python/Makefile \ + ]) + + passed=yes + # Don't do gr-utils if gnuradio-core, usrp, or gr-wxgui skipped + # There *has* to be a better way to check if a value is in a string + for dir in $skipped_dirs + do + if test x$dir = xusrp; then + AC_MSG_RESULT([Component gr-utils requires usrp, which is not being built.]) + passed=no + fi + if test x$dir = xgnuradio-core; then + AC_MSG_RESULT([Component gr-utils requires gnuradio-core, which is not being built.]) + passed=no + fi + if test x$dir = xgr-wxgui; then + AC_MSG_RESULT([Component gr-utils requires gr-wxgui, which is not being built.]) + passed=no + fi + done + + GRC_BUILD_CONDITIONAL([gr-utils]) +]) diff --git a/configure.ac b/configure.ac index 69931039..e8a4efe2 100644 --- a/configure.ac +++ b/configure.ac @@ -218,6 +218,7 @@ GRC_GR_VIDEO_SDL GRC_GR_QTGUI GRC_GR_WXGUI GRC_GR_SOUNDER dnl this must come after GRC_USRP +GRC_GR_UTILS GRC_GNURADIO_EXAMPLES dnl must come last # Each component is now either to be built, was skipped, or failed dependencies diff --git a/gnuradio-examples/python/Makefile.am b/gnuradio-examples/python/Makefile.am index de576770..c9db48d6 100644 --- a/gnuradio-examples/python/Makefile.am +++ b/gnuradio-examples/python/Makefile.am @@ -19,5 +19,25 @@ # Boston, MA 02110-1301, USA. # -SUBDIRS = apps audio channel-coding digital_voice digital multi-antenna \ - multi_usrp networking usrp hier ofdm +include $(top_srcdir)/Makefile.common + +SUBDIRS = \ + apps \ + audio \ + digital_voice \ + digital \ + multi-antenna \ + multi_usrp \ + networking \ + usrp \ + hier \ + ofdm + +# Make example scripts with #! executable +install-data-local: + for i in `find $(exampledir) -type f ! -perm 755`; do \ + if head -1 $$i | grep -q '^#!'; then \ + chmod 755 $$i; \ + echo "made executable: $$i"; \ + fi; \ + done diff --git a/gnuradio-examples/python/apps/hf_explorer/Makefile.am b/gnuradio-examples/python/apps/hf_explorer/Makefile.am index 49aac101..deb6c32d 100644 --- a/gnuradio-examples/python/apps/hf_explorer/Makefile.am +++ b/gnuradio-examples/python/apps/hf_explorer/Makefile.am @@ -19,8 +19,12 @@ # Boston, MA 02110-1301, USA. # +include $(top_srcdir)/Makefile.common + EXTRA_DIST = \ README \ hfx2.py \ hfx_help +ourdatadir = $(exampledir)/hf_explorer +ourdata_DATA = $(EXTRA_DIST) \ No newline at end of file diff --git a/gnuradio-examples/python/apps/hf_radio/Makefile.am b/gnuradio-examples/python/apps/hf_radio/Makefile.am index 3f7340ef..a6a4dfe3 100644 --- a/gnuradio-examples/python/apps/hf_radio/Makefile.am +++ b/gnuradio-examples/python/apps/hf_radio/Makefile.am @@ -19,6 +19,8 @@ # Boston, MA 02110-1301, USA. # +include $(top_srcdir)/Makefile.common + EXTRA_DIST = \ hfir.sci \ input.py \ @@ -32,3 +34,5 @@ EXTRA_DIST = \ startup.py \ ui.py +ourdatadir = $(exampledir)/hf_radio +ourdata_DATA = $(EXTRA_DIST) diff --git a/gnuradio-examples/python/audio/Makefile.am b/gnuradio-examples/python/audio/Makefile.am index e0fdb7e7..6c69588c 100644 --- a/gnuradio-examples/python/audio/Makefile.am +++ b/gnuradio-examples/python/audio/Makefile.am @@ -19,16 +19,19 @@ # Boston, MA 02110-1301, USA. # +include $(top_srcdir)/Makefile.common + EXTRA_DIST = \ audio_copy.py \ audio_fft.py \ audio_play.py \ audio_to_file.py \ - dial_squelch.py \ dial_tone.py \ - dialtone_v.py \ mono_tone.py \ multi_tone.py \ noise.py \ spectrum_inversion.py \ test_resampler.py + +ourdatadir = $(exampledir)/audio +ourdata_DATA = $(EXTRA_DIST) diff --git a/gnuradio-examples/python/audio/dial_squelch.py b/gnuradio-examples/python/audio/dial_squelch.py deleted file mode 100755 index 8a0c3f56..00000000 --- a/gnuradio-examples/python/audio/dial_squelch.py +++ /dev/null @@ -1,89 +0,0 @@ -#!/usr/bin/env python - -# Copyright 2006 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, audio, eng_option -from gnuradio.eng_option import eng_option -from math import pi, cos -from optparse import OptionParser - -""" -This script generates a standard dial tone and then applies a sinusoidal -envelope to vary it's loudness. The audio is then passed through the -power squelch block before it gets sent to the sound card. By varying -the command line parameters, one can see the effect of differing -amounts of power averaging, threshold, and attack/decay ramping. -""" - -class app_flow_graph(gr.flow_graph): - def __init__(self, options, args): - gr.flow_graph.__init__(self) - - # Create dial tone by adding two sine waves - SRC1 = gr.sig_source_f(options.rate, gr.GR_SIN_WAVE, 350, 0.5, 0.0) - SRC2 = gr.sig_source_f(options.rate, gr.GR_SIN_WAVE, 440, 0.5, 0.0) - ADD = gr.add_ff() - - # Convert to vector stream (and back) to apply raised cosine envelope - # You could also do this with a vector_source_f block that repeats. - S2V = gr.stream_to_vector(gr.sizeof_float, options.rate) - ENV = [0.5-cos(2*pi*x/options.rate)/2 for x in range(options.rate)] - MLT = gr.multiply_const_vff(ENV) - V2S = gr.vector_to_stream(gr.sizeof_float, options.rate) - - # Run through power squelch with user supplied or default options - # Zero output when squelch is invoked - SQL = gr.pwr_squelch_ff(options.threshold, options.alpha, options.ramp, False) - DST = audio.sink(options.rate) - - # Solder it all together - self.connect(SRC1, (ADD, 0)) - self.connect(SRC2, (ADD, 1)) - self.connect(ADD, S2V, MLT, V2S, SQL, DST) - -def main(): - parser = OptionParser(option_class=eng_option) - parser.add_option("-r", "--rate", type="int", default=8000, help="set audio output sample rate to RATE", metavar="RATE") - parser.add_option("-t", "--threshold", type="eng_float", default=-10.0, help="set power squelch to DB", metavar="DB") - parser.add_option("-a", "--alpha", type="eng_float", default=None, help="set alpha to ALPHA", metavar="ALPHA") - parser.add_option("-m", "--ramp", type="int", default=None, help="set attack/decay ramp to SAMPLES", metavar="SAMPLES") - (options, args) = parser.parse_args() - - if options.alpha == None: - options.alpha = 50.0/options.rate - - if options.ramp == None: - options.ramp = options.rate/50 # ~ 20 ms - - print "Using audio rate of", options.rate - print "Using threshold of", options.threshold, "db" - print "Using alpha of", options.alpha - print "Using ramp of", options.ramp, "samples" - - fg = app_flow_graph(options, args) - - try: - fg.run() - except KeyboardInterrupt: - pass - -if __name__ == "__main__": - main() diff --git a/gnuradio-examples/python/audio/dialtone_v.py b/gnuradio-examples/python/audio/dialtone_v.py deleted file mode 100755 index ab1ca2a6..00000000 --- a/gnuradio-examples/python/audio/dialtone_v.py +++ /dev/null @@ -1,71 +0,0 @@ -#!/usr/bin/env python - -# Copyright 2006 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, audio -from math import pi, sin - -""" -This test script demonstrates the use of element-wise vector processing -vs. stream processing. The example is artificial in that the stream -version in dial_tone.py is the normal way to do it; in addition, the -envelope processing here is just for demo purposes and isn't needed. -""" - -# For testing different buffer sizes -rate = 48000 - -fg = gr.flow_graph() - -# Two streams of floats -a = gr.sig_source_f(rate, gr.GR_SIN_WAVE, 350, 0.5, 0.0); -b = gr.sig_source_f(rate, gr.GR_SIN_WAVE, 440, 0.5, 0.0); - -# Turn them into vectors of length 'size' -av = gr.stream_to_vector(gr.sizeof_float, rate) -bv = gr.stream_to_vector(gr.sizeof_float, rate) - -# Make a vector adder for float vectors -adder = gr.add_vff(rate) - -# Make a 1 Hz sine envelope -envelope = [sin(2*pi*x/rate)*0.5 for x in range(rate)] -multiplier = gr.multiply_const_vff(envelope) - -# Make an offset adder -offset = gr.add_const_vff((0.5,)*rate) - -# Turn the vector back into a stream of floats -result = gr.vector_to_stream(gr.sizeof_float, rate) - -# Play it -sink = audio.sink(rate) - -fg.connect(a, av) -fg.connect(b, bv) -fg.connect(av, (adder, 0)) -fg.connect(bv, (adder, 1)) -fg.connect(adder, multiplier, offset, result, sink) - -try: - fg.run() -except KeyboardInterrupt: - pass diff --git a/gnuradio-examples/python/digital/Makefile.am b/gnuradio-examples/python/digital/Makefile.am index 91b914df..1db2f847 100644 --- a/gnuradio-examples/python/digital/Makefile.am +++ b/gnuradio-examples/python/digital/Makefile.am @@ -19,6 +19,8 @@ # Boston, MA 02110-1301, USA. # +include $(top_srcdir)/Makefile.common + EXTRA_DIST = \ README \ benchmark_rx.py \ @@ -32,3 +34,6 @@ EXTRA_DIST = \ transmit_path.py \ tunnel.py \ tx_voice.py + +ourdatadir = $(exampledir)/digital +ourdata_DATA = $(EXTRA_DIST) diff --git a/gnuradio-examples/python/digital_voice/Makefile.am b/gnuradio-examples/python/digital_voice/Makefile.am index 0236fbf2..08bd4882 100644 --- a/gnuradio-examples/python/digital_voice/Makefile.am +++ b/gnuradio-examples/python/digital_voice/Makefile.am @@ -19,6 +19,11 @@ # Boston, MA 02110-1301, USA. # +include $(top_srcdir)/Makefile.common + EXTRA_DIST = \ encdec.py \ cvsd_test.py + +ourdatadir = $(exampledir)/digital_voice +ourdata_DATA = $(EXTRA_DIST) \ No newline at end of file diff --git a/gnuradio-examples/python/multi-antenna/Makefile.am b/gnuradio-examples/python/multi-antenna/Makefile.am index 0172eac3..7e620b3a 100644 --- a/gnuradio-examples/python/multi-antenna/Makefile.am +++ b/gnuradio-examples/python/multi-antenna/Makefile.am @@ -19,7 +19,12 @@ # Boston, MA 02110-1301, USA. # +include $(top_srcdir)/Makefile.common + EXTRA_DIST = \ multi_fft.py \ multi_file.py \ multi_scope.py + +ourdatadir = $(exampledir)/multi-antenna +ourdata_DATA = $(EXTRA_DIST) diff --git a/gnuradio-examples/python/multi_usrp/Makefile.am b/gnuradio-examples/python/multi_usrp/Makefile.am index 1f51f23a..01119bb8 100644 --- a/gnuradio-examples/python/multi_usrp/Makefile.am +++ b/gnuradio-examples/python/multi_usrp/Makefile.am @@ -19,10 +19,12 @@ # Boston, MA 02110-1301, USA. # -EXTRA_DIST = \ - README \ - multi_usrp_oscope.py \ - multi_usrp_rx_cfile.py - +include $(top_srcdir)/Makefile.common +EXTRA_DIST = \ + README \ + multi_usrp_oscope.py \ + multi_usrp_rx_cfile.py +ourdatadir = $(exampledir)/multi_usrp +ourdata_DATA = $(EXTRA_DIST) diff --git a/gnuradio-examples/python/ofdm/Makefile.am b/gnuradio-examples/python/ofdm/Makefile.am index 5e8570d6..e9ff3bac 100644 --- a/gnuradio-examples/python/ofdm/Makefile.am +++ b/gnuradio-examples/python/ofdm/Makefile.am @@ -19,6 +19,8 @@ # Boston, MA 02110-1301, USA. # +include $(top_srcdir)/Makefile.common + EXTRA_DIST = \ benchmark_ofdm.py \ benchmark_ofdm_rx.py \ @@ -28,3 +30,6 @@ EXTRA_DIST = \ pick_bitrate.py \ receive_path.py \ transmit_path.py + +ourdatadir = $(exampledir)/ofdm +ourdata_DATA = $(EXTRA_DIST) diff --git a/gnuradio-examples/python/usrp/Makefile.am b/gnuradio-examples/python/usrp/Makefile.am index 0d82031c..71f46072 100644 --- a/gnuradio-examples/python/usrp/Makefile.am +++ b/gnuradio-examples/python/usrp/Makefile.am @@ -19,30 +19,14 @@ # Boston, MA 02110-1301, USA. # +include $(top_srcdir)/Makefile.common + EXTRA_DIST = \ - am_rcv.py \ - ayfabtu.py \ - benchmark_usb.py \ - flexrf_debug.py \ - flexrf_siggen.py \ fm_tx_2_daughterboards.py \ fm_tx4.py \ max_power.py \ - siggen_min2.py \ - test_counting.py \ - test_dft_analysis.py \ - test_dft_synth.py \ - test_digital_loopback_counting.py \ - test_digital_loopback_lfsr.py \ - tvrx_am_rcv_gui.py \ - usrp_fft_old.py \ - usrp_fft.py \ usrp_nbfm_ptt.py \ usrp_nbfm_rcv.py \ - usrp_oscope.py \ - usrp_rx_cfile.py \ - usrp_rx_nogui.py \ - usrp_siggen.py \ usrp_spectrum_sense.py \ usrp_tv_rcv_nogui.py \ usrp_tv_rcv.py \ @@ -53,3 +37,6 @@ EXTRA_DIST = \ usrp_wfm_rcv2_nogui.py \ usrp_wxapt_rcv.py \ wfm_rcv_file.py + +ourdatadir = $(exampledir)/usrp +ourdata_DATA = $(EXTRA_DIST) diff --git a/gnuradio-examples/python/usrp/am_rcv.py b/gnuradio-examples/python/usrp/limbo/am_rcv.py similarity index 100% rename from gnuradio-examples/python/usrp/am_rcv.py rename to gnuradio-examples/python/usrp/limbo/am_rcv.py diff --git a/gnuradio-examples/python/usrp/ayfabtu.dat b/gnuradio-examples/python/usrp/limbo/ayfabtu.dat similarity index 100% rename from gnuradio-examples/python/usrp/ayfabtu.dat rename to gnuradio-examples/python/usrp/limbo/ayfabtu.dat diff --git a/gnuradio-examples/python/usrp/ayfabtu.py b/gnuradio-examples/python/usrp/limbo/ayfabtu.py similarity index 100% rename from gnuradio-examples/python/usrp/ayfabtu.py rename to gnuradio-examples/python/usrp/limbo/ayfabtu.py diff --git a/gnuradio-examples/python/usrp/flexrf_debug.py b/gnuradio-examples/python/usrp/limbo/flexrf_debug.py similarity index 100% rename from gnuradio-examples/python/usrp/flexrf_debug.py rename to gnuradio-examples/python/usrp/limbo/flexrf_debug.py diff --git a/gnuradio-examples/python/usrp/flexrf_siggen.py b/gnuradio-examples/python/usrp/limbo/flexrf_siggen.py similarity index 100% rename from gnuradio-examples/python/usrp/flexrf_siggen.py rename to gnuradio-examples/python/usrp/limbo/flexrf_siggen.py diff --git a/gnuradio-examples/python/usrp/siggen_min2.py b/gnuradio-examples/python/usrp/limbo/siggen_min2.py similarity index 100% rename from gnuradio-examples/python/usrp/siggen_min2.py rename to gnuradio-examples/python/usrp/limbo/siggen_min2.py diff --git a/gnuradio-examples/python/usrp/test_dft_analysis.py b/gnuradio-examples/python/usrp/limbo/test_dft_analysis.py similarity index 100% rename from gnuradio-examples/python/usrp/test_dft_analysis.py rename to gnuradio-examples/python/usrp/limbo/test_dft_analysis.py diff --git a/gnuradio-examples/python/usrp/test_dft_synth.py b/gnuradio-examples/python/usrp/limbo/test_dft_synth.py similarity index 100% rename from gnuradio-examples/python/usrp/test_dft_synth.py rename to gnuradio-examples/python/usrp/limbo/test_dft_synth.py diff --git a/gnuradio-examples/python/usrp/tvrx_am_rcv_gui.py b/gnuradio-examples/python/usrp/limbo/tvrx_am_rcv_gui.py similarity index 100% rename from gnuradio-examples/python/usrp/tvrx_am_rcv_gui.py rename to gnuradio-examples/python/usrp/limbo/tvrx_am_rcv_gui.py diff --git a/gnuradio-examples/python/usrp/usrp_fft_old.py b/gnuradio-examples/python/usrp/limbo/usrp_fft_old.py similarity index 100% rename from gnuradio-examples/python/usrp/usrp_fft_old.py rename to gnuradio-examples/python/usrp/limbo/usrp_fft_old.py diff --git a/gr-atsc/src/python/Makefile.am b/gr-atsc/src/python/Makefile.am index 952bfddb..ffc7780d 100644 --- a/gr-atsc/src/python/Makefile.am +++ b/gr-atsc/src/python/Makefile.am @@ -21,7 +21,20 @@ include $(top_srcdir)/Makefile.common -EXTRA_DIST = run_tests.in +EXAMPLE_FILES = \ + README \ + btl-fsd.py \ + fpll.py \ + interp.py \ + xlate.py \ + viterbi-out.py + + +EXTRA_DIST = run_tests.in \ + $(EXAMPLE_FILES) + +ourdatadir = $(exampledir)/atsc +ourdata_DATA = $(EXAMPLE_FILES) TESTS = \ @@ -31,3 +44,12 @@ TESTS = \ noinst_PYTHON = \ atsc_utils.py \ qa_atsc.py + +# Make example scripts with #! executable +install-data-local: + for i in `find $(ourdatadir) -type f ! -perm 755`; do \ + if head -1 $$i | grep -q '^#!'; then \ + chmod 755 $$i; \ + echo "made executable: $$i"; \ + fi; \ + done diff --git a/gr-trellis/src/Makefile.am b/gr-trellis/src/Makefile.am index e3f0399e..41f525b0 100644 --- a/gr-trellis/src/Makefile.am +++ b/gr-trellis/src/Makefile.am @@ -19,4 +19,4 @@ # Boston, MA 02110-1301, USA. # -SUBDIRS = lib python +SUBDIRS = lib python examples diff --git a/gnuradio-examples/python/channel-coding/Makefile.am b/gr-trellis/src/examples/Makefile.am similarity index 78% rename from gnuradio-examples/python/channel-coding/Makefile.am rename to gr-trellis/src/examples/Makefile.am index 3a6c3382..21003991 100644 --- a/gnuradio-examples/python/channel-coding/Makefile.am +++ b/gr-trellis/src/examples/Makefile.am @@ -19,6 +19,10 @@ # Boston, MA 02110-1301, USA. # +include $(top_srcdir)/Makefile.common + +SUBDIRS = fsm_files + EXTRA_DIST = \ README \ fsm_utils.py \ @@ -36,6 +40,17 @@ EXTRA_DIST = \ test_turbo_equalization1.py \ test_turbo_equalization2.py -SUBDIRS = fsm_files + +ourdatadir = $(exampledir)/trellis +ourdata_DATA = $(EXTRA_DIST) + +# Make example scripts with #! executable +install-data-local: + for i in `find $(ourdatadir) -type f ! -perm 755`; do \ + if head -1 $$i | grep -q '^#!'; then \ + chmod 755 $$i; \ + echo "made executable: $$i"; \ + fi; \ + done MOSTLYCLEANFILES = *.pyc diff --git a/gnuradio-examples/python/channel-coding/README b/gr-trellis/src/examples/README similarity index 100% rename from gnuradio-examples/python/channel-coding/README rename to gr-trellis/src/examples/README diff --git a/gnuradio-examples/python/channel-coding/fsm_files/Makefile.am b/gr-trellis/src/examples/fsm_files/Makefile.am similarity index 90% rename from gnuradio-examples/python/channel-coding/fsm_files/Makefile.am rename to gr-trellis/src/examples/fsm_files/Makefile.am index 081f62fc..1414d797 100644 --- a/gnuradio-examples/python/channel-coding/fsm_files/Makefile.am +++ b/gr-trellis/src/examples/fsm_files/Makefile.am @@ -19,6 +19,8 @@ # Boston, MA 02110-1301, USA. # +include $(top_srcdir)/Makefile.common + EXTRA_DIST = \ awgn1o2_128.fsm \ awgn1o2_16.fsm \ @@ -35,3 +37,5 @@ EXTRA_DIST = \ rep5.fsm \ simple.fsm +ourdatadir = $(exampledir)/trellis/fsm_files +ourdata_DATA = $(EXTRA_DIST) diff --git a/gnuradio-examples/python/channel-coding/fsm_files/awgn1o2_128.fsm b/gr-trellis/src/examples/fsm_files/awgn1o2_128.fsm similarity index 100% rename from gnuradio-examples/python/channel-coding/fsm_files/awgn1o2_128.fsm rename to gr-trellis/src/examples/fsm_files/awgn1o2_128.fsm diff --git a/gnuradio-examples/python/channel-coding/fsm_files/awgn1o2_16.fsm b/gr-trellis/src/examples/fsm_files/awgn1o2_16.fsm similarity index 100% rename from gnuradio-examples/python/channel-coding/fsm_files/awgn1o2_16.fsm rename to gr-trellis/src/examples/fsm_files/awgn1o2_16.fsm diff --git a/gnuradio-examples/python/channel-coding/fsm_files/awgn1o2_4.fsm b/gr-trellis/src/examples/fsm_files/awgn1o2_4.fsm similarity index 100% rename from gnuradio-examples/python/channel-coding/fsm_files/awgn1o2_4.fsm rename to gr-trellis/src/examples/fsm_files/awgn1o2_4.fsm diff --git a/gnuradio-examples/python/channel-coding/fsm_files/awgn1o2_8.fsm b/gr-trellis/src/examples/fsm_files/awgn1o2_8.fsm similarity index 100% rename from gnuradio-examples/python/channel-coding/fsm_files/awgn1o2_8.fsm rename to gr-trellis/src/examples/fsm_files/awgn1o2_8.fsm diff --git a/gnuradio-examples/python/channel-coding/fsm_files/awgn2o3_16.fsm b/gr-trellis/src/examples/fsm_files/awgn2o3_16.fsm similarity index 100% rename from gnuradio-examples/python/channel-coding/fsm_files/awgn2o3_16.fsm rename to gr-trellis/src/examples/fsm_files/awgn2o3_16.fsm diff --git a/gnuradio-examples/python/channel-coding/fsm_files/awgn2o3_4.fsm b/gr-trellis/src/examples/fsm_files/awgn2o3_4.fsm similarity index 100% rename from gnuradio-examples/python/channel-coding/fsm_files/awgn2o3_4.fsm rename to gr-trellis/src/examples/fsm_files/awgn2o3_4.fsm diff --git a/gnuradio-examples/python/channel-coding/fsm_files/awgn2o3_4_msb.fsm b/gr-trellis/src/examples/fsm_files/awgn2o3_4_msb.fsm similarity index 100% rename from gnuradio-examples/python/channel-coding/fsm_files/awgn2o3_4_msb.fsm rename to gr-trellis/src/examples/fsm_files/awgn2o3_4_msb.fsm diff --git a/gnuradio-examples/python/channel-coding/fsm_files/awgn2o3_4_msbG.fsm b/gr-trellis/src/examples/fsm_files/awgn2o3_4_msbG.fsm similarity index 100% rename from gnuradio-examples/python/channel-coding/fsm_files/awgn2o3_4_msbG.fsm rename to gr-trellis/src/examples/fsm_files/awgn2o3_4_msbG.fsm diff --git a/gnuradio-examples/python/channel-coding/fsm_files/awgn2o3_8.fsm b/gr-trellis/src/examples/fsm_files/awgn2o3_8.fsm similarity index 100% rename from gnuradio-examples/python/channel-coding/fsm_files/awgn2o3_8.fsm rename to gr-trellis/src/examples/fsm_files/awgn2o3_8.fsm diff --git a/gnuradio-examples/python/channel-coding/fsm_files/awgn2o4_4.fsm b/gr-trellis/src/examples/fsm_files/awgn2o4_4.fsm similarity index 100% rename from gnuradio-examples/python/channel-coding/fsm_files/awgn2o4_4.fsm rename to gr-trellis/src/examples/fsm_files/awgn2o4_4.fsm diff --git a/gnuradio-examples/python/channel-coding/fsm_files/disconnected.fsm b/gr-trellis/src/examples/fsm_files/disconnected.fsm similarity index 100% rename from gnuradio-examples/python/channel-coding/fsm_files/disconnected.fsm rename to gr-trellis/src/examples/fsm_files/disconnected.fsm diff --git a/gnuradio-examples/python/channel-coding/fsm_files/irregular.fsm b/gr-trellis/src/examples/fsm_files/irregular.fsm similarity index 100% rename from gnuradio-examples/python/channel-coding/fsm_files/irregular.fsm rename to gr-trellis/src/examples/fsm_files/irregular.fsm diff --git a/gnuradio-examples/python/channel-coding/fsm_files/rep3.fsm b/gr-trellis/src/examples/fsm_files/rep3.fsm similarity index 100% rename from gnuradio-examples/python/channel-coding/fsm_files/rep3.fsm rename to gr-trellis/src/examples/fsm_files/rep3.fsm diff --git a/gnuradio-examples/python/channel-coding/fsm_files/rep5.fsm b/gr-trellis/src/examples/fsm_files/rep5.fsm similarity index 100% rename from gnuradio-examples/python/channel-coding/fsm_files/rep5.fsm rename to gr-trellis/src/examples/fsm_files/rep5.fsm diff --git a/gnuradio-examples/python/channel-coding/fsm_files/simple.fsm b/gr-trellis/src/examples/fsm_files/simple.fsm similarity index 100% rename from gnuradio-examples/python/channel-coding/fsm_files/simple.fsm rename to gr-trellis/src/examples/fsm_files/simple.fsm diff --git a/gnuradio-examples/python/channel-coding/fsm_utils.py b/gr-trellis/src/examples/fsm_utils.py similarity index 100% rename from gnuradio-examples/python/channel-coding/fsm_utils.py rename to gr-trellis/src/examples/fsm_utils.py diff --git a/gnuradio-examples/python/channel-coding/test_sccc_hard.py b/gr-trellis/src/examples/test_sccc_hard.py similarity index 100% rename from gnuradio-examples/python/channel-coding/test_sccc_hard.py rename to gr-trellis/src/examples/test_sccc_hard.py diff --git a/gnuradio-examples/python/channel-coding/test_sccc_soft.py b/gr-trellis/src/examples/test_sccc_soft.py similarity index 100% rename from gnuradio-examples/python/channel-coding/test_sccc_soft.py rename to gr-trellis/src/examples/test_sccc_soft.py diff --git a/gnuradio-examples/python/channel-coding/test_sccc_turbo.py b/gr-trellis/src/examples/test_sccc_turbo.py similarity index 100% rename from gnuradio-examples/python/channel-coding/test_sccc_turbo.py rename to gr-trellis/src/examples/test_sccc_turbo.py diff --git a/gnuradio-examples/python/channel-coding/test_tcm.py b/gr-trellis/src/examples/test_tcm.py similarity index 100% rename from gnuradio-examples/python/channel-coding/test_tcm.py rename to gr-trellis/src/examples/test_tcm.py diff --git a/gnuradio-examples/python/channel-coding/test_tcm1.py b/gr-trellis/src/examples/test_tcm1.py similarity index 100% rename from gnuradio-examples/python/channel-coding/test_tcm1.py rename to gr-trellis/src/examples/test_tcm1.py diff --git a/gnuradio-examples/python/channel-coding/test_tcm2.py b/gr-trellis/src/examples/test_tcm2.py similarity index 100% rename from gnuradio-examples/python/channel-coding/test_tcm2.py rename to gr-trellis/src/examples/test_tcm2.py diff --git a/gnuradio-examples/python/channel-coding/test_tcm_combined.py b/gr-trellis/src/examples/test_tcm_combined.py similarity index 100% rename from gnuradio-examples/python/channel-coding/test_tcm_combined.py rename to gr-trellis/src/examples/test_tcm_combined.py diff --git a/gnuradio-examples/python/channel-coding/test_tcm_parallel.py b/gr-trellis/src/examples/test_tcm_parallel.py similarity index 100% rename from gnuradio-examples/python/channel-coding/test_tcm_parallel.py rename to gr-trellis/src/examples/test_tcm_parallel.py diff --git a/gnuradio-examples/python/channel-coding/test_turbo_equalization.py b/gr-trellis/src/examples/test_turbo_equalization.py similarity index 100% rename from gnuradio-examples/python/channel-coding/test_turbo_equalization.py rename to gr-trellis/src/examples/test_turbo_equalization.py diff --git a/gnuradio-examples/python/channel-coding/test_turbo_equalization1.py b/gr-trellis/src/examples/test_turbo_equalization1.py similarity index 100% rename from gnuradio-examples/python/channel-coding/test_turbo_equalization1.py rename to gr-trellis/src/examples/test_turbo_equalization1.py diff --git a/gnuradio-examples/python/channel-coding/test_turbo_equalization2.py b/gr-trellis/src/examples/test_turbo_equalization2.py similarity index 100% rename from gnuradio-examples/python/channel-coding/test_turbo_equalization2.py rename to gr-trellis/src/examples/test_turbo_equalization2.py diff --git a/gnuradio-examples/python/channel-coding/test_viterbi_equalization.py b/gr-trellis/src/examples/test_viterbi_equalization.py similarity index 100% rename from gnuradio-examples/python/channel-coding/test_viterbi_equalization.py rename to gr-trellis/src/examples/test_viterbi_equalization.py diff --git a/gnuradio-examples/python/channel-coding/test_viterbi_equalization1.py b/gr-trellis/src/examples/test_viterbi_equalization1.py similarity index 100% rename from gnuradio-examples/python/channel-coding/test_viterbi_equalization1.py rename to gr-trellis/src/examples/test_viterbi_equalization1.py diff --git a/gr-utils/Makefile.am b/gr-utils/Makefile.am new file mode 100644 index 00000000..ec9cd029 --- /dev/null +++ b/gr-utils/Makefile.am @@ -0,0 +1,22 @@ +# +# Copyright 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., 51 Franklin Street, +# Boston, MA 02110-1301, USA. +# + +SUBDIRS = src diff --git a/gr-utils/src/Makefile.am b/gr-utils/src/Makefile.am new file mode 100644 index 00000000..7a941211 --- /dev/null +++ b/gr-utils/src/Makefile.am @@ -0,0 +1,22 @@ +# +# Copyright 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., 51 Franklin Street, +# Boston, MA 02110-1301, USA. +# + +SUBDIRS = lib python diff --git a/gr-utils/src/lib/Makefile.am b/gr-utils/src/lib/Makefile.am new file mode 100644 index 00000000..67f9dad5 --- /dev/null +++ b/gr-utils/src/lib/Makefile.am @@ -0,0 +1,20 @@ +# +# Copyright 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., 51 Franklin Street, +# Boston, MA 02110-1301, USA. +# diff --git a/gr-utils/src/python/Makefile.am b/gr-utils/src/python/Makefile.am new file mode 100644 index 00000000..cb8e9811 --- /dev/null +++ b/gr-utils/src/python/Makefile.am @@ -0,0 +1,35 @@ +# +# Copyright 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., 51 Franklin Street, +# Boston, MA 02110-1301, USA. +# + +EXTRA_DIST = \ + $(bin_SCRIPTS) + +bin_SCRIPTS = \ + usrp_benchmark_usb.py \ + usrp_fft.py \ + usrp_oscope.py \ + usrp_print_db.py \ + usrp_rx_cfile.py \ + usrp_rx_nogui.py \ + usrp_siggen.py \ + usrp_test_counting.py \ + usrp_test_loop.py \ + usrp_test_loop_lfsr.py diff --git a/gnuradio-examples/python/usrp/benchmark_usb.py b/gr-utils/src/python/usrp_benchmark_usb.py similarity index 100% rename from gnuradio-examples/python/usrp/benchmark_usb.py rename to gr-utils/src/python/usrp_benchmark_usb.py diff --git a/gnuradio-examples/python/usrp/usrp_fft.py b/gr-utils/src/python/usrp_fft.py similarity index 100% rename from gnuradio-examples/python/usrp/usrp_fft.py rename to gr-utils/src/python/usrp_fft.py diff --git a/gnuradio-examples/python/usrp/usrp_oscope.py b/gr-utils/src/python/usrp_oscope.py similarity index 100% rename from gnuradio-examples/python/usrp/usrp_oscope.py rename to gr-utils/src/python/usrp_oscope.py diff --git a/gr-utils/src/python/usrp_print_db.py b/gr-utils/src/python/usrp_print_db.py new file mode 100755 index 00000000..b082cb07 --- /dev/null +++ b/gr-utils/src/python/usrp_print_db.py @@ -0,0 +1,42 @@ +#!/usr/bin/env python +# +# Copyright 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., 51 Franklin Street, +# Boston, MA 02110-1301, USA. +# + +#!/usr/bin/env python + +from gnuradio import gr +from gnuradio import usrp +from optparse import OptionParser +from usrpm import usrp_dbid + +u_source = usrp.source_c() +u_sink = usrp.sink_c() + +subdev_Ar = usrp.selected_subdev(u_source, (0,0)) +subdev_Br = usrp.selected_subdev(u_source, (1,0)) +subdev_At = usrp.selected_subdev(u_sink, (0,0)) +subdev_Bt = usrp.selected_subdev(u_sink, (1,0)) + +print "RX d'board %s" % (subdev_Ar.side_and_name(),) +print "RX d'board %s" % (subdev_Br.side_and_name(),) +print "TX d'board %s" % (subdev_At.side_and_name(),) +print "TX d'board %s" % (subdev_Bt.side_and_name(),) + diff --git a/gnuradio-examples/python/usrp/usrp_rx_cfile.py b/gr-utils/src/python/usrp_rx_cfile.py similarity index 100% rename from gnuradio-examples/python/usrp/usrp_rx_cfile.py rename to gr-utils/src/python/usrp_rx_cfile.py diff --git a/gnuradio-examples/python/usrp/usrp_rx_nogui.py b/gr-utils/src/python/usrp_rx_nogui.py similarity index 100% rename from gnuradio-examples/python/usrp/usrp_rx_nogui.py rename to gr-utils/src/python/usrp_rx_nogui.py diff --git a/gnuradio-examples/python/usrp/usrp_siggen.py b/gr-utils/src/python/usrp_siggen.py similarity index 100% rename from gnuradio-examples/python/usrp/usrp_siggen.py rename to gr-utils/src/python/usrp_siggen.py diff --git a/gnuradio-examples/python/usrp/test_counting.py b/gr-utils/src/python/usrp_test_counting.py similarity index 100% rename from gnuradio-examples/python/usrp/test_counting.py rename to gr-utils/src/python/usrp_test_counting.py diff --git a/gnuradio-examples/python/usrp/test_digital_loopback_counting.py b/gr-utils/src/python/usrp_test_loop.py similarity index 100% rename from gnuradio-examples/python/usrp/test_digital_loopback_counting.py rename to gr-utils/src/python/usrp_test_loop.py diff --git a/gnuradio-examples/python/usrp/test_digital_loopback_lfsr.py b/gr-utils/src/python/usrp_test_loop_lfsr.py similarity index 100% rename from gnuradio-examples/python/usrp/test_digital_loopback_lfsr.py rename to gr-utils/src/python/usrp_test_loop_lfsr.py diff --git a/usrp/host/apps/print-db b/usrp/host/apps/print-db deleted file mode 100755 index 0a320981..00000000 --- a/usrp/host/apps/print-db +++ /dev/null @@ -1,19 +0,0 @@ -#!/usr/bin/env python - -from gnuradio import gr -from gnuradio import usrp -from optparse import OptionParser -from usrpm import usrp_dbid - -u_source = usrp.source_c() -u_sink = usrp.sink_c() -subdev_Ar = usrp.selected_subdev(u_source, (0,0)) -subdev_Br = usrp.selected_subdev(u_source, (1,0)) -subdev_At = usrp.selected_subdev(u_sink, (0,0)) -subdev_Bt = usrp.selected_subdev(u_sink, (1,0)) - -print "RX d'board %s" % (subdev_Ar.side_and_name(),) -print "RX d'board %s" % (subdev_Br.side_and_name(),) -print "TX d'board %s" % (subdev_At.side_and_name(),) -print "TX d'board %s" % (subdev_Bt.side_and_name(),) - -- 2.30.2