Change our examples to use gr.channel_model instead of blks2.channel_model
authorjcorgan <jcorgan@221aa14e-8319-0410-a670-987f0aec2ac5>
Thu, 16 Apr 2009 07:54:34 +0000 (07:54 +0000)
committerjcorgan <jcorgan@221aa14e-8319-0410-a670-987f0aec2ac5>
Thu, 16 Apr 2009 07:54:34 +0000 (07:54 +0000)
git-svn-id: http://gnuradio.org/svn/gnuradio/trunk@10861 221aa14e-8319-0410-a670-987f0aec2ac5

gnuradio-examples/python/digital/benchmark_loopback.py
gnuradio-examples/python/ofdm/benchmark_ofdm.py
gr-qtgui/src/python/pyqt_example.py
gr-qtgui/src/python/qt_digital.py

index e46bbdeeb8a8b9760d4b90a0fd99c87aba9fc678..51deba44c6863c629d2a9172664dbedb2cf5b95f 100755 (executable)
@@ -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,]
index 5861da16c7a089370423921ebda44b5cd4cd1da5..6d6ca9f2aeb43a5a652acdde79ec0d84232803c9 100755 (executable)
@@ -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))
index 27b949c81cf56fc6c762aa05441760941db855da..ac636295dbc4eb3edf8109647fbd84be7f054df3 100755 (executable)
@@ -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,
index 55be56b17fdd2d7a530d7c956fd687e5d69d520e..2583bf1da25299f79bcfa2302d54f56b95756d20 100755 (executable)
@@ -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,