summaryrefslogtreecommitdiff
path: root/gr-digital/python/digital/ofdm_sync_pnac.py
diff options
context:
space:
mode:
Diffstat (limited to 'gr-digital/python/digital/ofdm_sync_pnac.py')
-rw-r--r--gr-digital/python/digital/ofdm_sync_pnac.py31
1 files changed, 12 insertions, 19 deletions
diff --git a/gr-digital/python/digital/ofdm_sync_pnac.py b/gr-digital/python/digital/ofdm_sync_pnac.py
index 55a6c21f4c..4d756f7ff7 100644
--- a/gr-digital/python/digital/ofdm_sync_pnac.py
+++ b/gr-digital/python/digital/ofdm_sync_pnac.py
@@ -1,38 +1,31 @@
#!/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 3, 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 __future__ import division
+from __future__ import unicode_literals
-import math
-from numpy import fft
-from gnuradio import gr
-try:
- from gnuradio import filter
-except ImportError:
- import filter_swig as filter
+from gnuradio import gr, blocks, filter
-try:
- from gnuradio import blocks
-except ImportError:
- import blocks_swig as blocks
class ofdm_sync_pnac(gr.hier_block2):
def __init__(self, fft_length, cp_length, kstime, logging=False):
@@ -69,9 +62,9 @@ class ofdm_sync_pnac(gr.hier_block2):
kstime = [k.conjugate() for k in kstime[0:fft_length//2]]
kstime.reverse()
self.crosscorr_filter = filter.fir_filter_ccc(1, kstime)
-
+
# Create a delay line
- self.delay = blocks.delay(gr.sizeof_gr_complex, fft_length/2)
+ self.delay = blocks.delay(gr.sizeof_gr_complex, fft_length / 2)
# Correlation from ML Sync
self.conjg = blocks.conjugate_cc();
@@ -105,7 +98,7 @@ class ofdm_sync_pnac(gr.hier_block2):
self.connect(self.corr, self.c2mag)
self.connect(self.corr, self.angle)
self.connect(self.angle, (self.sample_and_hold,0))
-
+
# Get the power of the input signal to compare against the correlation
self.connect(self.crosscorr_filter, self.mag, self.power)