commit-gnuradio
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Commit-gnuradio] r10864 - in gnuradio/trunk/gnuradio-core/src: lib/hier


From: jcorgan
Subject: [Commit-gnuradio] r10864 - in gnuradio/trunk/gnuradio-core/src: lib/hier python/gnuradio/blks2impl
Date: Fri, 17 Apr 2009 10:55:00 -0600 (MDT)

Author: jcorgan
Date: 2009-04-17 10:54:59 -0600 (Fri, 17 Apr 2009)
New Revision: 10864

Modified:
   gnuradio/trunk/gnuradio-core/src/lib/hier/gr_channel_model.cc
   gnuradio/trunk/gnuradio-core/src/python/gnuradio/blks2impl/channel_model.py
Log:
Cleanup on gr.channel_model

Modified: gnuradio/trunk/gnuradio-core/src/lib/hier/gr_channel_model.cc
===================================================================
--- gnuradio/trunk/gnuradio-core/src/lib/hier/gr_channel_model.cc       
2009-04-17 07:19:24 UTC (rev 10863)
+++ gnuradio/trunk/gnuradio-core/src/lib/hier/gr_channel_model.cc       
2009-04-17 16:54:59 UTC (rev 10864)
@@ -39,7 +39,7 @@
                                                         noise_seed));
 }
 
-// Hierarchical block constructor, with no inputs or outputs
+// Hierarchical block constructor
 gr_channel_model::gr_channel_model(double noise_voltage,
                                   double frequency_offset,
                                   double epsilon,

Modified: 
gnuradio/trunk/gnuradio-core/src/python/gnuradio/blks2impl/channel_model.py
===================================================================
--- gnuradio/trunk/gnuradio-core/src/python/gnuradio/blks2impl/channel_model.py 
2009-04-17 07:19:24 UTC (rev 10863)
+++ gnuradio/trunk/gnuradio-core/src/python/gnuradio/blks2impl/channel_model.py 
2009-04-17 16:54:59 UTC (rev 10864)
@@ -1,6 +1,6 @@
 #!/usr/bin/env python
 #
-# Copyright 2007 Free Software Foundation, Inc.
+# Copyright 2009 Free Software Foundation, Inc.
 # 
 # This file is part of GNU Radio
 # 
@@ -22,44 +22,5 @@
 
 from gnuradio import gr
 
-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], noise_seed=3021):
-        ''' 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
-        self.timing_offset = gr.fractional_interpolator_cc(0, epsilon)
-        
-        self.multipath = gr.fir_filter_ccc(1, taps)
-        
-        self.noise_adder = gr.add_cc()
-        self.noise = gr.noise_source_c(gr.GR_GAUSSIAN, noise_voltage, 
noise_seed)
-        self.freq_offset = gr.sig_source_c(1, gr.GR_SIN_WAVE, 
frequency_offset, 1.0, 0.0)
-        self.mixer_offset = gr.multiply_cc()
-
-        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(self, noise_voltage):
-        self.noise.set_amplitude(noise_voltage)
-        
-    def set_frequency_offset(self, frequency_offset):
-        self.freq_offset.set_frequency(frequency_offset)
-     
-    def set_taps(self, taps):
-        self.multipath.set_taps(taps)
-
-    def set_timing_offset(self, epsilon):
-        self.timing_offset.set_interp_ratio(epsilon)
+# This block is now a C++ hierarchical block, gr.channel_model
+channel_model = gr.channel_model





reply via email to

[Prev in Thread] Current Thread [Next in Thread]