diff options
author | jcorgan <jcorgan@221aa14e-8319-0410-a670-987f0aec2ac5> | 2007-09-18 18:59:00 +0000 |
---|---|---|
committer | jcorgan <jcorgan@221aa14e-8319-0410-a670-987f0aec2ac5> | 2007-09-18 18:59:00 +0000 |
commit | e692e71305ecd71d3681fe37f3d76f350d67e276 (patch) | |
tree | dc320c9261303aa9a92f4d12bdba85f82720d1bf /gnuradio-examples/python/audio | |
parent | 6ad04a094ced626e46c210b9847eae46a1ae8e67 (diff) |
Merge r6461:6464 from jcorgan/t162-staging into trunk.
* Final gr.top_block and gr.hier_block2 implementation inside
gnuradio-core/src/lib/runtime
* Implementation of gr.hier_block2 versions of all the old-style blocks
in blks. These live in blks2.
* Addition of gr.hier_block2 based versions of gr-wxgui blocks
* Conversion of all the example code in gnuradio-examples to use this
new code
* Conversion of all the gr-utils scripts to use the new code
The OFDM examples and related hierarchical blocks have not yet been
converted. Code in the rest of the tree that is outside the core
and example components has also not yet been converted.
git-svn-id: http://gnuradio.org/svn/gnuradio/trunk@6466 221aa14e-8319-0410-a670-987f0aec2ac5
Diffstat (limited to 'gnuradio-examples/python/audio')
-rwxr-xr-x | gnuradio-examples/python/audio/audio_copy.py | 8 | ||||
-rwxr-xr-x | gnuradio-examples/python/audio/audio_fft.py | 16 | ||||
-rwxr-xr-x | gnuradio-examples/python/audio/audio_play.py | 8 | ||||
-rwxr-xr-x | gnuradio-examples/python/audio/audio_to_file.py | 8 | ||||
-rwxr-xr-x | gnuradio-examples/python/audio/dial_tone.py | 8 | ||||
-rwxr-xr-x | gnuradio-examples/python/audio/mono_tone.py | 8 | ||||
-rwxr-xr-x | gnuradio-examples/python/audio/multi_tone.py | 8 | ||||
-rwxr-xr-x | gnuradio-examples/python/audio/noise.py | 6 | ||||
-rwxr-xr-x | gnuradio-examples/python/audio/spectrum_inversion.py | 26 | ||||
-rwxr-xr-x | gnuradio-examples/python/audio/test_resampler.py | 12 |
10 files changed, 64 insertions, 44 deletions
diff --git a/gnuradio-examples/python/audio/audio_copy.py b/gnuradio-examples/python/audio/audio_copy.py index 88dd088340..3094c9f7a5 100755 --- a/gnuradio-examples/python/audio/audio_copy.py +++ b/gnuradio-examples/python/audio/audio_copy.py @@ -1,6 +1,6 @@ #!/usr/bin/env python # -# Copyright 2004,2005 Free Software Foundation, Inc. +# Copyright 2004,2005,2007 Free Software Foundation, Inc. # # This file is part of GNU Radio # @@ -25,10 +25,10 @@ from gnuradio import audio from gnuradio.eng_option import eng_option from optparse import OptionParser -class my_graph(gr.flow_graph): +class my_top_block(gr.top_block): def __init__(self): - gr.flow_graph.__init__(self) + gr.top_block.__init__(self) parser = OptionParser(option_class=eng_option) parser.add_option("-I", "--audio-input", type="string", default="", @@ -58,7 +58,7 @@ class my_graph(gr.flow_graph): if __name__ == '__main__': try: - my_graph().run() + my_top_block().run() except KeyboardInterrupt: pass diff --git a/gnuradio-examples/python/audio/audio_fft.py b/gnuradio-examples/python/audio/audio_fft.py index 7c54dd55b5..f7f1c2e8c0 100755 --- a/gnuradio-examples/python/audio/audio_fft.py +++ b/gnuradio-examples/python/audio/audio_fft.py @@ -1,6 +1,6 @@ #!/usr/bin/env python # -# Copyright 2004,2005 Free Software Foundation, Inc. +# Copyright 2004,2005,2007 Free Software Foundation, Inc. # # This file is part of GNU Radio # @@ -23,14 +23,14 @@ from gnuradio import gr, gru, audio from gnuradio import eng_notation from gnuradio.eng_option import eng_option -from gnuradio.wxgui import stdgui, fftsink, waterfallsink, scopesink, form, slider +from gnuradio.wxgui import stdgui2, fftsink2, waterfallsink2, scopesink2, form, slider from optparse import OptionParser import wx import sys -class app_flow_graph(stdgui.gui_flow_graph): +class app_top_block(stdgui2.std_top_block): def __init__(self, frame, panel, vbox, argv): - stdgui.gui_flow_graph.__init__(self) + stdgui2.std_top_block.__init__(self, frame, panel, vbox, argv) self.frame = frame self.panel = panel @@ -57,11 +57,11 @@ class app_flow_graph(stdgui.gui_flow_graph): # build the graph if options.waterfall: self.scope = \ - waterfallsink.waterfall_sink_f (self, panel, fft_size=1024, sample_rate=sample_rate) + waterfallsink2.waterfall_sink_f (panel, fft_size=1024, sample_rate=sample_rate) elif options.oscilloscope: - self.scope = scopesink.scope_sink_f(self, panel, sample_rate=sample_rate) + self.scope = scopesink2.scope_sink_f(panel, sample_rate=sample_rate) else: - self.scope = fftsink.fft_sink_f (self, panel, fft_size=1024, sample_rate=sample_rate, fft_rate=30) + self.scope = fftsink2.fft_sink_f (panel, fft_size=1024, sample_rate=sample_rate, fft_rate=30) self.src = audio.source (sample_rate, options.audio_input) @@ -130,7 +130,7 @@ class app_flow_graph(stdgui.gui_flow_graph): def main (): - app = stdgui.stdapp(app_flow_graph, "Audio FFT", nstatus=1) + app = stdgui2.stdapp(app_top_block, "Audio FFT", nstatus=1) app.MainLoop() if __name__ == '__main__': diff --git a/gnuradio-examples/python/audio/audio_play.py b/gnuradio-examples/python/audio/audio_play.py index 37b2abda10..f9520c7cf9 100755 --- a/gnuradio-examples/python/audio/audio_play.py +++ b/gnuradio-examples/python/audio/audio_play.py @@ -1,6 +1,6 @@ #!/usr/bin/env python # -# Copyright 2004,2005 Free Software Foundation, Inc. +# Copyright 2004,2005,2007 Free Software Foundation, Inc. # # This file is part of GNU Radio # @@ -26,10 +26,10 @@ from gnuradio.eng_option import eng_option from optparse import OptionParser -class my_graph(gr.flow_graph): +class my_top_block(gr.top_block): def __init__(self): - gr.flow_graph.__init__(self) + gr.top_block.__init__(self) parser = OptionParser(option_class=eng_option) parser.add_option("-F", "--filename", type="string", default="audio.dat", @@ -52,6 +52,6 @@ class my_graph(gr.flow_graph): if __name__ == '__main__': try: - my_graph().run() + my_top_block().run() except KeyboardInterrupt: pass diff --git a/gnuradio-examples/python/audio/audio_to_file.py b/gnuradio-examples/python/audio/audio_to_file.py index 7aa49e7f9b..0d54f7bd2f 100755 --- a/gnuradio-examples/python/audio/audio_to_file.py +++ b/gnuradio-examples/python/audio/audio_to_file.py @@ -1,6 +1,6 @@ #!/usr/bin/env python # -# Copyright 2004 Free Software Foundation, Inc. +# Copyright 2004,2007 Free Software Foundation, Inc. # # This file is part of GNU Radio # @@ -25,10 +25,10 @@ from gnuradio import audio from gnuradio.eng_option import eng_option from optparse import OptionParser -class my_graph(gr.flow_graph): +class my_top_block(gr.top_block): def __init__(self): - gr.flow_graph.__init__(self) + gr.top_block.__init__(self) usage="%prog: [options] output_filename" parser = OptionParser(option_class=eng_option, usage=usage) @@ -58,6 +58,6 @@ class my_graph(gr.flow_graph): if __name__ == '__main__': try: - my_graph().run() + my_top_block().run() except KeyboardInterrupt: pass diff --git a/gnuradio-examples/python/audio/dial_tone.py b/gnuradio-examples/python/audio/dial_tone.py index 1ec1b0003e..65c5e50b22 100755 --- a/gnuradio-examples/python/audio/dial_tone.py +++ b/gnuradio-examples/python/audio/dial_tone.py @@ -1,6 +1,6 @@ #!/usr/bin/env python # -# Copyright 2004,2005 Free Software Foundation, Inc. +# Copyright 2004,2005,2007 Free Software Foundation, Inc. # # This file is part of GNU Radio # @@ -25,10 +25,10 @@ from gnuradio import audio from gnuradio.eng_option import eng_option from optparse import OptionParser -class my_graph(gr.flow_graph): +class my_top_block(gr.top_block): def __init__(self): - gr.flow_graph.__init__(self) + gr.top_block.__init__(self) parser = OptionParser(option_class=eng_option) parser.add_option("-O", "--audio-output", type="string", default="", @@ -52,6 +52,6 @@ class my_graph(gr.flow_graph): if __name__ == '__main__': try: - my_graph().run() + my_top_block().run() except KeyboardInterrupt: pass diff --git a/gnuradio-examples/python/audio/mono_tone.py b/gnuradio-examples/python/audio/mono_tone.py index d5c7e63809..869c2e5ffb 100755 --- a/gnuradio-examples/python/audio/mono_tone.py +++ b/gnuradio-examples/python/audio/mono_tone.py @@ -1,6 +1,6 @@ #!/usr/bin/env python # -# Copyright 2004,2005 Free Software Foundation, Inc. +# Copyright 2004,2005,2007 Free Software Foundation, Inc. # # This file is part of GNU Radio # @@ -29,10 +29,10 @@ from optparse import OptionParser #print os.getpid() #raw_input('Attach gdb and press Enter: ') -class my_graph(gr.flow_graph): +class my_top_block(gr.top_block): def __init__(self): - gr.flow_graph.__init__(self) + gr.top_block.__init__(self) parser = OptionParser(option_class=eng_option) parser.add_option("-O", "--audio-output", type="string", default="", @@ -61,6 +61,6 @@ class my_graph(gr.flow_graph): if __name__ == '__main__': try: - my_graph().run() + my_top_block().run() except KeyboardInterrupt: pass diff --git a/gnuradio-examples/python/audio/multi_tone.py b/gnuradio-examples/python/audio/multi_tone.py index 4cf9933865..7d47dd5d5a 100755 --- a/gnuradio-examples/python/audio/multi_tone.py +++ b/gnuradio-examples/python/audio/multi_tone.py @@ -1,6 +1,6 @@ #!/usr/bin/env python # -# Copyright 2004,2006 Free Software Foundation, Inc. +# Copyright 2004,2006,2007 Free Software Foundation, Inc. # # This file is part of GNU Radio # @@ -29,10 +29,10 @@ from optparse import OptionParser #print os.getpid() #raw_input('Attach gdb and press Enter: ') -class my_graph(gr.flow_graph): +class my_top_block(gr.top_block): def __init__(self): - gr.flow_graph.__init__(self) + gr.top_block.__init__(self) parser = OptionParser(option_class=eng_option) parser.add_option("-O", "--audio-output", type="string", default="", @@ -85,6 +85,6 @@ class my_graph(gr.flow_graph): if __name__ == '__main__': try: - my_graph().run() + my_top_block().run() except KeyboardInterrupt: pass diff --git a/gnuradio-examples/python/audio/noise.py b/gnuradio-examples/python/audio/noise.py index 6e9b69be77..75f7410829 100755 --- a/gnuradio-examples/python/audio/noise.py +++ b/gnuradio-examples/python/audio/noise.py @@ -25,10 +25,10 @@ from gnuradio import audio from gnuradio.eng_option import eng_option from optparse import OptionParser -class my_graph(gr.flow_graph): +class my_top_block(gr.top_block): def __init__(self): - gr.flow_graph.__init__(self) + gr.top_block.__init__(self) parser = OptionParser(option_class=eng_option) parser.add_option("-O", "--audio-output", type="string", default="", @@ -50,6 +50,6 @@ class my_graph(gr.flow_graph): if __name__ == '__main__': try: - my_graph().run() + my_top_block().run() except KeyboardInterrupt: pass diff --git a/gnuradio-examples/python/audio/spectrum_inversion.py b/gnuradio-examples/python/audio/spectrum_inversion.py index 9bb87aa4b1..021e23f2d7 100755 --- a/gnuradio-examples/python/audio/spectrum_inversion.py +++ b/gnuradio-examples/python/audio/spectrum_inversion.py @@ -1,5 +1,25 @@ #!/usr/bin/env python # +# Copyright 2004,2005,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. + +# # Gang - Here's a simple script that demonstrates spectrum inversion # using the multiply by [1,-1] method (mixing with Nyquist frequency). # Requires nothing but a sound card, and sounds just like listening @@ -11,10 +31,10 @@ from gnuradio import audio from gnuradio.eng_option import eng_option from optparse import OptionParser -class my_graph(gr.flow_graph): +class my_top_block(gr.top_block): def __init__(self): - gr.flow_graph.__init__(self) + gr.top_block.__init__(self) parser = OptionParser(option_class=eng_option) parser.add_option("-I", "--audio-input", type="string", default="", @@ -43,6 +63,6 @@ class my_graph(gr.flow_graph): if __name__ == '__main__': try: - my_graph().run() + my_top_block().run() except KeyboardInterrupt: pass diff --git a/gnuradio-examples/python/audio/test_resampler.py b/gnuradio-examples/python/audio/test_resampler.py index 710b0fa6b1..4644c5e2f4 100755 --- a/gnuradio-examples/python/audio/test_resampler.py +++ b/gnuradio-examples/python/audio/test_resampler.py @@ -1,6 +1,6 @@ #!/usr/bin/env python # -# Copyright 2004,2005 Free Software Foundation, Inc. +# Copyright 2004,2005,2007 Free Software Foundation, Inc. # # This file is part of GNU Radio # @@ -20,16 +20,16 @@ # Boston, MA 02110-1301, USA. # -from gnuradio import gr, gru, blks +from gnuradio import gr, gru, blks2 from gnuradio import audio from gnuradio.eng_option import eng_option from optparse import OptionParser -class my_graph(gr.flow_graph): +class my_top_block(gr.top_block): def __init__(self): - gr.flow_graph.__init__(self) + gr.top_block.__init__(self) parser = OptionParser(option_class=eng_option) parser.add_option("-O", "--audio-output", type="string", default="", @@ -54,13 +54,13 @@ class my_graph(gr.flow_graph): ampl = 0.1 src0 = gr.sig_source_f (input_rate, gr.GR_SIN_WAVE, 650, ampl) - rr = blks.rational_resampler_fff(self, interp, decim) + rr = blks2.rational_resampler_fff(interp, decim) dst = audio.sink (output_rate, options.audio_output) self.connect (src0, rr, (dst, 0)) if __name__ == '__main__': try: - my_graph().run() + my_top_block().run() except KeyboardInterrupt: pass |