def test_003 (self):
		repetitions = 4
		inout = [8+4+2+1, 1]
		#unsigned short input_bits, unsigned short repetitions
		uut1 = ofdm.repetition_encoder_sb(4, repetitions, [1,0,1,1,1,0,1,1,1,0,1,1,0,1,1,0])
		uut2 = ofdm.repetition_decoder_bs(4, repetitions, [1,0,1,1,1,0,1,1,1,0,1,1,0,1,1,0])
		src = gr.vector_source_s(inout)
		dst = gr.vector_sink_s()

		self.fg.connect(src, uut1, uut2, dst)
		self.fg.run()

		self.assertEqual(inout, list(dst.data()))
	def test_002 (self):
		repetitions = 4
		input = concatenate([[1,1,1,1]*repetitions, [1,0,0,0]*repetitions])

		#unsigned short output_bits, unsigned short repetitions
		uut = ofdm.repetition_decoder_bs(4, repetitions, [0]*(4*repetitions))
		src = gr.vector_source_b(input.tolist())
		dst = gr.vector_sink_s()

		self.fg.connect(src, uut, dst)
		self.fg.run()

		ref = concatenate([[8+4+2+1], [1]])
		self.assertEqual(list(ref), list(dst.data()))
Ejemplo n.º 3
0
    def test_003(self):
        repetitions = 4
        inout = [8 + 4 + 2 + 1, 1]
        #unsigned short input_bits, unsigned short repetitions
        uut1 = ofdm.repetition_encoder_sb(
            4, repetitions, [1, 0, 1, 1, 1, 0, 1, 1, 1, 0, 1, 1, 0, 1, 1, 0])
        uut2 = ofdm.repetition_decoder_bs(
            4, repetitions, [1, 0, 1, 1, 1, 0, 1, 1, 1, 0, 1, 1, 0, 1, 1, 0])
        src = gr.vector_source_s(inout)
        dst = gr.vector_sink_s()

        self.fg.connect(src, uut1, uut2, dst)
        self.fg.run()

        self.assertEqual(inout, list(dst.data()))
Ejemplo n.º 4
0
    def test_002(self):
        repetitions = 4
        input = concatenate([[1, 1, 1, 1] * repetitions,
                             [1, 0, 0, 0] * repetitions])

        #unsigned short output_bits, unsigned short repetitions
        uut = ofdm.repetition_decoder_bs(4, repetitions,
                                         [0] * (4 * repetitions))
        src = gr.vector_source_b(input.tolist())
        dst = gr.vector_sink_s()

        self.fg.connect(src, uut, dst)
        self.fg.run()

        ref = concatenate([[8 + 4 + 2 + 1], [1]])
        self.assertEqual(list(ref), list(dst.data()))