X-Git-Url: https://git.gag.com/?a=blobdiff_plain;f=gnuradio-core%2Fsrc%2Fpython%2Fgnuradio%2Fpacket_utils.py;h=1417c17fa5b1d731a70bd07571040b66b710d5ed;hb=9d45055a028d83b5614121cf2152af1ab7056d68;hp=f3552582e493159ba653483a6b52a68dec1675a2;hpb=28e086141aead2e43f958f0ae14d58cac557fa2d;p=debian%2Fgnuradio diff --git a/gnuradio-core/src/python/gnuradio/packet_utils.py b/gnuradio-core/src/python/gnuradio/packet_utils.py index f3552582..1417c17f 100644 --- a/gnuradio-core/src/python/gnuradio/packet_utils.py +++ b/gnuradio-core/src/python/gnuradio/packet_utils.py @@ -1,11 +1,11 @@ # -# Copyright 2005,2006 Free Software Foundation, Inc. +# Copyright 2005,2006,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 2, or (at your option) +# 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, @@ -20,7 +20,7 @@ # import struct -import Numeric +import numpy from gnuradio import gru @@ -87,7 +87,7 @@ def string_to_hex_list(s): def whiten(s, o): - sa = Numeric.fromstring(s, Numeric.UnsignedInt8) + sa = numpy.fromstring(s, numpy.uint8) z = sa ^ random_mask_vec8[o:len(sa)+o] return z.tostring() @@ -157,8 +157,10 @@ def _npadding_bytes(pkt_byte_len, samples_per_symbol, bits_per_symbol): is a multiple of 128 samples. @param ptk_byte_len: len in bytes of packet, not including padding. - @param samples_per_symbol: samples per bit (1 bit / symbolwith GMSK) + @param samples_per_symbol: samples per bit (1 bit / symbolwidth GMSK) @type samples_per_symbol: int + @param bits_per_symbol: bits per symbol (log2(modulation order)) + @type bits_per_symbol: int @returns number of bytes of padding to append. """ @@ -451,5 +453,5 @@ random_mask_tuple = ( 199, 113, 146, 164, 109, 187, 109, 179, 109, 181, 237, 183, 13, 182, 133, 182, 227, 54, 201, 214, 214, 222, 222, 216, 88, 90, 186, 187, 51, 51, 255, 63 ) -random_mask_vec8 = Numeric.array(random_mask_tuple, Numeric.UnsignedInt8) +random_mask_vec8 = numpy.array(random_mask_tuple, numpy.uint8)