NG Toolset开发笔记--NB-IoT Resource Grid(6)

100 篇文章 0 订阅
42 篇文章 1 订阅

2/10初步完成NgNbiotGrid.fillNpdcchUss(TODO:NPDCCH Gap未实现)。

2018-2-11:fillNpdcchUss中,参照36.211更新npdcch mapping。

2018-2-12:增加flag:recvingNpdcch, recvingNpdsch和sendingNpusch。

2/12 update:resetNpdcchUssMap在monitorNpdcch中调用。

def fillNpdcchUss(self, hsfn, sfn):
        dn = str(hsfn) + '_' + str(sfn)
        if not dn in self.gridNbDl:
            self.ngwin.logEdit.append('Call NgNbiotGrid.fillHostCrs at first to initialize NgNbiotGrid.gridNbDl!')
            return
        '''2018-2-12 update
        #from 36.213 16.6
        #The locations of starting subframe k are given by k=k_b where k_b is the bth consecutive NB-IoT DL subframe from subframe k0,
        #excluding subframes used for transmission of SI messages, and b=u*R , and u=0,1,...,R_max/R-1, and where:
        #-subframe k0 is a subframe satisfying the condition: (10*nf + floor(ns/2)) mod T = floor(a_offset * T)
        #-where T = R_max * G, T >= 4
        T = int(self.ussRmax * self.args['npdcchUssStartSf'])
        k0 = None
        for i in range(self.subfPerRfNbDl):
            if (sfn * self.subfPerRfNbDl + i) % T == math.floor(self.args['npdcchUssOff'] * T):
                k0 = i
                break
        
        u = list(range(self.ussRmax // self.ussR))
        b = u[0] * self.ussR    #for simplicity, always use the first candidate
        
        #2018-2-12 update
        if not self.recvingNpdcch and not self.recvingNpdsch and not self.sendingNpusch and k0 is not None:
        #if k0 is not None:
            self.resetNpdcchUssMap(hsfn, sfn, k0, b)
            self.recvingNpdcch = True
        '''        

        key = str(hsfn) + '_' + str(sfn)
        if not key in self.npdcchUssMap:
            return
        
        slots = []
        for subf in self.npdcchUssMap[key]:
            slots.extend([2*subf, 2*subf+1])
        '''    
        for iap in range(self.args['nbDlAp']):
            for islot in slots:
                for isymb in range(self.symbPerSlotNb):
                    for isc in range(self.scNbDl):
                        if self.gridNbDl[dn][iap][isc][islot*self.symbPerSlotNb+isymb] == NbiotResType.NBIOT_RES_BLANK.value:
                            self.gridNbDl[dn][iap][isc][islot*self.symbPerSlotNb+isymb] = NbiotResType.NBIOT_RES_NPDCCH.value
        '''
        #2018-2-11 update
        #from 36.211 10.2.5.5
        #...which meet all of the following criteria: 
        #- they are part of the NCCE(s) assigned for the NPDCCH transmission, and
        #- they are not used for transmission of NPBCH, NPSS, or NSSS , and
        #- they are assumed by the UE not to be used for NRS, and
        #- they are not overlapping with resource elements used for PBCH, PSS, SSS, or CRS as defined in clause 6 (if any), and
        #- the index l in the first slot in a subframe fulfills l >= l_NPDCCH_start where l_NPDCCH_start is given by clause 16.6.1 of 3GPP TS 36.213 [4].
        for iap in range(self.args['nbDlAp']):
            for islot in slots:
                #for simplicity, let l = CFI of host LTE in the first slot if a subframe
                for isymb in range(self.args['hostLteCfi'] if islot % 2 == 0 else 0, self.symbPerSlotNb):
                    #for simplicity, always use NCCE0 when AL==1
                    for isc in range(self.scNbDl // 2 if self.ussAggLev == 1 else self.scNbDl):
                        if self.gridNbDl[dn][iap][isc][islot*self.symbPerSlotNb+isymb] == NbiotResType.NBIOT_RES_BLANK.value and self.args['hostLteGridDl'][iap][self.args['nbInbandPrbIndDl'] * 12 + isc][islot*self.symbPerSlotNb+isymb] == LteResType.LTE_RES_PDSCH.value:
                            self.gridNbDl[dn][iap][isc][islot*self.symbPerSlotNb+isymb] = NbiotResType.NBIOT_RES_NPDCCH.value

         #TODO: NPDCCH Gap to be implemented!

resetNpdcchUssMap用于生成NPDCCH USS candidate子帧序列。self.npdcchUssMap定义如下:

#data structure for NPDCCH USS mapping
        self.npdcchUssMap = OrderedDict()   #key='hsfn_sfn', value=[list of dl subframes for the first uss candidate]
        
        self.ussRmax = self.args['npdcchUssNumRep']
        #Table 16.6-1: NPDCCH UE- specific search space candidates
        _ussCand = {1 : [(1, 1, 'ncce0')], #(1, 1, 'ncce1'), (1, 2, 'ncce01') not supported!
                    2 : [(1, 1, 'ncce0'), (2, 2, 'ncce01')], #(1, 1, 'ncce1'), (2, 2, 'ncce01') not supported!
                    4 : [(1, 2, 'ncce01'), (2, 2, 'ncce01'), (4, 2, 'ncce01')],
                    8 : [(self.ussRmax // 8, 2, 'ncce01'), (self.ussRmax // 4, 2, 'ncce01'), (self.ussRmax // 2, 2, 'ncce01'), (self.ussRmax, 2, 'ncce01')]}
        self.ussR, self.ussAggLev, ncce = _ussCand[self.ussRmax][self.args['nbDciN0N1SfRep']] if self.ussRmax < 8 else _ussCand[8][self.args['nbDciN0N1SfRep']]

ngnbiotgridui.py中增加self.argsNbiot['hostLteGridDl'],用于NPDCCH re mapping:

#step 2: call NgLteGrid
        lteGrid = NgLteGrid(self.ngwin, self.argsLte)
        if lteGrid.isOk:
            lteGrid.fillCrs()
            lteGrid.fillPbch()
            lteGrid.fillSch()
            
            #36.211 10.2.5.5 NPDCCH mapping
            #- they are not overlapping with resource elements used for PBCH, PSS, SSS, or CRS as defined in clause 6 (if any),
            #note the use of ndarray.copy()!
            self.argsNbiot['hostLteGridDl'] = lteGrid.gridDl.copy()

            #...(omitted) 


  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 1
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论 1
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值