[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Commit-gnuradio] r5657 - gnuradio/branches/features/ofdm/receiver/gnura
From: |
trondeau |
Subject: |
[Commit-gnuradio] r5657 - gnuradio/branches/features/ofdm/receiver/gnuradio-core/src/python/gnuradio/blksimpl |
Date: |
Sun, 3 Jun 2007 21:08:40 -0600 (MDT) |
Author: trondeau
Date: 2007-06-03 21:08:40 -0600 (Sun, 03 Jun 2007)
New Revision: 5657
Added:
gnuradio/branches/features/ofdm/receiver/gnuradio-core/src/python/gnuradio/blksimpl/channel_model.py
Modified:
gnuradio/branches/features/ofdm/receiver/gnuradio-core/src/python/gnuradio/blksimpl/Makefile.am
Log:
adding channel model block for simulations
Modified:
gnuradio/branches/features/ofdm/receiver/gnuradio-core/src/python/gnuradio/blksimpl/Makefile.am
===================================================================
---
gnuradio/branches/features/ofdm/receiver/gnuradio-core/src/python/gnuradio/blksimpl/Makefile.am
2007-06-04 02:14:43 UTC (rev 5656)
+++
gnuradio/branches/features/ofdm/receiver/gnuradio-core/src/python/gnuradio/blksimpl/Makefile.am
2007-06-04 03:08:40 UTC (rev 5657)
@@ -29,6 +29,7 @@
grblkspython_PYTHON = \
__init__.py \
am_demod.py \
+ channel_model.py \
dbpsk.py \
dqpsk.py \
d8psk.py \
Added:
gnuradio/branches/features/ofdm/receiver/gnuradio-core/src/python/gnuradio/blksimpl/channel_model.py
===================================================================
---
gnuradio/branches/features/ofdm/receiver/gnuradio-core/src/python/gnuradio/blksimpl/channel_model.py
(rev 0)
+++
gnuradio/branches/features/ofdm/receiver/gnuradio-core/src/python/gnuradio/blksimpl/channel_model.py
2007-06-04 03:08:40 UTC (rev 5657)
@@ -0,0 +1,50 @@
+#!/usr/bin/env python
+#
+# Copyright 2007 Free Software Foundation, Inc.
+#
+# This file is part of GNU Radio
+#
+# GNU Radio is free software; you can redistribute it and/or modify
+# it under the terms of the GNU General Public License as published by
+# the Free Software Foundation; either version 2, or (at your option)
+# any later version.
+#
+# GNU Radio is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with GNU Radio; see the file COPYING. If not, write to
+# the Free Software Foundation, Inc., 51 Franklin Street,
+# Boston, MA 02110-1301, USA.
+#
+
+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]):
+ ''' 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
+ '''
+
+ 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)
+ 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)
[Prev in Thread] |
Current Thread |
[Next in Thread] |
- [Commit-gnuradio] r5657 - gnuradio/branches/features/ofdm/receiver/gnuradio-core/src/python/gnuradio/blksimpl,
trondeau <=