diff options
author | Martin Braun <martin.braun@kit.edu> | 2013-03-18 15:16:29 +0100 |
---|---|---|
committer | Martin Braun <martin.braun@kit.edu> | 2013-03-18 15:16:29 +0100 |
commit | 3dc8a421e97707dcd3fde09fb615a6da7fe47de5 (patch) | |
tree | f7e123dd3724d55a8741f2b61302b0d0c5254a15 /gr-digital/python | |
parent | 055a847a850ff03af48bfc18a80a00ad34735d8c (diff) |
digital: cleaned out debugging blocks
Diffstat (limited to 'gr-digital/python')
-rwxr-xr-x | gr-digital/python/qa_ofdm_sync_sc_cfb.py | 2 | ||||
-rwxr-xr-x | gr-digital/python/qa_scale_tags.py | 56 | ||||
-rw-r--r-- | gr-digital/python/qa_ts_insert_zeros.py | 77 |
3 files changed, 0 insertions, 135 deletions
diff --git a/gr-digital/python/qa_ofdm_sync_sc_cfb.py b/gr-digital/python/qa_ofdm_sync_sc_cfb.py index 36123509e9..bed8e9c3ae 100755 --- a/gr-digital/python/qa_ofdm_sync_sc_cfb.py +++ b/gr-digital/python/qa_ofdm_sync_sc_cfb.py @@ -170,8 +170,6 @@ 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 = gr.vector_sink_c() #head = gr.head(gr.sizeof_gr_complex, int(total_length * ratio*2)) #add = gr.add_cc() diff --git a/gr-digital/python/qa_scale_tags.py b/gr-digital/python/qa_scale_tags.py deleted file mode 100755 index 85903b27e1..0000000000 --- a/gr-digital/python/qa_scale_tags.py +++ /dev/null @@ -1,56 +0,0 @@ -#!/usr/bin/env python -# 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. -# - -import time -import itertools - -from gnuradio import gr, gr_unittest -try: import pmt -except: from gruel import pmt -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 = gr.vector_source_b(data, False, 1, tags) - tag_scaler = digital.scale_tags(1, tagname, 2) - unpacker = gr.packed_to_unpacked_bb(4, gr.GR_MSB_FIRST) - snk = gr.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 9e71e8df28..0000000000 --- a/gr-digital/python/qa_ts_insert_zeros.py +++ /dev/null @@ -1,77 +0,0 @@ -#!/usr/bin/env python -# 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. -# - -import time -import itertools - -from gnuradio import gr, gr_unittest -try: import pmt -except: from gruel import pmt -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 = gr.vector_source_c(data, False, 1, tags) - rate_in = 16000 - 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) - head = gr.head(gr.sizeof_gr_complex, int(n_packets * packet_length * ratio*2)) - snk = gr.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") |