]> git.gag.com Git - debian/gnuradio/commitdiff
channel_model.py now allows to set the random seed for the noise
authoreb <eb@221aa14e-8319-0410-a670-987f0aec2ac5>
Mon, 26 May 2008 13:30:41 +0000 (13:30 +0000)
committereb <eb@221aa14e-8319-0410-a670-987f0aec2ac5>
Mon, 26 May 2008 13:30:41 +0000 (13:30 +0000)
source via __init__ and adds a function to set the timing
offset. (Patch from Andreas Müller.)

git-svn-id: http://gnuradio.org/svn/gnuradio/trunk@8508 221aa14e-8319-0410-a670-987f0aec2ac5

gnuradio-core/src/python/gnuradio/blks2impl/channel_model.py

index 7d53dd9212a2073ace2f78f22da9b91611deab5c..a36705a9e90a782661e7a6b74cde8918d4764a15 100644 (file)
@@ -23,7 +23,7 @@
 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]):
+    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
@@ -40,7 +40,7 @@ class channel_model(gr.hier_block2):
         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)
+        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()
 
@@ -60,3 +60,6 @@ class channel_model(gr.hier_block2):
      
     def set_taps(self, taps):
         self.multipath.set_taps(taps)
+
+    def set_timing_offset(self, epsilon):
+        self.timing_offset.set_interp_ratio(epsilon)