def test_001_measure_ber_b(self): src0 = blocks.vector_source_b([0] * 100) src1 = blocks.vector_source_b([255] * 100) sink = dab.measure_ber_b() self.tb.connect(src0, (sink, 0)) self.tb.connect(src1, (sink, 1)) self.tb.run() assert (sink.ber() == 1)
def test_001_measure_ber_b(self): src0 = blocks.vector_source_b(range(0, 256)) src1 = blocks.vector_source_b(range(0, 256)) sink = dab.measure_ber_b() self.tb.connect(src0, (sink, 0)) self.tb.connect(src1, (sink, 1)) self.tb.run() assert (sink.ber() == 0)
def test_003_measure_ber_b(self): src0 = blocks.vector_source_b([0,7,255,250]) src1 = blocks.vector_source_b([0,2,255,3]) sink = dab.measure_ber_b() self.tb.connect(src0, (sink,0)) self.tb.connect(src1, (sink,1)) self.tb.run() self.assertAlmostEqual(sink.ber(), 8./32.) # every bit is set 50% of the time
def test_002_measure_ber_b(self): src0 = blocks.vector_source_b(range(0,256)*2) src1 = blocks.vector_source_b([0]*256+[255]*256) sink = dab.measure_ber_b() self.tb.connect(src0, (sink,0)) self.tb.connect(src1, (sink,1)) self.tb.run() self.assertAlmostEqual(sink.ber(), 0.5) # every bit is set 50% of the time
def test_001_measure_ber_b(self): src0 = blocks.vector_source_b([0]*100) src1 = blocks.vector_source_b([255]*100) sink = dab.measure_ber_b() self.tb.connect(src0, (sink,0)) self.tb.connect(src1, (sink,1)) self.tb.run() assert(sink.ber()==1)
def test_001_measure_ber_b(self): src0 = blocks.vector_source_b(range(0,256)) src1 = blocks.vector_source_b(range(0,256)) sink = dab.measure_ber_b() self.tb.connect(src0, (sink,0)) self.tb.connect(src1, (sink,1)) self.tb.run() assert(sink.ber()==0)
def test_003_measure_ber_b(self): src0 = blocks.vector_source_b([0, 7, 255, 250]) src1 = blocks.vector_source_b([0, 2, 255, 3]) sink = dab.measure_ber_b() self.tb.connect(src0, (sink, 0)) self.tb.connect(src1, (sink, 1)) self.tb.run() self.assertAlmostEqual(sink.ber(), 8. / 32.) # every bit is set 50% of the time
def test_002_measure_ber_b(self): src0 = blocks.vector_source_b(range(0, 256) * 2) src1 = blocks.vector_source_b([0] * 256 + [255] * 256) sink = dab.measure_ber_b() self.tb.connect(src0, (sink, 0)) self.tb.connect(src1, (sink, 1)) self.tb.run() self.assertAlmostEqual(sink.ber(), 0.5) # every bit is set 50% of the time