Exemplo n.º 1
0
Arquivo: qa_qam.py Projeto: UpYou/ofdm
    def qamtest (self, nbits):
        data = tuple(range(2**nbits))

        src = gr.vector_source_b(data)
        unpack = gr.unpack_k_bits_bb(nbits)
        enc = raw.qam_enc(nbits)
        dec = raw.qam_dec(nbits)
        tofloat = gr.uchar_to_float()
        slicer = gr.binary_slicer_fb()

        unpacked = gr.vector_sink_b()
        encoded = gr.vector_sink_c()
        decoded = gr.vector_sink_b()
        dst = gr.vector_sink_b()
        self.tb.connect(src,
                        unpack,
                        enc,
                        dec,
                        tofloat,
                        gr.add_const_ff(-128.0),
                        slicer,
                        dst)
        self.tb.connect(unpack, unpacked)
        self.tb.connect(enc, encoded)
        self.tb.connect(dec, decoded)
        self.tb.run()
        #print "data = ", data
        #print "unpacked = ", unpacked.data()
        #print "encoded = ", encoded.data()
        #print "decoded = ", decoded.data()
        #print "dst = ", dst.data()
        self.assertEqual(unpacked.data(), dst.data())
        pwr = sum([abs(x)**2 for x in encoded.data()]) / len(encoded.data())
        #print pwr
        self.assertAlmostEqual(1.0, pwr, 6)
Exemplo n.º 2
0
Arquivo: qa_dvb.py Projeto: EQ4/gr-dvb
	def derandomizer_pp_desync(self, offset):
		"""
		Tests the ability of the derandomiser to synchronise when the inverted SYNC is <offset> packets away
		Note: This method itself is not a unit test method.
		"""
		assert offset < 8

		useful_data = make_transport_stream()
		src = gr.vector_source_b(useful_data)
		pad = dvb_swig.pad_mpeg_ts_packet_bp()
		randomizer = dvb_swig.randomizer_pp()
		depad = dvb_swig.depad_mpeg_ts_packet_pb()
		dst = gr.vector_sink_b()
		self.tb.connect(src, pad, randomizer, depad, dst)
		self.tb.run()
		randomized_data = dst.data()

		src_data = make_fake_transport_stream_packet(offset)
		src_data.extend(randomized_data)

		self.tb = gr.top_block()
		src = gr.vector_source_b(src_data)
		pad = dvb_swig.pad_mpeg_ts_packet_bp()
		derandomizer = dvb_swig.derandomizer_pp()
		depad = dvb_swig.depad_mpeg_ts_packet_pb()
		dst = gr.vector_sink_b()

		self.tb.connect(src, pad, derandomizer, depad, dst)
		self.tb.run()
		result_data = dst.data()
		self.assertEqual(tuple(useful_data), result_data[-len(useful_data):])
    def test_deint_001 (self):
        lenx = 64
        src0 = gr.vector_source_b (range (lenx))
        op = gr.deinterleave (gr.sizeof_char,4)
        dst0 = gr.vector_sink_b ()
        dst1 = gr.vector_sink_b ()
        dst2 = gr.vector_sink_b ()
        dst3 = gr.vector_sink_b ()

        self.tb.connect (src0, op)
        op.connect(dst0,usesPortName="byte_out_0")
        op.connect(dst1,usesPortName="byte_out_1")
        op.connect(dst2,usesPortName="byte_out_2")
        op.connect(dst3,usesPortName="byte_out_3")
        self.tb.run ()

        expected_result0 = tuple (range (0, lenx, 4))
        expected_result1 = tuple (range (1, lenx, 4))
        expected_result2 = tuple (range (2, lenx, 4))
        expected_result3 = tuple (range (3, lenx, 4))

        self.assertFloatTuplesAlmostEqual (expected_result0, dst0.data())
        self.assertFloatTuplesAlmostEqual (expected_result1, dst1.data())
        self.assertFloatTuplesAlmostEqual (expected_result2, dst2.data ())
        self.assertFloatTuplesAlmostEqual (expected_result3, dst3.data ())
Exemplo n.º 4
0
    def scrambletest (self):
        length = 128
        count = 1024
        data = tuple([random.randint(0, 255) for i in range(count*length)])
        seed = tuple([random.randint(1, 127) for i in range(count)])

        src = gr.vector_source_b(data)
        seedsrc = gr.vector_source_i(seed)
        enc = raw.scrambler_bb(length, 0)
        dec = raw.scrambler_bb(length, 0)
        dst = gr.vector_sink_b()
        encoded = gr.vector_sink_b()
        self.tb.connect(src, enc, dec, dst)
        self.tb.connect(seedsrc, (enc,1))
        self.tb.connect(seedsrc, (dec,1))
        self.tb.connect(enc, encoded)
        self.tb.run()
        #print "data = ", data
        #print "unpacked = ", unpacked.data()
        #print "encoded = ", encoded.data()
        #print "decoded = ", decoded.data()
        #print "dst = ", dst.data()
        self.assertNotEqual(data, encoded.data())
        self.assertEqual(data, dst.data())
        self.assertEqual(data, dst.data())
Exemplo n.º 5
0
    def punctest(self, nc, np):
        length = 2046  # should be divisible by nc
        data = [random.randint(0, 255) for i in range(length)]
        # last K-1 bits are padding, meaning last byte is lost
        data[-1] = 0
        data = tuple(data)
        src = gr.vector_source_b(data)

        enc = raw.conv_enc()
        dec = raw.conv_dec(length * 8)

        punc = raw.conv_punc(nc, np)
        depunc = raw.conv_punc(np, nc, 128)

        tofloat = gr.uchar_to_float()
        offset = gr.multiply_const_ff(255.0)
        touchar = gr.float_to_uchar()

        dst = gr.vector_sink_b()
        rx = gr.vector_sink_b()
        self.tb.connect(src, enc, punc, tofloat, offset, touchar, depunc, dec, dst)
        self.tb.connect(punc, rx)
        self.tb.run()
        rxlen = len(rx.data())
        self.assertEqual(rxlen, (length * 8 * 2 * np) / nc)
        self.assertEqual(data, dst.data())
Exemplo n.º 6
0
	def __init__(self):
		gr.top_block.__init__(self, "Wmbus Phy2")

		##################################################
		# Variables
		##################################################
		self.frame = frame = [1,1]

		##################################################
		# Blocks
		##################################################
		self.gr_vector_source_x_0 = gr.vector_source_b((frame), False, 1)
		self.gr_vector_sink_x_1 = gr.vector_sink_b(1)
		self.gr_vector_sink_x_0 = gr.vector_sink_b(1)
		self.gr_unpacked_to_packed_xx_0 = gr.unpacked_to_packed_bb(4, gr.GR_MSB_FIRST)
		self.gr_pack_k_bits_bb_0 = gr.pack_k_bits_bb(6)
		self.digital_map_bb_1 = digital.map_bb(([0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1]))
		self.digital_map_bb_0 = digital.map_bb(([16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 3, 16, 1, 2, 16, 16, 16, 16, 7, 16, 16, 0, 16, 16, 5, 6, 16, 4, 16, 16, 16, 16, 16, 16, 11, 16, 9, 10, 16, 16, 15, 16, 16, 8, 16, 16, 16, 16, 13, 14, 16, 12, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16]))

		##################################################
		# Connections
		##################################################
		self.connect((self.gr_vector_source_x_0, 0), (self.gr_pack_k_bits_bb_0, 0))
		self.connect((self.gr_pack_k_bits_bb_0, 0), (self.digital_map_bb_0, 0))
		self.connect((self.digital_map_bb_0, 0), (self.gr_unpacked_to_packed_xx_0, 0))
		self.connect((self.gr_unpacked_to_packed_xx_0, 0), (self.gr_vector_sink_x_0, 0))
		self.connect((self.digital_map_bb_0, 0), (self.digital_map_bb_1, 0))
		self.connect((self.digital_map_bb_1, 0), (self.gr_vector_sink_x_1, 0))
Exemplo n.º 7
0
 def test_027c_fully_unconnected_output(self):
     tb = gr.top_block()
     hb = gr.hier_block2("block", gr.io_signature(1, 1, 1), gr.io_signature(1, 1, 1))
     hsrc = gr.vector_sink_b()
     hb.connect(hb, hsrc)  # wire input internally
     src = gr.vector_source_b([1])
     dst = gr.vector_sink_b()
     tb.connect(src, hb)  # hb's output is not connected internally or externally
     self.assertRaises(RuntimeError, lambda: tb.run())
Exemplo n.º 8
0
def main():
    tb = gr.top_block()
    # noise source
    n = mlse.randint_b(2)
    reshape_n = gr.stream_to_vector(1, 58*2)
    tb.connect(n,reshape_n)
    # limit experiment length
    head=gr.head(58*2,1)
    tb.connect(reshape_n, head)
    
    # modulate
    gsm_burstmod = gsm.gsm_modulate_burst()
    tb.connect(head, gsm_burstmod)
    random_tsc_index = mlse.randint_b(8);
    tb.connect(random_tsc_index, (gsm_burstmod,1))

    # apply channel
    channel = gsm.my_channel(-100,[0.2,1,0.2])
    channel_apply = gsm.apply_channel_to_vect(148, channel, 1)
    tb.connect(gsm_burstmod, channel_apply)

    # derotate
    derot = mlse.derotate_cc(148,4,-1) #FIXME: why -1? (not as if it matters)
    tb.connect(channel_apply, derot)

    modsink = gr.vector_sink_c(148)
    datasink = gr.vector_sink_b(58*2)
    tb.connect(derot, modsink)
    tb.connect(head, datasink)


    # mlse-decode
    decode = mlse.equalizer_midamble_vcb(mlse.make_packet_config_gsm())
    tb.connect(derot,decode)
    tb.connect(random_tsc_index, (decode,1))

    # ber
    ber = mlse.ber_vbi(58*2)
    tb.connect(decode, ber)
    tb.connect(head, (ber,1))

    result_sink = gr.vector_sink_b(58*2)
    tb.connect(decode, result_sink)

    chanest_sink = gr.vector_sink_c(7)
    tb.connect((decode,1), chanest_sink)

    tb.run()
    tb.run()
    d=modsink.data()
#    printvect_c(d)
    print ber.bit_error_rate()
    print_bitvect( datasink.data())
    print_bitvect( result_sink.data())
    import operator
    print_bitvect( map(operator.xor, datasink.data(), result_sink.data()))
    printvect_c( chanest_sink.data())
Exemplo n.º 9
0
 def setUp (self):
     self.tb = gr.top_block ()
   
     self.src = gr.vector_source_f([0]*120, False, 120)
     self.bch = lte.decode_bch_vfvb()
     self.snk0 = gr.vector_sink_b(24)
     self.snk1 = gr.vector_sink_b(1)
     
     self.tb.connect(self.src, self.bch)
     self.tb.connect((self.bch, 0), self.snk0)
     self.tb.connect((self.bch, 1), self.snk1)
 def setUp (self):
     self.tb = gr.top_block ()
     self.src = gr.vector_source_b((1,2,3,4,5,6,7,8,9), 1, 9)
     self.demux = drm.partitioning_vbvb(9, (2,3,4))
     self.head = gr.head(9,2)
     self.snk1 = gr.vector_sink_b(2)
     self.snk2 = gr.vector_sink_b(3)
     self.snk3 = gr.vector_sink_b(4)
     
     self.tb.connect(self.src, self.head, self.demux)
     self.tb.connect((self.demux,0), self.snk1)
     self.tb.connect((self.demux,1), self.snk2)
     self.tb.connect((self.demux,2), self.snk3)
Exemplo n.º 11
0
    def helper(self, v0, v1, fft_length, preamble):
        tb = self.tb
        src0 = gr.vector_source_c(v0)
        src1 = gr.vector_source_b(v1)

        s2v = gr.stream_to_vector(gr.sizeof_gr_complex, fft_length)

        # print "len(v) = %d" % (len(v))

        op = gr.ofdm_insert_preamble(fft_length, preamble)

        v2s = gr.vector_to_stream(gr.sizeof_gr_complex, fft_length)
        dst0 = gr.vector_sink_c()
        dst1 = gr.vector_sink_b()

        tb.connect(src0, s2v, (op, 0))
        tb.connect(src1, (op, 1))
        tb.connect((op, 0), v2s, dst0)
        tb.connect((op, 1), dst1)

        tb.run()
        r0 = dst0.data()
        r0v = []
        for i in range(len(r0) // fft_length):
            r0v.append(r0[i * fft_length:(i + 1) * fft_length])

        r1 = dst1.data()
        self.assertEqual(len(r0v), len(r1))
        return (r1, r0v)
Exemplo n.º 12
0
    def test_int_001 (self):
        lenx = 64
        src0 = range (0, lenx, 4)
        src1 = range (1, lenx, 4)
        src2 = range (2, lenx, 4)
        src3 = range (3, lenx, 4)
        a = sb.DataSource(dataFormat="octet")
        b = sb.DataSource(dataFormat="octet")
        c = sb.DataSource(dataFormat="octet")
        d = sb.DataSource(dataFormat="octet")
        op = gr.interleave (gr.sizeof_char, 4)
        dst = gr.vector_sink_b ()
        a.connect(op, providesPortName="byte_in_0")
        b.connect(op, providesPortName="byte_in_1")
        c.connect(op, providesPortName="byte_in_2")
        d.connect(op, providesPortName="byte_in_3")
        a.push(src0,EOS=True)
        b.push(src1,EOS=True)
        c.push(src2,EOS=True)
        d.push(src3,EOS=True)
        self.tb.connect (op, dst)
        self.tb.run ()
        expected_result = tuple (range (lenx))
        result_data = dst.data ()

        self.assertFloatTuplesAlmostEqual (expected_result, result_data)
Exemplo n.º 13
0
    def test_002null_symbol_resample_bb(self):
        #################################
        # Testsequenz generieren
        src_data_0 = (1, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 1, 0, 0, 0)

        ################################
        # Ergebnis generieren
        exp_resu_0 = (1, 0, 1, 0, 1, 0)

        #################################

        # Objekte erzeugen
        src_0 = gr.vector_source_b(src_data_0)
        throttle_0 = gr.throttle(gr.sizeof_char * 1, 320000)
        null_symbol_resample = howto_swig.null_symbol_resample_bb(
            3)  #Blockgroesse=3, Guardtime = 1, Blockanzahl=2, Offset=1
        dst_0 = gr.vector_sink_b()

        # Objekte verbinden
        self.tb.connect(src_0, throttle_0, (null_symbol_resample, 0))
        self.tb.connect((null_symbol_resample, 0), dst_0)

        # Simulationsstart
        self.tb.run()

        # Ergebnis auswerten
        result_data0 = dst_0.data()
        self.assertEqual(exp_resu_0, result_data0)
Exemplo n.º 14
0
    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);
        length = 100000
        src = sb.DataSource()
        head = gr.head_gnu(1, length)
        ins = gr.vector_insert_b([1], period, offset)
        dst = gr.vector_sink_b()

        self.tb.connect(src, head, ins, dst)
        self.tb.run()

        src_data = [0 for i in range(length)]
        src.push(src_data, EOS=True)

        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])
Exemplo n.º 15
0
    def test_int_001(self):
        lenx = 64
        src0 = range(0, lenx, 4)
        src1 = range(1, lenx, 4)
        src2 = range(2, lenx, 4)
        src3 = range(3, lenx, 4)
        a = sb.DataSource(dataFormat="octet")
        b = sb.DataSource(dataFormat="octet")
        c = sb.DataSource(dataFormat="octet")
        d = sb.DataSource(dataFormat="octet")
        op = gr.interleave(gr.sizeof_char, 4)
        dst = gr.vector_sink_b()
        a.connect(op, providesPortName="byte_in_0")
        b.connect(op, providesPortName="byte_in_1")
        c.connect(op, providesPortName="byte_in_2")
        d.connect(op, providesPortName="byte_in_3")
        a.push(src0, EOS=True)
        b.push(src1, EOS=True)
        c.push(src2, EOS=True)
        d.push(src3, EOS=True)
        self.tb.connect(op, dst)
        self.tb.run()
        expected_result = tuple(range(lenx))
        result_data = dst.data()

        self.assertFloatTuplesAlmostEqual(expected_result, result_data)
Exemplo n.º 16
0
    def test_001_enc(self):
        length = 2048  # DANGER: this fails for > 2048 for some reason
        data = [random.randint(0, 255) for i in range(length)]
        # last K-1 bits are padding, meaning last byte is lost
        data[-1] = 0
        data = tuple(data)
        src = gr.vector_source_b(data)
        enc = raw.conv_enc()
        tofloat = gr.uchar_to_float()
        offset = gr.multiply_const_ff(255.0)
        touchar = gr.float_to_uchar()
        dec = raw.conv_dec(length * 8)
        dst = gr.vector_sink_b()
        self.tb.connect(src, enc, tofloat, offset, touchar, dec, dst)

        self.tb.run()
        #self.assertEqual (data, dst.data())
        nerrors = 0
        i = 0
        for (a, b) in itertools.izip(data, dst.data()):
            nerr = bitCount(a ^ b)
            if nerr:
                print "%g " % (i / 2048.), nerr
            nerrors += nerr
            i += 1
        print "Number or Errors %d BER %g" % (nerrors,
                                              (nerrors * 1.0 / (length * 8)))
        self.assertEqual(nerrors, 0)
 def test_001_ofdm_coarse_frequency_correct(self):
     src_data0 = [
         0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 1, 2, 0, 5, 7, 6, 0, 4, 0, 6, 1, 1,
         1, 0.8, 0.1, 1.3, 1, 0.7, 1, 1, 0, 1, 2, 3, 4, 5, 6, 7, 8, 9
     ]
     expected_result0 = [7, 9, 5, 6, 0.8, 1.3, 3, 5]
     expected_result0 = [complex(x) for x in expected_result0]
     src_data1 = [1, 1, 1, 0]
     expected_result1 = (1, 1, 1, 0)
     src0 = gr.vector_source_c(src_data0)
     src1 = gr.vector_source_b(src_data1)
     s2v0 = gr.stream_to_vector(gr.sizeof_gr_complex, 10)
     ofdm_coarse_frequency_correct = dab_swig.ofdm_coarse_frequency_correct(
         10, 2)
     v2s0 = gr.vector_to_stream(gr.sizeof_gr_complex, 2)
     dst0 = gr.vector_sink_c()
     dst1 = gr.vector_sink_b()
     self.tb.connect(src0, s2v0, (ofdm_coarse_frequency_correct, 0))
     self.tb.connect(src1, (ofdm_coarse_frequency_correct, 1))
     self.tb.connect((ofdm_coarse_frequency_correct, 0), v2s0, dst0)
     self.tb.connect((ofdm_coarse_frequency_correct, 1), dst1)
     self.tb.run()
     result_data0 = dst0.data()
     result_data1 = dst1.data()
     # print expected_result0
     # print result_data0
     self.assertComplexTuplesAlmostEqual(expected_result0, result_data0, 6)
     self.assertEqual(result_data1, expected_result1)
Exemplo n.º 18
0
 def test_011_viterbi_test (self):
     #################################
     # Matlab Viterbi Testsequenz
     src_data_0 = (6.10,7.11,14.37,0.00,18.13,3.16,12.13,0.00,10.83,21.49,19.65,0.00,24.97,13.57,11.37,0.00,0.61,7.21,23.30,0.00,19.04,20.74,10.53,0.00,-3.65,-12.64,-26.67,0.00,10.62,-4.62,-14.32,0.00,10.05,10.80,-3.46,0.00,-13.44,5.20,-3.91,0.00,16.34,8.40,16.89,0.00,-1.75,-11.33,7.98,0.00,-6.68,6.79,4.78,0.00,14.16,14.18,6.76,0.00,16.59,-17.25,0.88,0.00,-10.88,-5.10,5.58,0.00,24.01,-13.35,10.51,0.00,11.26,-8.15,-5.66,0.00,-18.93,-3.86,13.61,0.00,-6.00,-13.72,7.79,0.00,10.92,13.47,10.58,0.00,13.48,-19.71,-14.66,0.00,-9.00,-3.13,-14.41,0.00,19.08,13.96,2.32,0.00,-12.29,-14.80,7.14,0.00,-10.17,11.90,12.99,0.00,-17.15,-15.61,14.06,0.00,-4.01,-29.32,10.65,0.00,-1.95,-5.50,-20.98,0.00,6.02,3.05,1.87,0.00,-7.55,-8.47,11.30,0.00,8.71,-1.94,3.38,0.00,2.87,-8.22,20.77,0.00,-11.54,-28.61,-8.87,0.00,-2.04,8.53,-4.38,0.00,17.10,-9.31,24.04,0.00,-11.07,-6.60,9.39,0.00,2.41,-1.03,-7.61,0.00,6.66,-4.19,12.54,0.00,-1.62,16.44,-9.85,0.00,-35.20,8.52,22.23,0.00,-5.33,20.10,-5.98,0.00,14.11,0.61,1.56,0.00,-8.76,-12.88,8.13,0.00,1.09,-19.52,15.89,0.00,20.90,-20.31,-15.97,0.00,-11.83,-12.27,-0.53,0.00,12.26,18.42,-11.01,0.00,-15.33,-7.92,-8.68,0.00,-10.56,-4.28,-3.37,0.00,-4.08,20.17,18.25,0.00,-22.93,10.72,16.22,0.00,23.35,21.93,3.91,0.00,-15.13,9.69,6.14,0.00,-7.97,13.64,3.36,0.00,17.49,2.76,8.93,0.00,-1.04,1.52,6.09,0.00,-9.85,20.94,14.51,0.00,30.77,2.21,14.93,0.00,1.65,-11.99,-10.15,0.00,-6.84,-7.58,-14.90,0.00,15.78,3.11,-4.94,0.00,10.68,25.81,-15.91,0.00,-2.15,15.15,5.80,0.00,-5.79,-16.44,13.01,0.00,8.91,7.15,7.54,0.00,15.27,-8.36,-9.58,0.00,-13.68,-4.94,10.56,0.00,-0.51,-7.36,-8.21,0.00,9.69,6.69,-10.96,0.00,5.83,10.17,4.06,0.00,22.13,-3.77,7.71,0.00,-5.97,-11.88,18.97,0.00,-6.80,15.29,20.14,0.00,-22.25,-4.53,-25.46,0.00,4.04,7.63,9.11,0.00,31.27,11.59,15.90,0.00,-14.39,-16.64,-7.78,0.00,17.13,-12.89,-7.93,0.00,-1.35,-26.56,11.43,0.00,-8.34,-13.67,7.63,0.00,14.59,5.34,-9.26,0.00,11.09,-10.86,-7.98,0.00,-3.41,18.91,8.10,0.00,4.80,0.85,-9.15,0.00,15.15,-15.19,10.12,0.00,2.81,-9.31,-0.66,0.00,2.39,3.08,10.51,0.00,9.41,-7.17,24.47,0.00,-10.28,-14.54,5.16,0.00,-23.50,13.94,-4.41,0.00,-11.50,-12.98,-11.52,0.00,7.96,-2.81,-8.01,0.00,-12.00,-0.85,9.06,0.00,-15.33,-6.42,-9.17,0.00,-20.85,-16.52,10.77,0.00,9.60,-20.00,-5.21,0.00,-13.22,1.68,15.86,0.00,1.24,22.38,9.85,0.00,9.24,-11.78,11.57,0.00,22.88,4.69,1.87,0.00,-1.52,-1.23,13.71,0.00,-10.35,28.43,-3.10,0.00,6.26,3.16,0.70,0.00,10.48,23.87,-15.81,0.00,12.97,15.49,16.29,0.00,14.15,-7.14,13.82,0.00,-2.81,-21.34,3.35,0.00,-4.55,3.14,6.03,0.00,-8.68,-36.42,-9.37,0.00,1.43,3.50,8.11,0.00,-2.87,-12.40,-4.15,0.00,-12.57,4.36,25.12,0.00,-7.36,17.17,-6.14,0.00,11.76,13.23,9.07,0.00,8.15,11.87,21.04,0.00,-9.05,-10.14,8.17,0.00,-3.56,10.56,-16.68,0.00,1.40,13.47,-16.17,0.00,11.59,3.32,-7.21,0.00,7.50,-12.02,-10.73,0.00,-22.25,10.72,9.96,0.00,-11.81,-2.41,8.60,0.00,17.73,10.29,-18.72,0.00,-9.52,8.01,-11.69,0.00,-2.50,-3.66,2.20,0.00,3.08,-21.95,-12.21,0.00,10.79,-26.07,8.52,0.00,-6.39,8.58,-14.17,0.00,8.98,-1.47,-1.91,0.00,-17.36,-6.53,3.86,0.00,-8.98,-18.15,4.99,0.00,-14.42,-19.02,-3.08,0.00,8.92,3.30,17.09,0.00,35.91,4.14,-7.48,0.00,-9.46,-9.49,0.65,0.00,-13.60,-12.13,-13.08,0.00,-14.48,-9.42,-11.51,0.00,-15.75,5.79,-8.93,0.00,-21.91,3.75,7.55,0.00,-26.59,4.90,5.46,0.00,-21.95,-2.00,15.01,0.00,1.95,8.13,-7.75,0.00,15.40,-3.06,0.28,0.00,-12.07,19.42,-16.81,0.00,7.35,-11.43,5.85,0.00,2.88,8.45,10.39,0.00,-14.39,-11.50,3.49,0.00,-8.89,8.83,4.91,0.00,14.71,2.32,14.16,0.00,9.87,-12.13,1.55,0.00,-15.27,-15.73,4.59,0.00,-13.15,8.11,-5.06,0.00,6.89,22.04,11.72,0.00,-21.54,-18.02,-8.12,0.00,-9.41,6.84,8.30,0.00,21.41,-7.08,-9.33,0.00,8.34,-9.89,-7.27,0.00,13.36,-5.71,18.51,0.00,10.31,-9.40,11.60,0.00,34.06,4.22,-18.35,0.00,-17.65,-18.96,-6.60,0.00,-9.40,-12.03,-2.93,0.00,8.54,-9.98,11.84,0.00,6.00,13.27,15.54,0.00,5.04,7.77,-1.80,0.00,2.07,15.19,-4.99,0.00,-12.38,8.71,-10.13,0.00,-7.99,-3.48,9.71,0.00,6.36,-6.29,-20.77,0.00,11.50,-7.51,6.06,0.00,-10.82,2.35,-5.31,0.00,-9.59,21.47,12.62,0.00,13.47,-8.04,15.76,0.00,-11.90,1.76,14.60,0.00,23.80,-16.77,-19.82,0.00,-8.35,6.00,-18.57,0.00,-13.57,-17.68,-19.84,0.00,10.00,-7.87,-9.05,0.00,12.58,6.23,17.57,0.00,-15.58,25.38,15.68,0.00,-3.96,15.09,7.94,0.00,-26.06,-7.72,-12.39,0.00,-6.65,-9.62,-10.31,0.00,12.46,-11.70,2.49,0.00,-11.44,-10.44,6.96,0.00,15.49,-14.99,12.62,0.00,6.91,-15.06,-9.04,0.00,-2.55,-13.63,10.27,0.00,27.95,3.21,-1.62,0.00,-15.52,11.13,4.41,0.00,11.22,7.92,-13.12,0.00,8.28,-6.33,-10.94,0.00,17.73,-5.05,10.03,0.00,-17.31,2.50,26.21,0.00,9.12,-20.21,-11.16,0.00,-12.77,16.14,-17.18,0.00,12.48,2.02,4.44,0.00,9.77,10.63,16.32,0.00,13.49,7.65,-1.75,0.00,-9.34,-1.29,21.86,0.00,26.00,1.23,23.37,0.00,-18.51,11.90,13.84,0.00,5.51,-18.28,-9.38,0.00,17.79,-8.54,14.96,0.00,-8.97,12.81,-7.70,0.00,-3.43,6.51,-7.64,0.00,-11.28,11.94,-11.32,0.00,21.17,-17.99,-4.99,0.00,6.19,6.62,14.13,0.00,-18.00,20.57,-7.63,0.00,8.34,-8.13,8.03,0.00,13.48,10.22,8.81,0.00,-4.21,-12.28,-10.53,0.00,7.31,-6.89,-16.45,0.00,-7.01,-11.17,-7.34,0.00,-9.81,-12.33,6.40,0.00,-9.98,12.96,-2.37,0.00,8.89,11.78,-2.87,0.00,23.69,9.57,-3.80,0.00,-4.11,21.25,9.48,0.00,7.04,13.89,1.87,0.00,-24.54,7.15,7.67,0.00,7.65,-11.11,3.47,0.00,10.42,-9.91,-1.98,0.00,-14.40,-1.61,20.83,0.00,20.47,10.08,31.24,0.00,-6.38,11.93,7.53,0.00,-13.44,4.55,-24.33,0.00,-8.88,-13.83,19.32,0.00,-16.57,6.90,4.06,0.00,-6.37,-25.32,-3.93,0.00,0.80,24.23,11.69,0.00,11.35,12.33,14.84,0.00,-4.95,-32.65,-8.25,0.00,9.27,-8.83,-5.68,0.00,-12.40,-9.31,11.87,0.00,14.25,14.49,-13.79,0.00,-13.85,12.86,-13.49,0.00,17.06,3.79,-8.20,0.00,-3.45,-6.10,-5.95,0.00,-13.15,-10.06,-10.93,0.00,18.64,-8.79,10.67,0.00,-5.09,-5.43,-0.23,0.00,13.75,-26.29,10.48,0.00,30.32,4.71,4.24,0.00,17.36,7.74,10.56,0.00,-1.94,-13.34,23.24,0.00,-0.74,18.54,-3.37,0.00,14.65,13.51,-14.69,0.00,-14.38,-15.24,10.92,0.00,-10.33,-8.51,-12.22,0.00,-24.09,-0.45,28.45,0.00,-13.65,17.67,-13.14,0.00,19.70,0.76,2.01,0.00,20.39,11.03,-7.79,0.00,-19.49,-21.86,-15.03,0.00,-8.97,-19.89,15.99,0.00,1.13,-30.56,-2.11,0.00,-2.07,3.48,11.71,0.00,-8.65,-1.82,-13.44,0.00,2.04,5.78,-13.08,0.00,11.85,5.93,-16.99,0.00,-28.90,9.54,23.02,0.00,-20.76,-14.48,5.51,0.00,5.52,4.91,14.65,0.00,-13.76,19.55,11.71,0.00,14.91,-22.55,2.56,0.00,-13.51,4.61,-22.87,0.00,-7.15,14.54,-3.19,0.00,13.92,-16.96,2.75,0.00,-3.61,-10.43,-16.55,0.00,5.06,-16.05,10.29,0.00,19.66,13.49,-8.63,0.00,15.30,12.81,13.74,0.00,3.97,-9.38,11.11,0.00,-18.28,-8.55,-8.49,0.00,-7.80,10.93,25.23,0.00,17.52,-18.41,-15.40,0.00,8.15,-21.36,17.28,0.00,-5.12,17.34,-12.89,0.00,-6.52,11.69,-28.40,0.00,-13.48,11.34,-21.74,0.00,13.18,-6.54,-17.74,0.00,5.54,30.61,5.47,0.00,15.93,-13.61,15.29,0.00,16.14,10.96,-8.18,0.00,-7.52,-4.84,13.06,0.00,17.46,10.65,-12.91,0.00,-8.62,13.11,-18.42,0.00,-22.99,-14.10,-10.73,0.00,-14.76,14.18,5.68,0.00,-6.13,13.16,-21.40,0.00,22.83,30.46,-3.56,0.00,-19.41,-13.17,-8.98,0.00,-11.71,-14.57,1.83,0.00,10.11,-25.61,16.48,0.00,-16.77,6.68,8.12,0.00,-23.66,8.51,13.06,0.00,26.88,15.51,4.13,0.00,9.10,-8.13,3.50,0.00,-7.77,-4.78,-6.69,0.00,-1.75,12.73,-11.83,0.00,12.28,-4.31,-26.17,0.00,-6.01,-12.84,17.11,0.00,5.64,26.76,14.41,0.00,12.90,-7.61,-9.63,0.00,13.24,10.44,-9.54,0.00,3.05,-5.53,-9.78,0.00,-5.76,8.89,14.20,0.00,-13.00,-14.11,-12.57,0.00,-5.28,-7.83,2.20,0.00,18.67,-11.70,7.02,0.00,-5.49,4.24,-17.36,0.00,-5.49,13.32,8.33,0.00,-10.86,9.50,8.33,0.00,-23.80,-17.43,-24.04,0.00,6.33,2.71,-3.97,0.00,7.55,11.74,-5.99,0.00,1.52,-15.62,-10.18,0.00,23.80,-5.64,15.31,0.00,-10.41,7.86,-1.33,0.00,-16.93,10.24,11.83,0.00,-16.11,15.05,-8.87,0.00,-5.06,-9.78,-32.81,0.00,-13.95,18.20,-8.33,0.00,-3.70,26.07,5.79,0.00,-2.39,19.30,-2.49,0.00,-3.78,-12.75,8.33,0.00,-15.44,11.57,-3.77,0.00,17.69,17.87,1.05,0.00,8.85,19.30,7.07,0.00,10.67,15.18,1.80,0.00,10.45,10.32,-10.76,0.00,17.16,4.43,17.66,0.00,-17.79,7.82,10.82,0.00,-19.37,13.70,-7.73,0.00,-8.58,-17.83,8.39,0.00,-12.27,12.98,5.72,0.00,20.93,17.90,7.82,0.00,-4.49,16.71,22.01,0.00,-6.07,3.20,-25.23,0.00,-20.65,-11.66,-3.48,0.00,-14.34,15.00,8.62,0.00,-21.27,16.29,8.49,0.00,22.34,24.45,-5.74,0.00,23.68,-7.32,-5.75,0.00,7.23,-10.39,-1.27,0.00,-0.67,1.55,3.91,0.00,12.17,10.17,18.50,0.00,-25.41,8.83,2.71,0.00,-15.53,5.40,5.46,0.00,-13.52,-13.86,-1.48,0.00,8.01,5.63,3.91,0.00,2.02,5.85,-5.33,0.00,-9.42,-12.67,-15.61,0.00,-14.33,-13.10,-7.68,0.00,2.81,-5.52,-12.57,0.00,9.22,18.92,13.12,0.00,-2.78,6.04,-9.31,0.00,17.56,-6.76,-11.39,0.00,11.49,7.68,9.73,0.00,8.27,-2.46,-6.43,0.00,1.80,19.12,-7.74,0.00,17.85,-17.11,11.51,0.00,-28.43,22.83,19.88,0.00,9.44,-6.70,-11.09,0.00,9.33,-19.32,-14.48,0.00,-23.05,10.32,26.66,0.00,9.71,11.75,-1.88,0.00,-10.19,5.44,18.02,0.00,7.72,13.54,10.42,0.00,2.72,-0.99,6.43,0.00,-4.85,-13.87,17.20,0.00,-13.54,13.48,-8.38,0.00,-9.87,-12.94,-22.09,0.00,11.85,-7.90,-1.60,0.00,-13.80,-23.10,12.48,0.00,-13.46,-7.88,-15.08,0.00,18.30,16.13,-18.17,0.00,-17.26,-1.09,-11.89,0.00,1.46,9.64,-8.66,0.00,12.53,3.12,11.93,0.00,14.62,-16.32,9.55,0.00,-14.04,-8.31,7.96,0.00,-14.39,9.22,9.54,0.00,-4.51,-5.79,-7.73,0.00,-11.53,-20.21,-8.32,0.00,1.49,-18.82,-1.47,0.00,4.11,17.75,-5.36,0.00,-6.44,10.37,-8.19,0.00,-10.20,-8.03,-6.37,0.00,-6.24,24.71,-3.66,0.00,-19.48,8.92,-16.02,0.00,-14.16,4.73,-19.98,0.00,10.24,-26.82,6.63,0.00,7.70,19.07,18.71,0.00,-10.86,-6.19,7.19,0.00,-7.83,4.01,2.37,0.00,4.99,10.69,16.30,0.00,-15.84,11.49,-25.02,0.00,-6.20,5.67,-16.26,0.00,1.11,-17.37,-5.38,0.00,12.19,6.59,-5.62,0.00,17.63,-15.32,2.32,0.00,-16.77,17.96,-1.53,0.00,9.30,-25.69,-22.52,0.00,-6.86,-1.58,-14.29,0.00,16.40,14.41,-2.16,0.00,-16.45,-17.25,-8.70,0.00,4.84,9.10,3.70,0.00,11.70,2.06,17.39,0.00,-5.55,-9.47,24.06,0.00,11.01,-7.12,-11.37,0.00,30.69,-8.31,7.38,0.00,2.16,-18.69,-14.38,0.00,-18.77,-11.41,-5.69,0.00,-5.02,-14.92,-28.45,0.00,-9.71,18.46,13.26,0.00,12.50,-11.56,11.81,0.00,4.52,-25.81,-1.44,0.00,15.98,17.61,-18.62,0.00,-9.76,6.79,25.02,0.00,-16.03,-8.58,13.47,0.00,6.24,14.82,-8.35,0.00,-15.16,24.51,6.62,0.00,-19.18,-13.57,2.16,0.00,9.95,7.32,1.67,0.00,-10.79,2.66,12.88,0.00,18.37,-8.19,2.10,0.00,-5.73,4.17,-15.85,0.00,1.88,-9.78,10.55,0.00,-23.09,-3.02,23.95,0.00,-11.18,6.55,-4.31,0.00,-16.39,-5.53,5.49,0.00,27.61,-13.95,-4.54,0.00,6.55,-12.33,22.44,0.00,12.84,-21.55,2.40,0.00,-9.85,-7.53,-9.16,0.00,16.50,-8.83,-9.94,0.00,3.73,3.37,-16.67,0.00,-9.53,7.32,16.32,0.00,-2.47,-7.89,-8.31,0.00,9.22,2.84,-10.16,0.00,15.58,10.75,14.53,0.00,4.32,-8.59,-8.31,0.00,-10.73,-5.90,22.67,0.00,14.32,22.38,10.25,0.00,18.39,-6.48,31.19,0.00,17.43,17.67,-20.44,0.00,-1.65,-8.23,-10.75,0.00,11.35,2.57,-17.09,0.00,16.36,2.75,-10.67,0.00,5.67,-6.76,14.17,0.00,11.78,-15.56,4.52,0.00,5.96,10.43,-14.99,0.00,24.61,28.53,-2.20,0.00,12.10,-10.41,-19.30,0.00,9.57,-12.32,-7.89,0.00,-19.11,5.29,-3.79,0.00,14.62,6.88,5.36,0.00,20.50,10.02,10.31,0.00,12.78,19.15,-3.10,0.00,8.53,12.14,-17.27,0.00,-1.77,10.68,7.29,0.00,13.45,15.14,-3.69,0.00,7.09,-13.15,-12.66,0.00,1.93,-6.89,12.26,0.00,-8.52,3.06,9.30,0.00,-20.46,8.65,1.64,0.00,4.10,2.79,-13.45,0.00,10.81,-15.56,7.23,0.00,12.87,-4.32,-12.42,0.00,12.35,10.06,1.91,0.00,-12.72,10.33,-18.24,0.00,14.37,-4.13,6.63,0.00,6.41,7.20,9.24,0.00,-12.28,-13.51,-0.78,0.00,-13.66,3.46,18.94,0.00,-1.36,8.50,10.91,0.00,4.43,4.28,13.15,0.00,6.99,-15.77,-5.60,0.00,-12.18,-12.90,-29.96,0.00,16.91,12.84,-10.45,0.00,-12.29,-27.03,1.79,0.00,10.47,4.81,2.26,0.00,-11.97,10.77,9.83,0.00,9.76,-10.20,-2.55,0.00,-2.12,5.66,-19.44,0.00,-5.90,-10.81,10.31,0.00,21.10,-11.10,-0.90,0.00,17.57,-12.43,-27.74,0.00,1.61,-4.58,4.28,0.00,8.80,-20.42,-12.06,0.00,-20.39,-1.43,5.50,0.00,-22.02,-9.48,-12.23,0.00,-2.94,-4.22,-6.13,0.00,-9.09,8.32,3.67,0.00,-5.95,12.00,5.57,0.00,12.04,12.69,25.97,0.00,-9.36,13.36,16.59,0.00,8.53,-15.41,-5.68,0.00,-17.96,5.88,12.27,0.00,20.40,8.04,-7.33,0.00,13.74,-5.88,-10.47,0.00,13.89,-14.06,-9.97,0.00,17.50,-8.63,-5.17,0.00,-21.00,26.24,8.40,0.00,-1.43,-5.47,7.84,0.00,-19.97,-10.06,-11.29,0.00,-12.05,-20.34,8.37,0.00,15.67,-5.55,-10.42,0.00,7.70,-4.05,-11.00,0.00,-13.40,4.31,15.10,0.00,-6.80,-16.44,-13.84,0.00,-17.63,-11.33,-7.64,0.00,-0.35,10.10,-17.31,0.00,-11.07,27.00,-6.81,0.00,-5.04,9.29,19.59,0.00,17.49,-5.72,9.76,0.00,14.40,-7.98,-4.71,0.00,11.53,7.39,3.10,0.00,-12.06,12.05,24.28,0.00,1.34,-14.74,11.50,0.00,-12.05,10.61,6.43,0.00,-10.83,21.94,-5.35,0.00,-12.82,-28.87,1.25,0.00,7.42,-6.77,7.22,0.00,-17.39,10.36,14.30,0.00,-7.76,5.57,-6.53,0.00,13.75,2.83,16.24,0.00,-9.07,-20.20,11.99,0.00,16.90,-9.01,15.45,0.00,16.91,-26.04,-20.39,0.00,-12.77,-3.57,-18.01,0.00,-12.35,-10.49,3.42,0.00,-16.94,11.92,9.03,0.00,-14.40,-8.18,18.56,0.00,-27.85,-21.92,17.45,0.00,-5.69,-35.54,-6.66,0.00,1.53,3.88,16.75,0.00,-3.71,-2.20,2.44,0.00,-9.79,6.17,-7.87,0.00,12.91,1.42,-2.66,0.00,3.16,5.66,-14.12,0.00,-13.48,23.61,6.23,0.00,1.49,12.01,2.90,0.00,20.26,-11.56,-16.99,0.00,-16.79,-8.39,13.69,0.00,3.28,0.80,-10.29,0.00,8.46,-5.71,16.30,0.00,-2.51,21.64,-13.52,0.00,24.50,-5.95,32.58,0.00,-6.85,-18.26,-7.43,0.00,-10.00,0.72,-0.95,0.00,7.07,-16.76,13.51,0.00,-0.90,-25.84,20.10,0.00,-15.97,14.95,12.37,0.00,-16.75,-16.59,0.35,0.00,-8.94,-17.39,-14.85,0.00,-22.05,-11.36,-11.60,0.00,-12.99,3.32,2.07,0.00,3.30,-13.55,-11.57,0.00,15.96,-7.58,-11.38,0.00,-17.41,34.20,-2.90,0.00,10.01,14.92,-4.40,0.00,5.97,19.12,3.89,0.00,-12.54,2.99,-7.19,0.00,-1.46,2.29,12.51,0.00,6.15,-13.56,21.03,0.00,-18.17,3.37,-9.77,0.00,2.37,-15.25,-16.37,0.00,-8.81,-9.48,12.49,0.00,22.78,4.13,-6.50,0.00,14.08,-18.16,-23.39,0.00,-3.72,20.38,-4.46,0.00,-9.18,-23.84,13.94,0.00,11.74,-5.05,9.93,0.00,22.04,-13.06,-11.66,0.00,-18.60,-7.87,15.92,0.00,-1.41,-10.32,5.84,0.00,11.18,10.03,8.34,0.00,8.80,-8.39,-2.85,0.00,30.54,2.88,9.48,0.00,3.79,-15.42,-12.05,0.00,4.91,21.98,26.78,0.00,14.54,-5.96,20.84,0.00,5.49,11.35,11.15,0.00,-21.10,-9.72,24.67,0.00,-16.88,10.71,-13.97,0.00,21.68,9.81,6.34,0.00,0.74,15.48,-9.28,0.00,5.03,11.68,9.32,0.00,-11.36,7.79,-15.45,0.00,-7.53,8.61,-11.70,0.00,2.29,-13.90,11.68,0.00,5.59,1.35,-12.77,0.00,-10.86,-21.24,13.81,0.00,4.40,8.00,0.68,0.00,-1.57,5.40,-8.52,0.00,14.26,-9.94,-15.40,0.00,6.59,10.71,-3.79,0.00,18.18,-9.71,-5.50,0.00,-16.25,9.54,-16.05,0.00,-5.58,-4.15,-9.90,0.00,7.87,-1.34,11.48,0.00,-19.13,-8.44,-11.66,0.00,17.24,-25.10,-7.55,0.00,11.35,14.58,3.82,0.00,-18.50,2.06,21.49,0.00,2.12,-15.71,-8.31,0.00,-6.48,8.88,12.90,0.00,-14.55,-3.30,2.89,0.00,-3.15,-2.17,-9.85,0.00,-14.66,-22.99,2.53,0.00,-4.14,4.19,0.87,0.00,-7.16,-17.51,-21.18,0.00,-8.86,-11.38,21.09,0.00,21.62,-9.79,-8.95,0.00,-4.20,16.96,-2.73,0.00,3.01,3.95,7.33,0.00,7.08,25.73,-13.60,0.00,2.19,4.50,-6.33,0.00,-4.25,9.82,-6.19,0.00,8.10,6.30,-19.24,0.00,-10.13,-12.77,-8.76,0.00,-10.69,-10.92,-6.40,0.00,11.87,-9.11,27.87,0.00,5.94,7.54,9.91,0.00,2.30,14.36,-20.13,0.00,-1.17,-9.00,13.09,0.00,-7.54,-1.90,4.73,0.00,-5.40,-13.01,-13.28,0.00,15.95,16.85,-6.48,0.00,-17.99,-3.86,11.87,0.00,22.21,12.94,-24.51,0.00,-15.17,12.80,10.74,0.00,-4.40,-4.93,-1.68,0.00,3.69,15.86,8.34,0.00,14.71,19.66,11.42,0.00,-7.93,-5.74,-21.73,0.00,13.29,-1.87,-2.47,0.00,-23.24,-7.96,4.49,0.00,-13.74,-27.19,7.37,0.00,9.65,13.01,-4.29,0.00,12.10,-2.53,-11.84,0.00,-23.78,5.41,5.75,0.00,-14.58,-13.23,1.06,0.00,-22.72,-15.77,12.05,0.00,-20.33,-11.30,8.48,0.00,11.66,9.07,6.97,0.00,16.97,-2.81,10.18,0.00,17.47,6.41,8.80,0.00,-32.99,-2.44,-9.58,0.00,-1.74,10.90,-10.26,0.00,-10.24,2.30,0.43,0.00,-18.67,25.66,9.54,0.00,-4.68,-13.03,9.09,0.00,4.57,11.83,-8.00,0.00,-19.24,8.21,-2.58,0.00,-11.74,-6.11,6.77,0.00,-10.33,3.78,18.26,0.00,15.46,9.26,-0.86,0.00,-19.45,12.31,8.85,0.00,11.77,13.83,-7.44,0.00,8.94,-14.79,18.51,0.00,15.39,-22.74,5.70,0.00,6.20,11.22,11.92,0.00,28.97,5.09,-12.75,0.00,-6.84,-13.25,-11.61,0.00,-8.80,-7.29,25.26,0.00,14.81,-13.17,-8.69,0.00,-20.68,6.70,14.87,0.00,13.06,18.15,5.01,0.00,-14.06,8.80,-4.02,0.00,-6.62,6.11,16.73,0.00,10.95,-8.68,-13.09,0.00,-3.77,10.53,-2.54,0.00,-1.41,-11.66,-7.13,0.00,8.59,-6.17,0.00,0.00,-15.65,-10.74,-4.94,0.00,-6.90,-3.98,-7.82,0.00,-27.66,18.54,-12.07,0.00,8.15,-17.29,3.59,0.00,-9.39,-11.95,-16.11,0.00,-8.98,19.46,6.72,0.00,24.29,-13.67,2.65,0.00,18.90,-18.36,0.00,0.00,12.03,15.32,-11.75,0.00,9.62,12.74,10.00,0.00,11.77,-31.63,-5.89,0.00,-11.23,-10.75,-9.24,0.00,10.49,22.14,12.03,0.00,-19.63,-12.28,2.59,0.00,-10.12,10.16,18.70,0.00,5.03,8.17,0.00,0.00,-8.70,6.66,-15.84,0.00,18.50,9.26,-1.75,0.00,-16.72,-16.54,9.70,0.00,-12.98,-23.68,-10.27,0.00,-6.37,-20.64,5.93,0.00,-3.50,7.46,-6.05,0.00,-20.80,-2.63,-2.01,0.00,11.80,-9.05,0.00,0.00,-3.68,-9.09,11.34,0.00,8.09,-6.36,-9.95,0.00,-17.14,19.63,3.92,0.00,15.55,12.00,-2.03,0.00,-22.40,13.11,-28.17,0.00,8.77,8.05,23.80,0.00,-26.97,-8.36,3.47,0.00,6.69,-7.24,0.00,0.00,13.52,-9.44,-9.72,0.00,12.50,-2.33,-14.73,0.00,1.05,-16.38,-19.06,0.00,1.71,-20.55,13.37,0.00,17.03,-10.56,6.76,0.00,-23.86,-13.22,26.04,0.00,6.20,-11.46,-11.85,0.00,-10.89,4.81,0.00,0.00,2.77,9.49,-11.40,0.00,7.91,16.04,-16.54,0.00,-15.34,14.14,-6.56,0.00,7.65,10.89,24.47,0.00,-23.78,-14.99,-11.06,0.00,10.52,-10.70,-6.16,0.00,-10.29,-6.47,-7.23,0.00,-6.51,-18.04,0.00,0.00,-18.43,11.25,-10.01,0.00,-20.75,-11.18,9.02,0.00,5.32,-13.00,10.19,0.00,8.95,-15.10,17.86,0.00,-2.82,-6.48,13.31,0.00,2.36,-19.37,15.00,0.00,-4.73,3.18,-13.54,0.00,-7.69,11.80,0.00,0.00,-9.04,2.61,17.40,0.00,10.17,-6.81,-5.82,0.00,-15.81,4.82,14.49,0.00,-14.84,-3.64,-18.41,0.00,-2.82,-15.04,-16.80,0.00,14.56,-21.95,4.96,0.00,18.61,11.91,-17.95,0.00,6.50,16.16,0.00,0.00,6.25,-20.54,25.95,0.00,11.76,-4.96,-2.19,0.00,4.56,17.59,-5.34,0.00,-0.63,25.03,-8.82,0.00,-7.63,-8.43,20.91,0.00,-6.66,24.04,-11.51,0.00,11.13,7.10,-8.41,0.00,8.32,5.50,0.00,0.00,15.49,-9.26,-12.22,0.00,-17.19,-17.38,-10.89,0.00,-19.05,-12.44,-3.04,0.00,-11.75,2.14,-9.19,0.00,-9.74,8.34,-12.20,0.00,9.38,-14.80,-12.98,0.00,13.19,4.20,-8.16,0.00,-0.44,18.91,0.00,0.00,19.87,17.17,-20.26,0.00,-3.78,-3.15,22.10,0.00,13.14,14.27,1.35,0.00,10.33,-15.14,0.60,0.00,-12.35,-4.41,-12.14,0.00,-10.31,9.82,11.10,0.00,9.42,-8.34,-14.66,0.00,-11.18,8.33,0.00,0.00,-28.87,-0.79,0.00,0.00,-21.69,9.05,0.00,0.00,-13.91,-18.71,0.00,0.00,28.28,1.05,0.00,0.00,2.75,25.92,0.00,0.00,15.85,5.32,0.00,0.00,)
     
     ################################
     # Ergebnis Matlab Viterbi Testsequenz
     expected_result_0 = (0,0,0,0,0,0,1,0,1,0,1,1,1,1,1,0,0,1,1,0,1,1,1,0,0,1,1,0,0,1,0,1,0,0,1,1,1,1,0,0,0,1,0,1,1,1,0,1,1,0,1,1,0,1,1,0,1,1,0,0,1,1,1,0,1,0,1,0,1,0,0,0,0,0,0,0,0,1,0,0,0,0,1,0,1,1,1,1,1,0,1,0,1,0,1,1,0,0,0,1,0,1,0,1,0,0,0,0,0,0,0,1,1,0,0,1,0,0,0,0,1,0,0,1,1,1,1,0,0,1,1,0,0,1,1,0,0,0,0,1,0,0,1,0,1,0,1,1,1,1,1,0,1,1,0,1,0,0,1,1,0,0,0,1,0,0,1,1,1,1,0,0,0,0,1,1,0,1,1,0,1,1,1,1,1,0,0,1,1,1,0,0,0,0,1,1,0,0,1,1,0,1,0,0,1,0,1,1,1,1,0,1,1,0,0,1,0,0,0,0,0,1,1,1,0,1,0,0,0,0,0,0,0,0,1,0,0,1,1,0,0,0,1,1,0,0,1,0,0,0,1,0,1,0,1,0,1,1,0,0,1,1,1,0,1,0,0,1,0,1,0,0,0,1,1,0,1,0,0,1,0,1,1,1,1,1,1,1,0,1,0,0,0,1,0,1,1,0,0,0,1,1,1,0,1,0,1,1,0,0,1,0,1,1,0,0,1,1,1,1,0,0,0,1,1,1,1,1,0,1,1,1,0,1,0,0,0,0,0,1,1,0,1,0,1,1,0,1,1,0,1,1,1,0,1,1,0,0,0,0,0,1,0,1,1,0,1,0,1,1,1,1,1,0,1,0,1,0,1,0,1,0,0,0,0,0,0,1,0,1,0,0,1,0,1,0,1,1,1,1,0,0,1,0,1,1,1,0,1,1,1,0,0,0,0,0,0,1,1,1,0,0,1,1,1,0,1,0,0,1,0,0,1,1,1,1,0,1,0,1,1,1,0,1,0,1,0,0,0,1,0,0,1,0,0,0,0,1,1,0,0,1,1,1,0,0,0,0,1,0,1,1,1,1,0,1,1,0,1,1,0,0,1,1,0,1,0,0,0,0,1,1,1,0,1,1,0,1,1,0,1,0,1,1,0,1,0,1,0,1,1,0,1,1,1,1,0,0,0,0,0,1,1,1,1,1,0,0,0,1,0,1,1,1,0,0,1,1,0,0,1,0,0,0,0,0,1,0,0,1,0,1,0,0,1,1,1,0,1,1,0,1,0,0,0,1,1,1,1,0,0,1,1,1,1,1,0,0,1,1,0,1,1,0,0,0,1,0,1,0,1,0,0,1,0,0,0,1,1,1,0,0,0,1,1,0,1,1,0,1,0,1,0,1,1,1,0,0,0,1,0,0,1,1,0,0,0,1,0,0,0,1,0,0,0,0,0,0,0,0,1,0,0,0,0,1,0,0,0,1,1,0,0,0,0,1,0,0,1,1,1,0,0,1,0,1,0,1,0,1,1,0,0,0,0,1,1,0,1,1,1,1,0,1,0,0,1,1,0,1,1,1,0,0,1,0,0,0,1,0,1,0,0,0,0,1,0,1,0,1,1,0,1,0,0,1,1,1,1,1,1,0,1,1,0,0,1,0,0,1,0,0,1,0,1,1,0,1,1,1,1,1,1,0,0,1,0,0,1,1,0,1,1,1,1,0,0,1,0,0,0,1,1,0,1,0,0,0,0,0,0,0,0,0,)
     
     #################################
     
     # Objekte erzeugen
     src_0 = gr.vector_source_f (src_data_0)
     throttle_0 = gr.throttle(gr.sizeof_float*1, 32000)
     s2v = gr.stream_to_vector(gr.sizeof_float, 3096)
     Viterbi = howto_swig.viterbi_vfb(3096)
     v2s = gr.vector_to_stream(gr.sizeof_char, 3096/4)
     dst_0 = gr.vector_sink_b()
     
     # Objekte verbinden
     self.tb.connect(src_0, throttle_0)
     self.tb.connect(throttle_0, s2v)
     self.tb.connect(s2v, Viterbi)
     self.tb.connect(Viterbi, v2s)
     self.tb.connect(v2s, dst_0)
     
     # Simulationsstart
     self.tb.run ()
     
     # Ergebnis auswerten
     result_data0 = dst_0.data ()
     result_data0 = result_data0
     expected_result_0 = expected_result_0
     self.assertEqual(expected_result_0, result_data0)
Exemplo n.º 19
0
 def test_002null_symbol_resample_bb (self):
     #################################
     # Testsequenz generieren
     src_data_0 = (1, 0, 0,       0, 0, 0,          1, 0, 0,       0, 0, 0,             1, 0, 0,       0)
             
     ################################
     # Ergebnis generieren
     exp_resu_0 = (1,             0,                1,             0,                   1,             0)
     
     #################################
     
     # Objekte erzeugen
     src_0 = gr.vector_source_b (src_data_0)
     throttle_0 = gr.throttle(gr.sizeof_char*1, 320000)
     null_symbol_resample = howto_swig.null_symbol_resample_bb(3)		#Blockgroesse=3, Guardtime = 1, Blockanzahl=2, Offset=1
     dst_0 = gr.vector_sink_b()
     
     # Objekte verbinden
     self.tb.connect(src_0, throttle_0, (null_symbol_resample,0))
     self.tb.connect((null_symbol_resample,0), dst_0)
     
     # Simulationsstart
     self.tb.run ()
     
     # Ergebnis auswerten
     result_data0 = dst_0.data ()
     self.assertEqual(exp_resu_0, result_data0)
Exemplo n.º 20
0
    def test_loopback_rand_rs_int(self):
        """
		Loopback of data, (de)randomiser, rs (en/de)coder, (de)interleaver
		"""
        src_data = make_transport_stream()
        # Disregard end bytes of source data, accounting for interleaver delay
        expected_delay = dvb_interleaver_bb.DELAY * \
          dvb_swig.MPEG_TS_PKT_LENGTH / dvb_swig.DVB_RS_ENCODED_LENGTH
        expected_result = tuple(src_data[:-expected_delay])

        src = gr.vector_source_b(src_data)
        txpad = dvb_swig.pad_mpeg_ts_packet_bp()
        randomizer = dvb_swig.randomizer_pp()
        rs_encoder = dvb_swig.rs_encoder_pp()
        txdepad = dvb_swig.depad_dvb_packet_rs_encoded_pb()
        interleaver = dvb_interleaver_bb.interleaver_bb()
        deinterleaver = dvb_interleaver_bb.deinterleaver_bb()
        rxpad = dvb_swig.pad_dvb_packet_rs_encoded_bp()
        rs_decoder = dvb_swig.rs_decoder_pp()
        derandomizer = dvb_swig.derandomizer_pp()
        rxdepad = dvb_swig.depad_mpeg_ts_packet_pb()
        dst = gr.vector_sink_b()

        # Connect and run
        self.tb.connect(src, txpad, randomizer, rs_encoder, txdepad,
                        interleaver, deinterleaver)
        self.tb.connect(deinterleaver, rxpad, rs_decoder, derandomizer,
                        rxdepad, dst)
        self.tb.run()
        # Check that the decoded bytes are the same as original
        self.assertEqual(expected_result, dst.data())
Exemplo n.º 21
0
 def test_002_ofdm_remove_first_symbol_vcc(self):
     src_data0 = (0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 0, 1, 2, 3, 4, 5, 6, 7)
     src_data1 = (1, 0, 0, 1, 0, 0)
     expected_result0 = (3, 4, 5, 6, 7, 8, 2, 3, 4, 5, 6, 7)
     expected_result0 = [x + 0j for x in expected_result0]
     expected_result1 = (1, 0, 1, 0)
     src0 = gr.vector_source_c(src_data0)
     src1 = gr.vector_source_b(src_data1)
     s2v0 = gr.stream_to_vector(gr.sizeof_gr_complex, 3)
     ofdm_remove_first_symbol = dab_swig.ofdm_remove_first_symbol_vcc(3)
     v2s0 = gr.vector_to_stream(gr.sizeof_gr_complex, 3)
     dst0 = gr.vector_sink_c()
     dst1 = gr.vector_sink_b()
     self.tb.connect(src0, s2v0, (ofdm_remove_first_symbol, 0))
     self.tb.connect(src1, (ofdm_remove_first_symbol, 1))
     self.tb.connect((ofdm_remove_first_symbol, 0), v2s0, dst0)
     self.tb.connect((ofdm_remove_first_symbol, 1), dst1)
     self.tb.run()
     result_data0 = dst0.data()
     result_data1 = dst1.data()
     # print src_data0
     # print expected_result0
     # print result_data0
     self.assertComplexTuplesAlmostEqual(expected_result0, result_data0, 6)
     self.assertEqual(result_data1, expected_result1)
Exemplo n.º 22
0
    def test_convolutional_encoder(self):
        """
		Tests convolutional encoder
		"""
        src_data = make_transport_stream()
        constellation = [.7, .7, .7, -.7, -.7, .7, -.7, -.7]

        src = gr.vector_source_b(src_data)
        unpack = gr.packed_to_unpacked_bb(1, gr.GR_MSB_FIRST)
        enc = dvb_convolutional_encoder_bb.convolutional_encoder_bb()
        repack1 = gr.unpacked_to_packed_bb(1, gr.GR_MSB_FIRST)
        repack2 = gr.packed_to_unpacked_bb(2, gr.GR_MSB_FIRST)
        mapper = gr.chunks_to_symbols_bf(constellation,
                                         dvb_swig.dimensionality)
        viterbi = trellis.viterbi_combined_fb(
            trellis.fsm(dvb_swig.k, dvb_swig.n,
                        dvb_convolutional_encoder_bb.G), dvb_swig.K, -1, -1,
            dvb_swig.dimensionality, constellation, digital.TRELLIS_EUCLIDEAN)
        pack = gr.unpacked_to_packed_bb(1, gr.GR_MSB_FIRST)
        dst = gr.vector_sink_b()

        self.tb.connect(src, unpack, enc, repack1, repack2, mapper)
        self.tb.connect(mapper, viterbi, pack, dst)
        self.tb.run()
        result_data = dst.data()
        self.assertEqual(tuple(src_data[:len(result_data)]), result_data)
 def test_002_32bits (self):
     # 3 PDUs: |           |     |         |
     data   = (1, 2, 3, 4, 1, 2, 1, 2, 3, 4)
     tagname = "packet_len"
     tag1 = gr.gr_tag_t()
     tag1.offset = 0
     tag1.key = pmt.pmt_string_to_symbol(tagname)
     tag1.value = pmt.pmt_from_long(4)
     tag2 = gr.gr_tag_t()
     tag2.offset = 4
     tag2.key = pmt.pmt_string_to_symbol(tagname)
     tag2.value = pmt.pmt_from_long(2)
     tag3 = gr.gr_tag_t()
     tag3.offset = 6
     tag3.key = pmt.pmt_string_to_symbol(tagname)
     tag3.value = pmt.pmt_from_long(4)
     src = gr.vector_source_b(data, False, 1, (tag1, tag2, tag3))
     header = digital.packet_headergenerator_bb(32, tagname)
     sink = gr.vector_sink_b()
     self.tb.connect(src, header, sink)
     self.tb.run()
     expected_data = (
         #   | Number of symbols                  | Packet number                                  | Parity
             0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0,  0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,  1, 0, 0, 0,
             0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,  1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,  0, 0, 0, 0,
             0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0,  0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,  0, 0, 0, 0
     )
     self.assertEqual(sink.data(), expected_data)
 def test_004_8bits_formatter_ofdm (self):
     occupied_carriers = ((1, 2, 3, 5, 6, 7),)
     # 3 PDUs: |           |     |         |
     data   = (1, 2, 3, 4, 1, 2, 1, 2, 3, 4)
     tagname = "packet_len"
     tag1 = gr.gr_tag_t()
     tag1.offset = 0
     tag1.key = pmt.pmt_string_to_symbol(tagname)
     tag1.value = pmt.pmt_from_long(4)
     tag2 = gr.gr_tag_t()
     tag2.offset = 4
     tag2.key = pmt.pmt_string_to_symbol(tagname)
     tag2.value = pmt.pmt_from_long(2)
     tag3 = gr.gr_tag_t()
     tag3.offset = 6
     tag3.key = pmt.pmt_string_to_symbol(tagname)
     tag3.value = pmt.pmt_from_long(4)
     src = gr.vector_source_b(data, False, 1, (tag1, tag2, tag3))
     formatter_object = digital.packet_header_ofdm(occupied_carriers, 1, tagname)
     self.assertEqual(formatter_object.header_len(), 6)
     self.assertEqual(pmt.pmt_symbol_to_string(formatter_object.len_tag_key()), tagname)
     header = digital.packet_headergenerator_bb(formatter_object.formatter(), tagname)
     sink = gr.vector_sink_b()
     self.tb.connect(src, header, sink)
     self.tb.run()
     expected_data = (
         0, 0, 1, 0, 0, 0,
         0, 1, 0, 0, 0, 0,
         0, 0, 1, 0, 0, 0
     )
     self.assertEqual(sink.data(), expected_data)
Exemplo n.º 25
0
 def test_002_energy_disp_vbb (self):
     #################################
     src_data_0 = []
     for number in range(22):
         src_data_0.append(0)
     for number in range(22):
         src_data_0.append(1)
             
     ################################
     expected_result_0 = (0,0,0,0,0,1,1,1,1,0,1,1,1,1,1,0,
                          1,1,1,1,1,0,0,0,0,1,0,0,0,0,0,1)
     
     #################################
     
     # Objekte erzeugen
     src_0 = gr.vector_source_b (src_data_0)
     s2v_0 = gr.stream_to_vector(gr.sizeof_char, 22)
     Energy_disp = howto_swig.energy_disp_vbb(22)
     v2s_0 = gr.vector_to_stream(gr.sizeof_char, 16)
     dst_0 = gr.vector_sink_b()
     
     # Objekte verbinden
     self.tb.connect(src_0, s2v_0,Energy_disp,v2s_0,dst_0)
     
     # Simulationsstart
     self.tb.run ()
     
     # Ergebnis auswerten
     result_data0 = dst_0.data ()
     self.assertEqual(expected_result_0, result_data0)
Exemplo n.º 26
0
    def test_001_cutter_vbb(self):
        #################################
        # Testsequenz generieren
        src_data_0 = (1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12)

        ################################
        # Ergebnis generieren
        expected_result_0 = (1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12)

        #################################

        # Objekte erzeugen
        src_0 = gr.vector_source_b(src_data_0)
        throttle_0 = gr.throttle(gr.sizeof_char * 1, 320000)
        s2v_0 = gr.stream_to_vector(gr.sizeof_char, 6)
        cutter = howto_swig.cutter_vbb(6, 2)
        v2s_0 = gr.vector_to_stream(gr.sizeof_char, 2)
        dst_0 = gr.vector_sink_b()

        self.tb.connect(src_0, throttle_0, s2v_0, cutter, v2s_0, dst_0)

        self.tb.run()

        result_data0 = dst_0.data()
        self.assertEqual(expected_result_0, result_data0)
 def test_003_12bits_formatter_object (self):
     # 3 PDUs: |           |     |         |
     data   = (1, 2, 3, 4, 1, 2, 1, 2, 3, 4)
     tagname = "packet_len"
     tag1 = gr.gr_tag_t()
     tag1.offset = 0
     tag1.key = pmt.pmt_string_to_symbol(tagname)
     tag1.value = pmt.pmt_from_long(4)
     tag2 = gr.gr_tag_t()
     tag2.offset = 4
     tag2.key = pmt.pmt_string_to_symbol(tagname)
     tag2.value = pmt.pmt_from_long(2)
     tag3 = gr.gr_tag_t()
     tag3.offset = 6
     tag3.key = pmt.pmt_string_to_symbol(tagname)
     tag3.value = pmt.pmt_from_long(4)
     src = gr.vector_source_b(data, False, 1, (tag1, tag2, tag3))
     formatter_object = digital.packet_header_default(12, tagname)
     header = digital.packet_headergenerator_bb(formatter_object.formatter(), tagname)
     sink = gr.vector_sink_b()
     self.tb.connect(src, header, sink)
     self.tb.run()
     expected_data = (
         0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0,
         0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
         0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0
     )
     self.assertEqual(sink.data(), expected_data)
Exemplo n.º 28
0
    def test_001_enc(self):
        length = 2048  # DANGER: this fails for > 2048 for some reason
        data = [random.randint(0, 255) for i in range(length)]
        # last K-1 bits are padding, meaning last byte is lost
        data[-1] = 0
        data = tuple(data)
        src = gr.vector_source_b(data)
        enc = raw.conv_enc()
        tofloat = gr.uchar_to_float()
        offset = gr.multiply_const_ff(255.0)
        touchar = gr.float_to_uchar()
        dec = raw.conv_dec(length * 8)
        dst = gr.vector_sink_b()
        self.tb.connect(src, enc, tofloat, offset, touchar, dec, dst)

        self.tb.run()
        # self.assertEqual (data, dst.data())
        nerrors = 0
        i = 0
        for (a, b) in itertools.izip(data, dst.data()):
            nerr = bitCount(a ^ b)
            if nerr:
                print "%g " % (i / 2048.0), nerr
            nerrors += nerr
            i += 1
        print "Number or Errors %d BER %g" % (nerrors, (nerrors * 1.0 / (length * 8)))
        self.assertEqual(nerrors, 0)
Exemplo n.º 29
0
 def setUp (self):
     self.tb   = gr.top_block ()
     
     my_map = range(46)
     for i in range(40):
         my_map[i+6] = int(i)
         
     my_map[0]=int(34)
     my_map[1]=int(35)
     my_map[2]=int(36)
     my_map[3]=int(37)
     my_map[4]=int(38)
     my_map[5]=int(39)
     
     my_data = range(40)
     for i in my_data:
         my_data[i]=int(i)
     
     self.src  = gr.vector_source_b(my_data,False,40)
     self.head = gr.head(40,1)
     
     self.vrs  = lte_swig.vector_resize_vbvb(my_map,40,46)
     
     self.snk  = gr.vector_sink_b(46)
     
     self.tb.connect(self.src,self.head,self.vrs,self.snk)
Exemplo n.º 30
0
 def setUp (self):
     self.tb = gr.top_block ()
     self.tp = drm.transm_params(1, 3, False, 0, False, 1, 0, 1, 1, 0, False, 24000, "station label", "text message")
     self.src = drm.generate_sdc_vb(self.tp)
     self.head = gr.head(self.tp.sdc().L(), 1)
     self.snk = gr.vector_sink_b(self.tp.sdc().L())
     self.tb.connect(self.src, self.head, self.snk)
	def test_001_ofdm_coarse_frequency_correct(self):
		fft_length   = 10
		num_carriers = 2
		cp_length    = 3
		src_data0        = [0,1,2,3,4,5,6,7,8,9,1,2,0,5,7,6,0,4,0,6,1,1,1,0.8,0.1,1.3,1,0.7,1,1,0,1,2,3,4,5,6,7,8,9]
		expected_result0 = [7,9,5,6,0.8,1.3,3,5]
		offset           = [3,3,-1,-1,-1,-1,-1,-1]
		frame_index      = [0,0, 0, 0, 0, 0, 1, 1]
		expected_result0 = [complex(expected_result0[i])*cmath.exp(-2j*cmath.pi*offset[i]*cp_length/float(fft_length)*frame_index[i]) for i in range(0,8)]
		src_data1 = [1,1,1,0]
		expected_result1 = (1,1,1,0)
		src0 = gr.vector_source_c(src_data0)
		src1 = gr.vector_source_b(src_data1)
		s2v0 = gr.stream_to_vector(gr.sizeof_gr_complex, fft_length)
		ofdm_coarse_frequency_correct = dab_swig.ofdm_coarse_frequency_correct(fft_length,num_carriers,cp_length)
		v2s0 = gr.vector_to_stream(gr.sizeof_gr_complex, num_carriers)
		dst0 = gr.vector_sink_c()
		dst1 = gr.vector_sink_b()
		self.tb.connect(src0, s2v0, (ofdm_coarse_frequency_correct,0))
		self.tb.connect(src1, (ofdm_coarse_frequency_correct,1))
		self.tb.connect((ofdm_coarse_frequency_correct,0), v2s0, dst0)
		self.tb.connect((ofdm_coarse_frequency_correct,1), dst1)
		self.tb.run()
		result_data0 = dst0.data()
		result_data1 = dst1.data()
		# print expected_result0
		# print result_data0
		self.assertComplexTuplesAlmostEqual(expected_result0, result_data0, 4)
		self.assertEqual(result_data1, expected_result1)
 def test_004_8bits_formatter_ofdm(self):
     occupied_carriers = ((1, 2, 3, 5, 6, 7), )
     # 3 PDUs: |           |     |         |
     data = (1, 2, 3, 4, 1, 2, 1, 2, 3, 4)
     tagname = "packet_len"
     tag1 = gr.gr_tag_t()
     tag1.offset = 0
     tag1.key = pmt.pmt_string_to_symbol(tagname)
     tag1.value = pmt.pmt_from_long(4)
     tag2 = gr.gr_tag_t()
     tag2.offset = 4
     tag2.key = pmt.pmt_string_to_symbol(tagname)
     tag2.value = pmt.pmt_from_long(2)
     tag3 = gr.gr_tag_t()
     tag3.offset = 6
     tag3.key = pmt.pmt_string_to_symbol(tagname)
     tag3.value = pmt.pmt_from_long(4)
     src = gr.vector_source_b(data, False, 1, (tag1, tag2, tag3))
     formatter_object = digital.packet_header_ofdm(occupied_carriers, 1,
                                                   tagname)
     self.assertEqual(formatter_object.header_len(), 6)
     self.assertEqual(
         pmt.pmt_symbol_to_string(formatter_object.len_tag_key()), tagname)
     header = digital.packet_headergenerator_bb(
         formatter_object.formatter(), tagname)
     sink = gr.vector_sink_b()
     self.tb.connect(src, header, sink)
     self.tb.run()
     expected_data = (0, 0, 1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0)
     self.assertEqual(sink.data(), expected_data)
Exemplo n.º 33
0
    def test_002(self):

        code = tuple(string_to_1_0_list(default_access_code))
        access_code = to_1_0_string(code)
        header = tuple(
            2 * [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0])  # len=2
        pad = (0, ) * 100
        src_data = code + header + (0, 1, 0, 0, 1, 0, 0, 0) + (0, 1, 0, 0, 1,
                                                               0, 0, 1) + pad
        expected_data = 'HI'

        rcvd_pktq = gr.msg_queue()

        src = gr.vector_source_b(src_data)
        correlator = digital.correlate_access_code_bb(access_code, 0)
        framer_sink = digital.framer_sink_1(rcvd_pktq)
        vsnk = gr.vector_sink_b()

        self.tb.connect(src, correlator, framer_sink)
        self.tb.connect(correlator, vsnk)
        self.tb.run()

        result_data = rcvd_pktq.delete_head()
        result_data = result_data.to_string()
        self.assertEqual(expected_data, result_data)
Exemplo n.º 34
0
def test_mod_cpm():
    tb = gr.top_block()
    precode = mlse.xor_encode_bb()
    nrz = gr.map_bb([1,-1])
    mod = gr.gmskmod_bc(1,0.3,4)
    #src = gr.vector_source_b([0,0,0,0,1,1,1,1,0,0])
    #src = gr.vector_source_b([1,1,0,0,1,0,0,1,1,1,0,0,0,0])
    src = gr.vector_source_b((1,)*1000)
    sink = gr.vector_sink_c()
    derot = mlse.derotate_cc(1,4)
    tb.connect(src, precode, nrz, mod, derot, sink)
    precode_probe = gr.vector_sink_b()
    tb.connect(nrz, precode_probe)
    tb.run()
    d = sink.data()
    from cmath import phase, pi, rect
    real = lambda x: x.real
    import operator
    d_r = d#list(decimate(d,5,2))
    d2 = [ int(round((phase(i)/pi)*100)) for i in d ]
    derotate = [ (-1j)**(i+1) for i in range(len(d_r))]
    d3 = map(operator.mul, d_r, derotate)
#    print "\n".join(map(str,map(real,d3)))
    print precode_probe.data()
#    print "\n".join(map(str,map(phase,d)))
    print "\n".join([str(phase(i)/pi) for i in d])
    print len(d)
    print derotate
Exemplo n.º 35
0
Arquivo: qa_dvb.py Projeto: EQ4/gr-dvb
	def test_loopback_rand_rs_int(self):
		"""
		Loopback of data, (de)randomiser, rs (en/de)coder, (de)interleaver
		"""
		src_data = make_transport_stream()
		# Disregard end bytes of source data, accounting for interleaver delay
		expected_delay = dvb_interleaver_bb.DELAY * \
				dvb_swig.MPEG_TS_PKT_LENGTH / dvb_swig.DVB_RS_ENCODED_LENGTH
		expected_result = tuple(src_data[:-expected_delay])

		src = gr.vector_source_b(src_data)
		txpad = dvb_swig.pad_mpeg_ts_packet_bp()
		randomizer = dvb_swig.randomizer_pp()
		rs_encoder = dvb_swig.rs_encoder_pp()
		txdepad = dvb_swig.depad_dvb_packet_rs_encoded_pb()
		interleaver = dvb_interleaver_bb.interleaver_bb()
		deinterleaver = dvb_interleaver_bb.deinterleaver_bb()
		rxpad = dvb_swig.pad_dvb_packet_rs_encoded_bp()
		rs_decoder = dvb_swig.rs_decoder_pp()
		derandomizer = dvb_swig.derandomizer_pp()
		rxdepad = dvb_swig.depad_mpeg_ts_packet_pb()
		dst = gr.vector_sink_b()

		# Connect and run
		self.tb.connect(src, txpad, randomizer, rs_encoder, txdepad, interleaver, deinterleaver)
		self.tb.connect(deinterleaver, rxpad, rs_decoder, derandomizer, rxdepad, dst)
		self.tb.run()
		# Check that the decoded bytes are the same as original
		self.assertEqual(expected_result, dst.data())
Exemplo n.º 36
0
    def test_regen2(self):
        tb = self.tb

        data = 200 * [
            0,
        ]
        data[9] = 1
        data[99] = 1

        expected_result = 200 * [
            0,
        ]
        expected_result[9] = 1
        expected_result[19] = 1
        expected_result[29] = 1
        expected_result[39] = 1

        expected_result[99] = 1
        expected_result[109] = 1
        expected_result[119] = 1
        expected_result[129] = 1

        src = gr.vector_source_b(data, False)
        regen = gr.regenerate_bb(10, 3)
        dst = gr.vector_sink_b()

        tb.connect(src, regen)
        tb.connect(regen, dst)
        tb.run()

        dst_data = dst.data()

        self.assertEqual(tuple(expected_result), dst_data)
 def test_300(self):
     input_data = (0,1,2,3,4,5,6,7,8,9)
     src = gr.vector_source_b(input_data)
     dst = gr.vector_sink_b()
     self.fg.connect(src, dst)
     self.fg.run()
     self.assertEquals(input_data, dst.data())
Exemplo n.º 38
0
 def __init__(self, constellation, differential,
              data_length=None, src_data=None):
     """
     constellation -- a constellation object
     differential -- whether differential encoding is used
     data_length -- the number of bits of data to use
     src_data -- a list of the bits to use
     """
     super(rec_test_tb, self).__init__()
     # Transmission Blocks
     if src_data is None:
         self.src_data = tuple([rndm.randint(0,1) for i in range(0, data_length)])
     else:
         self.src_data = src_data
     packer = gr.unpacked_to_packed_bb(1, gr.GR_MSB_FIRST)
     src = gr.vector_source_b(self.src_data)
     mod = generic_mod(constellation, differential=differential)
     # Channel
     channel = gr.channel_model(NOISE_VOLTAGE, FREQUENCY_OFFSET, TIMING_OFFSET)
     # Receiver Blocks
     demod = generic_demod(constellation, differential=differential,
                           freq_bw=FREQ_BW,
                           phase_bw=PHASE_BW)
     self.dst = gr.vector_sink_b()
     self.connect(src, packer, mod, channel, demod, self.dst)
 def test_003_12bits_formatter_object(self):
     # 3 PDUs: |           |     |         |
     data = (1, 2, 3, 4, 1, 2, 1, 2, 3, 4)
     tagname = "packet_len"
     tag1 = gr.gr_tag_t()
     tag1.offset = 0
     tag1.key = pmt.pmt_string_to_symbol(tagname)
     tag1.value = pmt.pmt_from_long(4)
     tag2 = gr.gr_tag_t()
     tag2.offset = 4
     tag2.key = pmt.pmt_string_to_symbol(tagname)
     tag2.value = pmt.pmt_from_long(2)
     tag3 = gr.gr_tag_t()
     tag3.offset = 6
     tag3.key = pmt.pmt_string_to_symbol(tagname)
     tag3.value = pmt.pmt_from_long(4)
     src = gr.vector_source_b(data, False, 1, (tag1, tag2, tag3))
     formatter_object = digital.packet_header_default(12, tagname)
     header = digital.packet_headergenerator_bb(
         formatter_object.formatter(), tagname)
     sink = gr.vector_sink_b()
     self.tb.connect(src, header, sink)
     self.tb.run()
     expected_data = (0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0,
                      0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0)
     self.assertEqual(sink.data(), expected_data)
Exemplo n.º 40
0
 def stdtest_01(self,bps):
   # no reuse, bps bits per symbol
   vsyms = 10
   vlen = 10
   bits = vsyms*vlen*bps
   
   refdata = [randint(0,1) for i in range(bits)]
   cmap = [bps]*(vsyms*vlen)
   
   src = gr.vector_source_b(refdata)
   dst = gr.vector_sink_b()
   
   src_map = gr.vector_source_b(cmap)
   s2v = gr.stream_to_vector(gr.sizeof_char, vlen)
   self.tb.connect(src_map,s2v)
   
   dut1 = ofdm.generic_mapper_bcv(vlen)
   dut2 = ofdm.generic_demapper_vcb(vlen)
   
   self.tb.connect(src,dut1,dut2,dst)
   self.tb.connect(s2v,(dut1,1))
   self.tb.connect(s2v,(dut2,1))
   
   self.tb.run()
   
   self.assertEqual(list(dst.data()),refdata)
Exemplo n.º 41
0
 def __init__(self, constellation, differential,
              data_length=None, src_data=None):
     """
     constellation -- a constellation object
     differential -- whether differential encoding is used
     data_length -- the number of bits of data to use
     src_data -- a list of the bits to use
     """
     super(rec_test_tb, self).__init__()
     # Transmission Blocks
     if src_data is None:
         self.src_data = tuple([rndm.randint(0,1) for i in range(0, data_length)])
     else:
         self.src_data = src_data
     packer = gr.unpacked_to_packed_bb(1, gr.GR_MSB_FIRST)
     src = gr.vector_source_b(self.src_data)
     mod = generic_mod(constellation, differential=differential)
     # Channel
     channel = gr.channel_model(NOISE_VOLTAGE, FREQUENCY_OFFSET, TIMING_OFFSET)
     # Receiver Blocks
     demod = generic_demod(constellation, differential=differential,
                           freq_bw=FREQ_BW,
                           phase_bw=PHASE_BW)
     self.dst = gr.vector_sink_b()
     self.connect(src, packer, mod, channel, demod, self.dst)
Exemplo n.º 42
0
    def test_regen2 (self):
        tb = self.tb
        
        data = 200*[0,]
        data[9] = 1
        data[99] = 1

        expected_result = 200*[0,]
        expected_result[9]   = 1
        expected_result[19]  = 1
        expected_result[29]  = 1
        expected_result[39]  = 1
        
        expected_result[99]  = 1
        expected_result[109]  = 1
        expected_result[119]  = 1
        expected_result[129]  = 1

        src = gr.vector_source_b(data, False)
        regen = gr.regenerate_bb(10, 3)
        dst = gr.vector_sink_b()

        tb.connect (src, regen)
        tb.connect (regen, dst)
        tb.run ()

        dst_data = dst.data ()
        
        self.assertEqual (tuple(expected_result), dst_data)
Exemplo n.º 43
0
 def setUp (self):
     self.tb   = gr.top_block ()
     
     my_map = range(46)
     for i in range(40):
         my_map[i+6] = int(i)
         
     my_map[0]=int(34)
     my_map[1]=int(35)
     my_map[2]=int(36)
     my_map[3]=int(37)
     my_map[4]=int(38)
     my_map[5]=int(39)
     
     my_data = range(40)
     for i in my_data:
         my_data[i]=int(i)
     
     self.src  = gr.vector_source_b(my_data,False,40)
     self.head = gr.head(40,1)
     
     self.vrs  = lte_swig.vector_resize_vbvb(my_map,40,46)
     
     self.snk  = gr.vector_sink_b(46)
     
     self.tb.connect(self.src,self.head,self.vrs,self.snk)
Exemplo n.º 44
0
    def test_00(self):
        expected_result = (
            0x00, 0x11, 0x22, 0x33,
            0x44, 0x55, 0x66, 0x77,
            0x88, 0x99, 0xaa, 0xbb,
            0xcc, 0xdd, 0xee, 0xff)

        # Filter taps to expand the data to oversample by 8
        # Just using a RRC for some basic filter shape
        taps = gr.firdes.root_raised_cosine(8, 8, 1.0, 0.5, 21)
        
        src = gr.vector_source_b(expected_result)
        frame = digital.simple_framer(4)
        unpack = gr.packed_to_unpacked_bb(1, gr.GR_MSB_FIRST)
        expand = gr.interp_fir_filter_fff(8, taps)
        b2f = gr.char_to_float()
        mult2 = gr.multiply_const_ff(2)
        sub1 = gr.add_const_ff(-1)
        op = digital.simple_correlator(4)
        dst = gr.vector_sink_b()
        self.tb.connect(src, frame, unpack, b2f, mult2, sub1, expand)
        self.tb.connect(expand, op, dst)
        self.tb.run()
        result_data = dst.data()

        self.assertEqual(expected_result, result_data)
Exemplo n.º 45
0
    def helper(self, v0, v1, fft_length, preamble):
        tb = self.tb
        src0 = gr.vector_source_c(v0)
        src1 = gr.vector_source_b(v1)
        
        s2v = gr.stream_to_vector(gr.sizeof_gr_complex, fft_length)

        # print "len(v) = %d" % (len(v))

        op = gr.ofdm_insert_preamble(fft_length, preamble)

        v2s = gr.vector_to_stream(gr.sizeof_gr_complex, fft_length)
        dst0 = gr.vector_sink_c()
        dst1 = gr.vector_sink_b()

        tb.connect(src0, s2v, (op, 0))
        tb.connect(src1, (op, 1))
        tb.connect((op, 0), v2s, dst0)
        tb.connect((op, 1), dst1)

        tb.run()
        r0 = dst0.data()
        r0v = []
        for i in range(len(r0)//fft_length):
            r0v.append(r0[i*fft_length:(i+1)*fft_length])
            
        r1 = dst1.data()
        self.assertEqual(len(r0v), len(r1))
        return (r1, r0v)
Exemplo n.º 46
0
    def stdtest_01(self, bps):
        # no reuse, bps bits per symbol
        vsyms = 10
        vlen = 10
        bits = vsyms * vlen * bps

        refdata = [randint(0, 1) for i in range(bits)]
        cmap = [bps] * (vsyms * vlen)

        src = gr.vector_source_b(refdata)
        dst = gr.vector_sink_b()

        src_map = gr.vector_source_b(cmap)
        s2v = gr.stream_to_vector(gr.sizeof_char, vlen)
        self.tb.connect(src_map, s2v)

        dut1 = ofdm.generic_mapper_bcv(vlen)
        dut2 = ofdm.generic_demapper_vcb(vlen)

        self.tb.connect(src, dut1, dut2, dst)
        self.tb.connect(s2v, (dut1, 1))
        self.tb.connect(s2v, (dut2, 1))

        self.tb.run()

        self.assertEqual(list(dst.data()), refdata)
 def setUp (self):
     self.tb = gr.top_block ()
     self.src = gr.vector_source_b((1,1,0,1), True, 4)
     self.head = gr.head(4,3)
     self.add_tailbits = drm.add_tailbits_vbvb(4,2)
     self.snk = gr.vector_sink_b(6)
     
     self.tb.connect(self.src, self.head, self.add_tailbits, self.snk)
Exemplo n.º 48
0
 def test_300(self):
     input_data = (0, 1, 2, 3, 4, 5, 6, 7, 8, 9)
     src = gr.vector_source_b(input_data)
     dst = gr.vector_sink_b()
     tb = gr.top_block()
     tb.connect(src, dst)
     tb.run()
     self.assertEquals(input_data, dst.data())
Exemplo n.º 49
0
    def test_deint_001(self):
        lenx = 64
        src0 = gr.vector_source_b(range(lenx))
        op = gr.deinterleave(gr.sizeof_char, 2)
        dst0 = gr.vector_sink_b()
        dst1 = gr.vector_sink_b()

        self.tb.connect(src0, op)
        op.connect(dst0, usesPortName="byte_out_0")
        op.connect(dst1, usesPortName="byte_out_1")
        self.tb.run()

        expected_result0 = tuple(range(0, lenx, 2))
        expected_result1 = tuple(range(1, lenx, 2))

        self.assertFloatTuplesAlmostEqual(expected_result0, dst0.data())
        self.assertFloatTuplesAlmostEqual(expected_result1, dst1.data())
Exemplo n.º 50
0
 def test_002(self):
     src_data = (2, 3, 0, 1)
     expected_results = (1, 0, 1, 1, 0, 0, 0, 1)
     src = gr.vector_source_b(src_data, False)
     op = blocks.unpack_k_bits_bb(2)
     dst = gr.vector_sink_b()
     self.tb.connect(src, op, dst)
     self.tb.run()
     self.assertEqual(expected_results, dst.data())
Exemplo n.º 51
0
    def setUp(self):
        self.tb = gr.top_block()
        self.src = gr.vector_source_b((0, 1, 2, 3, 4, 5, 6, 7, 8, 9), True, 10)
        self.head = gr.head(10, 2)
        seq = (3, 7, 5, 8, 6, 1, 9, 4, 2, 0)
        self.interleaver = drm.interleaver_vbvb(seq)
        self.snk = gr.vector_sink_b(10)

        self.tb.connect(self.src, self.head, self.interleaver, self.snk)
 def help_const_bb(self, src_data, exp_data, op):
     for s in zip(range(len(src_data)), src_data):
         src = gr.vector_source_b(s[1])
         self.tb.connect(src, (op, s[0]))
     dst = gr.vector_sink_b()
     self.tb.connect(op, dst)
     self.tb.run()
     result_data = dst.data()
     self.assertEqual(exp_data, result_data)
Exemplo n.º 53
0
 def test_001(self):
     src_data = (1, 0, 1, 1, 0, 1, 1, 0)
     expected_results = (1, 0, 1, 1, 0, 1, 1, 0)
     src = gr.vector_source_b(src_data, False)
     op = gr.pack_k_bits_bb(1)
     dst = gr.vector_sink_b()
     self.tb.connect(src, op, dst)
     self.tb.run()
     self.assertEqual(expected_results, dst.data())
Exemplo n.º 54
0
 def test_001_pipe_source(self):
     test_str = "Hello GNU Radio"
     expected_result = tuple(map(lambda x: long(ord(x)), list(test_str)))
     pipe_source = pipe_swig.source(gr.sizeof_char, "echo -n " + test_str)
     dst = gr.vector_sink_b()
     self.tb.connect(pipe_source, dst)
     self.tb.run()
     result_data = dst.data()
     self.assertEqual(expected_result, result_data)
Exemplo n.º 55
0
 def test_003(self):
     src_data = expected_results = map(lambda x: random.randint(0,3), range(10));
     src = gr.vector_source_b( src_data );
     pack = blocks.pack_k_bits_bb(2);
     unpack = blocks.unpack_k_bits_bb(2);
     snk = gr.vector_sink_b();
     self.tb.connect(src,unpack,pack,snk);
     self.tb.run()
     self.assertEqual(list(expected_results), list(snk.data()));
Exemplo n.º 56
0
 def test_additive_scrambler_reset(self):
     src_data = (1, ) * 1000
     src = gr.vector_source_b(src_data, False)
     scrambler = gr.additive_scrambler_bb(0x8a, 0x7f, 7, 100)
     descrambler = gr.additive_scrambler_bb(0x8a, 0x7f, 7, 100)
     dst = gr.vector_sink_b()
     self.tb.connect(src, scrambler, descrambler, dst)
     self.tb.run()
     self.assertEqual(src_data, dst.data())
Exemplo n.º 57
0
 def test_and_const_bb (self):
     src_data =        (1,  2, 3,  0x50,   0x11)
     expected_result = (0,  2, 2,  0x00,   0x00)
     src = gr.vector_source_b(src_data)
     op = blocks_swig.and_const_bb (0xAA)
     dst = gr.vector_sink_b()
     self.tb.connect(src, op, dst)
     self.tb.run()
     self.assertEqual(dst.data(), expected_result)
Exemplo n.º 58
0
 def setUp(self):
     self.tb = gr.top_block()
     self.tp = drm.transm_params(1, 3, False, 0, False, 1, 0, 1, 1, 0,
                                 False, 24000, "station label",
                                 "text message")
     self.src = drm.generate_sdc_vb(self.tp)
     self.head = gr.head(self.tp.sdc().L(), 1)
     self.snk = gr.vector_sink_b(self.tp.sdc().L())
     self.tb.connect(self.src, self.head, self.snk)