***考虑到NB上行时域基本单位为slot,与LTE不同,没有subframe的概念。所以改写time2str36:
def time2str36(hsfn, sfn, slot, symb):
#HSFN, range 0~1023, two base36 chars
strHsfn = base_repr(hsfn, base=36)
#SFN, range 0~1023, two base36 chars
strSfn = base_repr(sfn, base=36)
#slot, range 0~20, one base36 char
strSlot = base_repr(slot, base=36)
#symbol, range 0~7, one base36 char
strSymb = base_repr(symb, base=36)
return '[%s%s%s%s]' % (strHsfn.zfill(2), strSfn.zfill(2), strSlot, strSymb)
从原来的hsfn-sfn-subf-symb修正为hsfn-sfn-slot-symb
***考虑到NB resource mapping会涉及到repetition,NB的资源栅格存储采用OrderedDict:
#init gridNbDl and gridNbUl for dn="hsfn_sfn"
if not dn in self.gridNbDl:
self.gridNbDl[dn] = np.full((self.args['nbDlAp'], self.scNbDl, self.symbPerRfNbDl), NbiotResType.NBIOT_RES_BLANK.value)
self.gridNbUl[dn] = np.full((1, self.scNbUl, self.symbPerRfNbUl), NbiotResType.NBIOT_RES_BLANK.value)
字典中,key='hsfn_sfn',value=ndarray且shape=(#ap,#sc,#symb)
***NB资源栅格与LTE资源栅格的绘制应有差别。NB需要模拟上下行单用户调度的情况,比如:
(1)NB上行调度
suppose npdcch dci n0 ending in subframe n
k0 subframe later to start sending npusch format 1
at least 3ms later to monitor npdcch again
(2)NB下行调度
suppose npdcch dci n1 ending in subframe n
receive npdsch starting from n+5+k0
k0-1 subframes offset later, send npusch format 2 containing HARQ-ACK
at least 3ms later to monitor npdcch again
为模拟上述过程,定义下列5类操作(NgNbiotGrid):
- normalOps
- monitorNpdcch
- sendNpuschFormat1
- sendNpuschFormat2
- recvNpdsch
def normalOps(self, hsfn, sfn):
#NB DL
self.fillHostCrs(hsfn, sfn)
self.fillNpss(hsfn, sfn)
self.fillNsss(hsfn, sfn)
self.fillNpbch(hsfn, sfn)
self.fillNbSib1(hsfn, sfn)
self.fillNrs(hsfn, sfn)
self.fillNbSib2(hsfn, sfn)
self.fillNbSib3(hsfn, sfn)
#NB UL
self.fillNprach(hsfn, sfn)
def monitorNpdcch(self, hsfn, sfn):
self.normalOps(hsfn, sfn)
self.fillNpdcch(hsfn, sfn)
def sendNpuschFormat1(self, hsfn, sfn):
self.normalOps(hsfn, sfn)
self.fillNpuschFormat1(hsfn, sfn)
def sendNpuschFormat2(self, hsfn, sfn):
self.normalOps(hsfn, sfn)
self.fillNpuschFormat2(hsfn, sfn)
def recvNpdschWoBcch(self, hsfn, sfn):
self.normalOps(hsfn, sfn)
self.fillNpdschWoBcch(hsfn, sfn)