diff options
author | Tim O'Shea | 2012-01-07 17:52:31 -0500 |
---|---|---|
committer | Tim O'Shea | 2012-06-06 17:51:43 -0400 |
commit | f2ab263b6fc9c24adc88fb55f2c210dd88e9345a (patch) | |
tree | 08355942d2c89a3666bbde95efd423fb37f2ec61 /gnuradio-core/src/python | |
parent | 0eeb87502d67c9e0522b6c7d703fbe8c3ca7a2d9 (diff) | |
download | gnuradio-f2ab263b6fc9c24adc88fb55f2c210dd88e9345a.tar.gz gnuradio-f2ab263b6fc9c24adc88fb55f2c210dd88e9345a.tar.bz2 gnuradio-f2ab263b6fc9c24adc88fb55f2c210dd88e9345a.zip |
Block Modifications:
digital.mpsk_receiver_cc: Set reasonable default parameter values for GRC definition
digital.ofdm_insert_preamble: Expose enter_preamble() as public, to allow external state changes
Cleanup of incorrect forecast behavior
Make the flag port optional, incase external preamble triggers are preferred to in-band
gr_vector_source: added set_data( data ) and rewind() public methods
gr_head: added set_length(int) method to modify head length
New Blocks Added:
gr_keep_m_in_n: Allows periodic extraction of M items instead of 1 (in keep_1_in_n)
gr_pack_k_bits: Complementary block fo gr_unpack_k_bits
gr_vector_insert_x: Complement to the gr_head block, inserts a vector into a stream then becomes a pass through
Diffstat (limited to 'gnuradio-core/src/python')
-rwxr-xr-x | gnuradio-core/src/python/gnuradio/gr/qa_vector_insert.py | 58 |
1 files changed, 58 insertions, 0 deletions
diff --git a/gnuradio-core/src/python/gnuradio/gr/qa_vector_insert.py b/gnuradio-core/src/python/gnuradio/gr/qa_vector_insert.py new file mode 100755 index 000000000..7ab8e701a --- /dev/null +++ b/gnuradio-core/src/python/gnuradio/gr/qa_vector_insert.py @@ -0,0 +1,58 @@ +#!/usr/bin/env python +# +# Copyright 2008,2010 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 gnuradio import gr, gr_unittest +import math + +class test_vector_insert(gr_unittest.TestCase): + + def setUp (self): + self.tb = gr.top_block () + + def tearDown (self): + self.tb = None + + def test_001(self): + src_data = [float(x) for x in range(16)] + expected_result = tuple(src_data) + + period = 9177; + offset = 0; + + src = gr.null_source(1) + head = gr.head(1, 10000000); + ins = gr.vector_insert_b([1], period, offset); + dst = gr.vector_sink_b() + + self.tb.connect(src, head, ins, dst) + self.tb.run() + result_data = dst.data() + + for i in range(10000): + if(i%period == offset): + self.assertEqual(1, result_data[i]) + else: + self.assertEqual(0, result_data[i]) + +if __name__ == '__main__': + gr_unittest.run(test_vector_insert, "test_vector_insert.xml") + |