diff options
author | eb | 2008-05-26 13:30:41 +0000 |
---|---|---|
committer | eb | 2008-05-26 13:30:41 +0000 |
commit | fcf2cfb0c0949db3cb7cdd635376a683cbc13f4d (patch) | |
tree | 6dfdc216f8005a4e8f7ebf58063f11e5a6786140 /gnuradio-core/src | |
parent | c7fc4e073aca82bc4cae529459448e0bc98b650e (diff) | |
download | gnuradio-fcf2cfb0c0949db3cb7cdd635376a683cbc13f4d.tar.gz gnuradio-fcf2cfb0c0949db3cb7cdd635376a683cbc13f4d.tar.bz2 gnuradio-fcf2cfb0c0949db3cb7cdd635376a683cbc13f4d.zip |
channel_model.py now allows to set the random seed for the noise
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
Diffstat (limited to 'gnuradio-core/src')
-rw-r--r-- | gnuradio-core/src/python/gnuradio/blks2impl/channel_model.py | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/gnuradio-core/src/python/gnuradio/blks2impl/channel_model.py b/gnuradio-core/src/python/gnuradio/blks2impl/channel_model.py index 7d53dd921..a36705a9e 100644 --- a/gnuradio-core/src/python/gnuradio/blks2impl/channel_model.py +++ b/gnuradio-core/src/python/gnuradio/blks2impl/channel_model.py @@ -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) |