diff options
author | trondeau <trondeau@221aa14e-8319-0410-a670-987f0aec2ac5> | 2008-01-09 23:27:36 +0000 |
---|---|---|
committer | trondeau <trondeau@221aa14e-8319-0410-a670-987f0aec2ac5> | 2008-01-09 23:27:36 +0000 |
commit | ee31bc0892dbd2c1d5ecae3a9ce9e54ed1bdf8c5 (patch) | |
tree | 82bb22ba7c095742f9c5cc83bfa17747d2c829c7 /gnuradio-examples/python/digital | |
parent | 97dca638c9d58fe50a535719c2956ca9c937d963 (diff) |
merging receiver branch -r6837:7375 into trunk. Improves speed of MPSK receiver; adds branching and branchless versions of clipping and slicing routines to gr_math.
git-svn-id: http://gnuradio.org/svn/gnuradio/trunk@7389 221aa14e-8319-0410-a670-987f0aec2ac5
Diffstat (limited to 'gnuradio-examples/python/digital')
-rwxr-xr-x | gnuradio-examples/python/digital/benchmark_loopback.py | 33 | ||||
-rw-r--r-- | gnuradio-examples/python/digital/transmit_path_lb.py | 2 |
2 files changed, 2 insertions, 33 deletions
diff --git a/gnuradio-examples/python/digital/benchmark_loopback.py b/gnuradio-examples/python/digital/benchmark_loopback.py index e9a0f5d5ab..e46bbdeeb8 100755 --- a/gnuradio-examples/python/digital/benchmark_loopback.py +++ b/gnuradio-examples/python/digital/benchmark_loopback.py @@ -20,7 +20,7 @@ # Boston, MA 02110-1301, USA. # -from gnuradio import gr, gru, modulation_utils +from gnuradio import gr, gru, modulation_utils, blks2 from gnuradio import eng_notation from gnuradio.eng_option import eng_option from optparse import OptionParser @@ -32,34 +32,6 @@ from transmit_path_lb import transmit_path from receive_path_lb import receive_path import fusb_options -class awgn_channel(gr.hier_block2): - def __init__(self, sample_rate, noise_voltage, frequency_offset, seed=False): - - gr.hier_block2.__init__(self, "awgn_channel", - gr.io_signature(1, 1, gr.sizeof_gr_complex), # Input signature - gr.io_signature(1, 1, gr.sizeof_gr_complex)) # Output signature - - # Create the Gaussian noise source - if not seed: - self.noise = gr.noise_source_c(gr.GR_GAUSSIAN, noise_voltage) - else: - rseed = int(time.time()) - self.noise = gr.noise_source_c(gr.GR_GAUSSIAN, noise_voltage, rseed) - - self.adder = gr.add_cc() - - # Create the frequency offset - self.offset = gr.sig_source_c(1, gr.GR_SIN_WAVE, - frequency_offset, 1.0, 0.0) - self.mixer = gr.multiply_cc() - - # Connect the components - self.connect(self, (self.mixer, 0)) - self.connect(self.offset, (self.mixer, 1)) - self.connect(self.mixer, (self.adder, 0)) - self.connect(self.noise, (self.adder, 1)) - self.connect(self.adder, self) - class my_top_block(gr.top_block): def __init__(self, mod_class, demod_class, rx_callback, options): gr.top_block.__init__(self) @@ -78,8 +50,7 @@ class my_top_block(gr.top_block): self.rxpath = receive_path(demod_class, rx_callback, options) if channelon: - self.channel = awgn_channel(options.sample_rate, noise_voltage, - frequency_offset, options.seed) + self.channel = blks2.channel_model(noise_voltage, frequency_offset, 1.01) if options.discontinuous: z = 20000*[0,] diff --git a/gnuradio-examples/python/digital/transmit_path_lb.py b/gnuradio-examples/python/digital/transmit_path_lb.py index 49f53076e6..11d3702694 100644 --- a/gnuradio-examples/python/digital/transmit_path_lb.py +++ b/gnuradio-examples/python/digital/transmit_path_lb.py @@ -51,8 +51,6 @@ class transmit_path(gr.hier_block2): mod_kwargs = self._modulator_class.extract_kwargs_from_options(options) # transmitter - print self._modulator_class - print mod_kwargs modulator = self._modulator_class(**mod_kwargs) self.packet_transmitter = \ blks2.mod_pkts(modulator, |