From 6556095628428156c790b1bd9be67dc3e4c0a797 Mon Sep 17 00:00:00 2001 From: jcorgan Date: Thu, 16 Apr 2009 07:54:34 +0000 Subject: [PATCH] Change our examples to use gr.channel_model instead of blks2.channel_model git-svn-id: http://gnuradio.org/svn/gnuradio/trunk@10861 221aa14e-8319-0410-a670-987f0aec2ac5 --- gnuradio-examples/python/digital/benchmark_loopback.py | 6 +++--- gnuradio-examples/python/ofdm/benchmark_ofdm.py | 6 +++--- gr-qtgui/src/python/pyqt_example.py | 4 ++-- gr-qtgui/src/python/qt_digital.py | 8 ++++---- 4 files changed, 12 insertions(+), 12 deletions(-) diff --git a/gnuradio-examples/python/digital/benchmark_loopback.py b/gnuradio-examples/python/digital/benchmark_loopback.py index e46bbdee..51deba44 100755 --- a/gnuradio-examples/python/digital/benchmark_loopback.py +++ b/gnuradio-examples/python/digital/benchmark_loopback.py @@ -1,6 +1,6 @@ #!/usr/bin/env python # -# Copyright 2005, 2006, 2007 Free Software Foundation, Inc. +# Copyright 2005, 2006, 2007, 2009 Free Software Foundation, Inc. # # This file is part of GNU Radio # @@ -20,7 +20,7 @@ # Boston, MA 02110-1301, USA. # -from gnuradio import gr, gru, modulation_utils, blks2 +from gnuradio import gr, gru, modulation_utils from gnuradio import eng_notation from gnuradio.eng_option import eng_option from optparse import OptionParser @@ -50,7 +50,7 @@ class my_top_block(gr.top_block): self.rxpath = receive_path(demod_class, rx_callback, options) if channelon: - self.channel = blks2.channel_model(noise_voltage, frequency_offset, 1.01) + self.channel = gr.channel_model(noise_voltage, frequency_offset, 1.01) if options.discontinuous: z = 20000*[0,] diff --git a/gnuradio-examples/python/ofdm/benchmark_ofdm.py b/gnuradio-examples/python/ofdm/benchmark_ofdm.py index 5861da16..6d6ca9f2 100755 --- a/gnuradio-examples/python/ofdm/benchmark_ofdm.py +++ b/gnuradio-examples/python/ofdm/benchmark_ofdm.py @@ -1,6 +1,6 @@ #!/usr/bin/env python # -# Copyright 2006, 2007 Free Software Foundation, Inc. +# Copyright 2006, 2007, 2009 Free Software Foundation, Inc. # # This file is part of GNU Radio # @@ -71,8 +71,8 @@ class my_top_block(gr.top_block): #self.mux = gr.stream_mux(gr.sizeof_gr_complex, stream_size) self.throttle = gr.throttle(gr.sizeof_gr_complex, options.sample_rate) - self.channel = blks2.channel_model(noise_voltage, frequency_offset, - options.clockrate_ratio, taps) + self.channel = gr.channel_model(noise_voltage, frequency_offset, + options.clockrate_ratio, taps) self.rxpath = receive_path(callback, options) #self.connect(self.zeros, (self.mux,0)) diff --git a/gr-qtgui/src/python/pyqt_example.py b/gr-qtgui/src/python/pyqt_example.py index 27b949c8..ac636295 100755 --- a/gr-qtgui/src/python/pyqt_example.py +++ b/gr-qtgui/src/python/pyqt_example.py @@ -1,6 +1,6 @@ #!/usr/bin/env python -from gnuradio import gr, blks2 +from gnuradio import gr from gnuradio.qtgui import qtgui from PyQt4 import QtGui, QtCore import sys, sip @@ -111,7 +111,7 @@ class my_top_block(gr.top_block): src1 = gr.sig_source_c(Rs, gr.GR_SIN_WAVE, f1, 0.1, 0) src2 = gr.sig_source_c(Rs, gr.GR_SIN_WAVE, f2, 0.1, 0) src = gr.add_cc() - channel = blks2.channel_model(0.001) + channel = gr.channel_model(0.001) thr = gr.throttle(gr.sizeof_gr_complex, 100*fftsize) self.snk1 = qtgui.sink_c(fftsize, gr.firdes.WIN_BLACKMAN_hARRIS, -Rs/2, Rs/2, diff --git a/gr-qtgui/src/python/qt_digital.py b/gr-qtgui/src/python/qt_digital.py index 55be56b1..2583bf1d 100755 --- a/gr-qtgui/src/python/qt_digital.py +++ b/gr-qtgui/src/python/qt_digital.py @@ -74,7 +74,7 @@ class control_panel(QtGui.QWidget): def noiseEditText(self): try: noise = self.noiseEdit.text().toDouble()[0] - self.channel.noise.set_amplitude(noise) + self.channel.set_noise_voltage(noise) self.noise = noise except RuntimeError: @@ -83,7 +83,7 @@ class control_panel(QtGui.QWidget): def freqEditText(self): try: freq = self.freqEdit.text().toDouble()[0] - self.channel.freq_offset.set_frequency(freq) + self.channel.set_frequency_offset(freq) self.freq = freq except RuntimeError: @@ -92,7 +92,7 @@ class control_panel(QtGui.QWidget): def timeEditText(self): try: to = self.timeEdit.text().toDouble()[0] - self.channel.timing_offset.set_interp_ratio(to) + self.channel.set_timing_offset(to) self.timing_offset = to except RuntimeError: @@ -121,7 +121,7 @@ class my_top_block(gr.top_block): noise = 1e-7 fo = 1e-6 to = 1.0 - channel = blks2.channel_model(noise, fo, to) + channel = gr.channel_model(noise, fo, to) thr = gr.throttle(gr.sizeof_gr_complex, 10*fftsize) self.snk_tx = qtgui.sink_c(fftsize, gr.firdes.WIN_BLACKMAN_hARRIS, -1/2, 1/2, -- 2.39.5