summaryrefslogtreecommitdiff
path: root/gnuradio-core/src
diff options
context:
space:
mode:
authorjcorgan2007-09-20 17:13:52 +0000
committerjcorgan2007-09-20 17:13:52 +0000
commitd5168150815339f0d3b117bcfb4d2c4265d15b33 (patch)
tree789dd2e37bbe12295882938bccf41ea7eb3fcf90 /gnuradio-core/src
parenta64acfe8cef1fa73da333d0860b3da0c97a5eb45 (diff)
downloadgnuradio-d5168150815339f0d3b117bcfb4d2c4265d15b33.tar.gz
gnuradio-d5168150815339f0d3b117bcfb4d2c4265d15b33.tar.bz2
gnuradio-d5168150815339f0d3b117bcfb4d2c4265d15b33.zip
Converted blks2.channel_model to hier_block2 format.
git-svn-id: http://gnuradio.org/svn/gnuradio/trunk@6487 221aa14e-8319-0410-a670-987f0aec2ac5
Diffstat (limited to 'gnuradio-core/src')
-rw-r--r--gnuradio-core/src/python/gnuradio/blks2impl/channel_model.py23
1 files changed, 13 insertions, 10 deletions
diff --git a/gnuradio-core/src/python/gnuradio/blks2impl/channel_model.py b/gnuradio-core/src/python/gnuradio/blks2impl/channel_model.py
index 21980a22e..2e2ac6e27 100644
--- a/gnuradio-core/src/python/gnuradio/blks2impl/channel_model.py
+++ b/gnuradio-core/src/python/gnuradio/blks2impl/channel_model.py
@@ -22,16 +22,19 @@
from gnuradio import gr
-class channel_model(gr.hier_block):
- def __init__(self, fg, noise_voltage=0.0, frequency_offset=0.0, epsilon=1.0, taps=[1.0,0.0]):
+class channel_model(gr.hier_block2):
+ def __init__(self, noise_voltage=0.0, frequency_offset=0.0, epsilon=1.0, taps=[1.0,0.0]):
''' Creates a channel model that includes:
- AWGN noise power in terms of noise voltage
- A frequency offest in the channel in ratio
- A timing offset ratio to model clock difference (epsilon)
- Multipath taps
'''
+ gr.hier_block2.__init__(self, "channel_model",
+ gr.io_signature(1, 1, gr.sizeof_gr_complex), # Input signature
+ gr.io_signature(1, 1, gr.sizeof_gr_complex)) # Output signature
- print epsilon
+ #print epsilon
self.timing_offset = gr.fractional_interpolator_cc(0, epsilon)
self.multipath = gr.fir_filter_ccc(1, taps)
@@ -41,13 +44,13 @@ class channel_model(gr.hier_block):
self.freq_offset = gr.sig_source_c(1, gr.GR_SIN_WAVE, frequency_offset, 1.0, 0.0)
self.mixer_offset = gr.multiply_cc()
- fg.connect(self.timing_offset, self.multipath)
- fg.connect(self.multipath, (self.mixer_offset,0))
- fg.connect(self.freq_offset,(self.mixer_offset,1))
- fg.connect(self.mixer_offset, (self.noise_adder,1))
- fg.connect(self.noise, (self.noise_adder,0))
-
- gr.hier_block.__init__(self, fg, self.timing_offset, self.noise_adder)
+ self.connect(self, self.timing_offset, self.multipath)
+ self.connect(self.multipath, (self.mixer_offset,0))
+ self.connect(self.freq_offset,(self.mixer_offset,1))
+ self.connect(self.mixer_offset, (self.noise_adder,1))
+ self.connect(self.noise, (self.noise_adder,0))
+ self.connect(self.noise_adder, self)
+
def set_noise_voltage(noise_voltage):
self.noise.set_amplitude(noise_voltage)