Esempio n. 1
0
    def test_003_active_subcarriers(self):
        n_frames = 1
        timeslots = 9
        subcarriers = 32
        active_subcarriers = 20
        overlap = 2
        f_taps = filters.get_frequency_domain_filter('rrc', .5, timeslots,
                                                     subcarriers, overlap)
        gfdm_constellation = digital.constellation_qpsk().base()
        subcarrier_map = get_subcarrier_map(subcarriers, active_subcarriers)

        data = get_random_qpsk(n_frames * timeslots * active_subcarriers)
        src = blocks.vector_source_c(data)
        mapper = gfdm.resource_mapper_cc(timeslots, subcarriers,
                                         active_subcarriers, subcarrier_map,
                                         True)
        mod = gfdm.simple_modulator_cc(timeslots, subcarriers, overlap, f_taps)
        demod = gfdm.advanced_receiver_sb_cc(timeslots, subcarriers, overlap,
                                             64, f_taps, gfdm_constellation,
                                             subcarrier_map, 0)
        demapper = gfdm.resource_demapper_cc(timeslots, subcarriers,
                                             active_subcarriers,
                                             subcarrier_map, True)
        snk = blocks.vector_sink_c()
        self.tb.connect(src, mapper, mod, demod, demapper, snk)
        self.tb.run()

        res = np.array(snk.data())
        self.assertComplexTuplesAlmostEqual(data, res, 2)
Esempio n. 2
0
    def test_002_subcarrier_first(self):
        timeslots = 9
        subcarriers = 32
        active_subcarriers = 20
        subcarrier_map = get_subcarrier_map(subcarriers, active_subcarriers)

        data = get_random_qpsk(10 * timeslots * active_subcarriers)
        src = blocks.vector_source_c(data)
        mapper = gfdm.resource_mapper_cc(timeslots, subcarriers, active_subcarriers, subcarrier_map, False)
        demapper = gfdm.resource_demapper_cc(timeslots, subcarriers, active_subcarriers, subcarrier_map, False)
        snk = blocks.vector_sink_c()
        self.tb.connect(src, mapper, demapper, snk)
        self.tb.run()
        # check data
        res = np.array(snk.data())

        self.assertComplexTuplesAlmostEqual(data, res)
Esempio n. 3
0
    def test_002_subcarrier_first(self):
        timeslots = 9
        subcarriers = 32
        active_subcarriers = 20
        subcarrier_map = get_subcarrier_map(subcarriers, active_subcarriers)

        data = get_random_qpsk(10 * timeslots * active_subcarriers)
        src = blocks.vector_source_c(data)
        mapper = gfdm.resource_mapper_cc(timeslots, subcarriers,
                                         active_subcarriers, subcarrier_map,
                                         False)
        demapper = gfdm.resource_demapper_cc(timeslots, subcarriers,
                                             active_subcarriers,
                                             subcarrier_map, False)
        snk = blocks.vector_sink_c()
        self.tb.connect(src, mapper, demapper, snk)
        self.tb.run()
        # check data
        res = np.array(snk.data())

        self.assertComplexTuplesAlmostEqual(data, res)
    def test_003_active_subcarriers(self):
        n_frames = 1
        timeslots = 9
        subcarriers = 32
        active_subcarriers = 20
        overlap = 2
        f_taps = filters.get_frequency_domain_filter('rrc', .5, timeslots, subcarriers, overlap)
        gfdm_constellation = digital.constellation_qpsk().base()
        subcarrier_map = get_subcarrier_map(subcarriers, active_subcarriers)

        data = get_random_qpsk(n_frames * timeslots * active_subcarriers)
        src = blocks.vector_source_c(data)
        mapper = gfdm.resource_mapper_cc(timeslots, subcarriers, active_subcarriers, subcarrier_map, True)
        mod = gfdm.simple_modulator_cc(timeslots, subcarriers, overlap, f_taps)
        demod = gfdm.advanced_receiver_sb_cc(timeslots, subcarriers, overlap, 64, f_taps, gfdm_constellation, subcarrier_map)
        demapper = gfdm.resource_demapper_cc(timeslots, subcarriers, active_subcarriers, subcarrier_map, True)
        snk = blocks.vector_sink_c()
        self.tb.connect(src, mapper, mod, demod, demapper, snk)
        self.tb.run()

        res = np.array(snk.data())
        self.assertComplexTuplesAlmostEqual(data, res, 2)