summaryrefslogtreecommitdiff
path: root/gr-digital/python
diff options
context:
space:
mode:
Diffstat (limited to 'gr-digital/python')
-rw-r--r--gr-digital/python/CMakeLists.txt1
-rw-r--r--gr-digital/python/__init__.py1
-rw-r--r--gr-digital/python/fftshift.py31
-rwxr-xr-xgr-digital/python/qa_ofdm_sync_sc_cfb.py6
-rwxr-xr-xgr-digital/python/qa_scale_tags.py57
-rw-r--r--gr-digital/python/qa_ts_insert_zeros.py78
6 files changed, 2 insertions, 172 deletions
diff --git a/gr-digital/python/CMakeLists.txt b/gr-digital/python/CMakeLists.txt
index 4dfaac362a..7846345970 100644
--- a/gr-digital/python/CMakeLists.txt
+++ b/gr-digital/python/CMakeLists.txt
@@ -28,7 +28,6 @@ GR_PYTHON_INSTALL(
bpsk.py
cpm.py
crc.py
- fftshift.py
generic_mod_demod.py
gmsk.py
gfsk.py
diff --git a/gr-digital/python/__init__.py b/gr-digital/python/__init__.py
index 28b74261f7..6bbe8160e8 100644
--- a/gr-digital/python/__init__.py
+++ b/gr-digital/python/__init__.py
@@ -42,7 +42,6 @@ from ofdm_sync_fixed import *
from ofdm_sync_ml import *
from ofdm_sync_pnac import *
from ofdm_sync_pn import *
-from fftshift import fftshift, ifftshift
from ofdm_txrx import ofdm_tx, ofdm_rx
import packet_utils
diff --git a/gr-digital/python/fftshift.py b/gr-digital/python/fftshift.py
deleted file mode 100644
index c8c7c7f140..0000000000
--- a/gr-digital/python/fftshift.py
+++ /dev/null
@@ -1,31 +0,0 @@
-#
-# Copyright 2012 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.
-#
-
-# Aliases for fftpack.(i)fftshift()
-
-from scipy import fftpack
-
-def fftshift(x):
- return fftpack.fftshift(x)
-
-def ifftshift(x):
- return fftpack.ifftshift(x)
-
diff --git a/gr-digital/python/qa_ofdm_sync_sc_cfb.py b/gr-digital/python/qa_ofdm_sync_sc_cfb.py
index d8b5465564..8374595d62 100755
--- a/gr-digital/python/qa_ofdm_sync_sc_cfb.py
+++ b/gr-digital/python/qa_ofdm_sync_sc_cfb.py
@@ -174,10 +174,8 @@ Detection error was: %d """ % (numpy.sum(sink_detect.data()) - n_bursts)
#rate_out = 48000
#ratio = float(rate_out) / rate_in
#throttle1 = gr.throttle(gr.sizeof_gr_complex, rate_in)
- #insert_zeros = digital.ts_insert_zeros_cc(tagname)
- #throttle2 = gr.throttle(gr.sizeof_gr_complex, rate_out)
- #sink_countbursts = blocks.vector_sink_c()
- #head = blocks.head(gr.sizeof_gr_complex, int(total_length * ratio*2))
+ #sink_countbursts = gr.vector_sink_c()
+ #head = gr.head(gr.sizeof_gr_complex, int(total_length * ratio*2))
#add = gr.add_cc()
#sync = digital.ofdm_sync_sc_cfb(fft_len, cp_len)
#sink_freq = blocks.vector_sink_f()
diff --git a/gr-digital/python/qa_scale_tags.py b/gr-digital/python/qa_scale_tags.py
deleted file mode 100755
index 2008b0c3eb..0000000000
--- a/gr-digital/python/qa_scale_tags.py
+++ /dev/null
@@ -1,57 +0,0 @@
-#!/usr/bin/env python
-# Copyright 2012,2013 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.
-#
-
-import time
-import itertools
-
-from gnuradio import gr, gr_unittest
-try: import pmt
-except: from gruel import pmt
-import blocks_swig as blocks
-import digital_swig as digital
-from utils import tagged_streams
-
-class qa_scale_tags (gr_unittest.TestCase):
-
- def test_utils(self):
- packets = ((1, 2, 3), (4, 5, 6, 7, 8), (9, 10))
- tagname = "vector_length"
- data, tags = tagged_streams.packets_to_vectors(packets, tagname)
- new_packets = tagged_streams.vectors_to_packets(data, tags, tagname)
- for np, op in zip(new_packets, packets):
- for n, o in zip(np, op):
- self.assertEqual(n, o)
-
- def test_001_t (self):
- packets = ((1, 2, 3), (4, 5, 6, 7, 8), (9, 10))
- tagname = "packet_length"
- data, tags = tagged_streams.packets_to_vectors(packets, tagname)
- tb = gr.top_block()
- src = blocks.vector_source_b(data, False, 1, tags)
- tag_scaler = digital.scale_tags(1, tagname, 2)
- unpacker = blocks.packed_to_unpacked_bb(4, blocks.GR_MSB_FIRST)
- snk = blocks.vector_sink_b()
- tb.connect(src, unpacker, tag_scaler, snk)
- tb.run()
- packets = tagged_streams.vectors_to_packets(snk.data(), snk.tags(), tagname)
-
-if __name__ == '__main__':
- gr_unittest.run(qa_scale_tags, "qa_scale_tags.xml")
diff --git a/gr-digital/python/qa_ts_insert_zeros.py b/gr-digital/python/qa_ts_insert_zeros.py
deleted file mode 100644
index 2af6832cf5..0000000000
--- a/gr-digital/python/qa_ts_insert_zeros.py
+++ /dev/null
@@ -1,78 +0,0 @@
-#!/usr/bin/env python
-# Copyright 2012,2013 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.
-#
-
-import time
-import itertools
-
-from gnuradio import gr, gr_unittest
-try: import pmt
-except: from gruel import pmt
-import blocks_swig as blocks
-import digital_swig as digital
-from utils import tagged_streams
-
-class qa_ts_insert_zeros (gr_unittest.TestCase):
-
- def test_one(self):
- n_packets = 10
- packet_length = 1000
- packets = [[i]*packet_length for i in range(1, n_packets+1)]
- tagname = "packet_length"
- data, tags = tagged_streams.packets_to_vectors(packets, tagname)
- tb = gr.top_block()
- src = blocks.vector_source_c(data, False, 1, tags)
- rate_in = 16000
- rate_out = 48000
- ratio = float(rate_out) / rate_in
- throttle1 = blocks.throttle(gr.sizeof_gr_complex, rate_in)
- insert_zeros = digital.ts_insert_zeros_cc(tagname)
- throttle2 = blocks.throttle(gr.sizeof_gr_complex, rate_out)
- head = blocks.head(gr.sizeof_gr_complex, int(n_packets * packet_length * ratio*2))
- snk = blocks.vector_sink_c()
- tb.connect(src, throttle1, insert_zeros, throttle2, head, snk)
- tb.run()
- data = snk.data()
- state = 1
- pos = 0
- last_non_zero = 0
- for i, d in enumerate(data):
- if d != 0:
- last_non_zero = i
- if pos == 0:
- if (d == state):
- pos = pos + 1
- elif (d != 0):
- raise ValueError("Invalid")
- elif pos > 0:
- if (d != state):
- raise ValueError("Invalid")
- pos = pos + 1
- if pos == packet_length:
- state += 1
- pos = 0
- min_ratio = ratio-1
- max_ratio = ratio+1
- self.assertEqual(state-1, n_packets)
- self.assertTrue(last_non_zero > min_ratio*packet_length*n_packets)
- self.assertTrue(last_non_zero < max_ratio*packet_length*n_packets)
-
-if __name__ == '__main__':
- gr_unittest.run(qa_ts_insert_zeros, "qa_ts_insert_zeros.xml")