def setUp (self):
     self.simu = Simulation(1000)
Example #2
0
 def setUp(self):
     self.simu = Simulation(1000)
class qa_mlse_equalizer_midamble_vcb(gr_unittest.TestCase):

    def setUp (self):
        self.simu = Simulation(1000)

    def tearDown (self):
        self.simu = None

    def test_001_no_channel(self):
        self.simu.set_channel([0,0,0,1,0,0,0])
        self.simu.set_snr(100)
        ber=self.simu.execute()
        print "dirac channel, snr:100 ber:%s"%ber
        assert(ber < 0.001)
        self.simu.set_snr(10)
        ber=self.simu.execute()
        print "dirac channel, snr:10 ber:%s"%ber
        assert(ber < 0.01)

    def test_002_ramdom_channel(self):
        chan = [ cmath.rect(1,2*math.pi*random.random()) for i in range(6) ] + [0]
        self.simu.set_channel(chan)
        self.simu.set_snr(100)
        ber=self.simu.execute()
        print "random channel, snr:100 ber:%s"%ber
        assert(ber < 0.001)
        self.simu.set_snr(10)
        ber=self.simu.execute()
        print "random channel, snr:10 ber:%s"%ber
        assert(ber < 0.05)
Example #4
0
class qa_mlse_equalizer_midamble_vcb(gr_unittest.TestCase):
    def setUp(self):
        self.simu = Simulation(1000)

    def tearDown(self):
        self.simu = None

    def test_001_no_channel(self):
        self.simu.set_channel([0, 0, 0, 1, 0, 0, 0])
        self.simu.set_snr(100)
        ber = self.simu.execute()
        print "dirac channel, snr:100 ber:%s" % ber
        assert (ber < 0.001)
        self.simu.set_snr(10)
        ber = self.simu.execute()
        print "dirac channel, snr:10 ber:%s" % ber
        assert (ber < 0.01)

    def test_002_ramdom_channel(self):
        chan = [
            cmath.rect(1, 2 * math.pi * random.random()) for i in range(6)
        ] + [0]
        self.simu.set_channel(chan)
        self.simu.set_snr(100)
        ber = self.simu.execute()
        print "random channel, snr:100 ber:%s" % ber
        assert (ber < 0.001)
        self.simu.set_snr(10)
        ber = self.simu.execute()
        print "random channel, snr:10 ber:%s" % ber
        assert (ber < 0.05)