commit-gnuradio
[Top][All Lists]
Advanced

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

[Commit-gnuradio] r4125 - gnuradio/branches/developers/n4hy/ofdm/gnuradi


From: matt
Subject: [Commit-gnuradio] r4125 - gnuradio/branches/developers/n4hy/ofdm/gnuradio-examples/python
Date: Sun, 17 Dec 2006 21:32:35 -0700 (MST)

Author: matt
Date: 2006-12-17 21:32:35 -0700 (Sun, 17 Dec 2006)
New Revision: 4125

Added:
   
gnuradio/branches/developers/n4hy/ofdm/gnuradio-examples/python/ofdm_receiver.py
Log:
adding hierarchical ofdm receiver


Added: 
gnuradio/branches/developers/n4hy/ofdm/gnuradio-examples/python/ofdm_receiver.py
===================================================================
--- 
gnuradio/branches/developers/n4hy/ofdm/gnuradio-examples/python/ofdm_receiver.py
                            (rev 0)
+++ 
gnuradio/branches/developers/n4hy/ofdm/gnuradio-examples/python/ofdm_receiver.py
    2006-12-18 04:32:35 UTC (rev 4125)
@@ -0,0 +1,93 @@
+#!/usr/bin/env python
+#
+# Copyright 2004,2005,2006 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
+from gnuradio import audio
+from gnuradio.eng_option import eng_option
+from optparse import OptionParser
+
+class ofdm_receiver(gr.hier_block2):
+    def __init__(self):
+        gr.hier_block2.__init__(self, 
+                               "ofdm_receiver", 
+                               gr.io_signature(1,1,gr.sizeof_gr_complex), 
+                               gr.io_signature(1,1,gr.sizeof_gr_complex))
+
+
+        # ML Sync
+
+        # Energy Detection from ML Sync
+
+        # Create a delay line
+        delayline = [0.0 for i in range(fftsize+1)]
+        delayline[fftsize] = 1.0
+        #self.delay = gr.fir_filter_ccf(1,delayline)
+        self.define_component("delay", gr.fir_filter_ccf (1, delayline))
+        
+        self.connect("self", "delay")
+
+        # magnitude squared blocks
+        self.magsqrd1 = gr.complex_to_mag_squared()
+        self.magsqrd2 = gr.complex_to_mag_squared()
+        self.adder = gr.add_ff()
+
+        moving_sum_taps = [rho/2 for i in range(cpsize)]
+        self.moving_sum_filter = gr.fir_filter_fff(1,moving_sum_taps)
+        
+        self.connect(self.self,self.magsqrd1)
+        self.connect(self.delay,self.magsqrd2)
+        self.connect(self.magsqrd1,(self.adder,0))
+        self.connect(self.magsqrd2,(self.adder,1))
+        self.connect(self.adder,self.moving_sum_filter)
+        
+
+        # Correlation from ML Sync
+        self.conjg = gr.conjugate_cc();
+        self.mixer = gr.multiply_cc();
+
+        movingsum2_taps = [1.0 for i in range(cpsize)]
+        self.movingsum2 = gr.fir_filter_ccf(1,movingsum2_taps)
+        
+
+        # Correlator data handler
+        self.c2mag = gr.complex_to_mag()
+        self.angle = gr.complex_to_arg()
+        self.scale = gr.multiply_const_ff(-1000.0/(2*math.pi))
+        self.connect(self.self,(self.mixer,1))
+        self.connect(self.delay,self.conjg,(self.mixer,0))
+        self.connect(self.mixer,self.movingsum2,self.c2mag)
+
+        # ML Sync output arg, need to find maximum point of this
+        self.diff = gr.sub_ff()
+        self.connect(self.c2mag,(self.diff,0))
+        self.connect(self.moving_sum_filter,(self.diff,1))
+
+        #ML measurements input to sampler block and detect
+        self.sampler = gr.ofdm_sampler(fftsize,symbol_length,1)
+
+        # Connect inputs to OFDM sampler:
+        #   1: stream to get downconverted to baseband
+        #   2: output of difference block (theta)
+        #   3: frequency error estimate (epsilon)
+        self.connect(self.self,(self.sampler,0))
+        self.connect(self.diff,self.f2c1,(self.sampler,1))
+        self.connect(self.angle,self.f2c2,(self.sampler,2))





reply via email to

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