Skip to content

Commit

Permalink
add nrPDSCHIndices()
Browse files Browse the repository at this point in the history
  • Loading branch information
catkira committed Oct 29, 2023
1 parent 0dfb9e2 commit 64739c0
Show file tree
Hide file tree
Showing 2 changed files with 29 additions and 0 deletions.
1 change: 1 addition & 0 deletions py3gpp/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,7 @@
from .nrPDSCH import nrPDSCH
from .nrPDSCHDecode import nrPDSCHDecode
from .nrDLSCHInfo import nrDLSCHInfo
from .nrPDSCHIndices import nrPDSCHIndices

from .configs.nrCarrierConfig import nrCarrierConfig
from .configs.nrNumerologyConfig import nrNumerologyConfig
Expand Down
28 changes: 28 additions & 0 deletions py3gpp/nrPDSCHIndices.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
import numpy as np

from py3gpp.nrPDSCHDMRS import PDSCHDMRSSyms
from py3gpp.configs.nrPDSCHConfig import nrPDSCHConfig
from py3gpp.configs.nrCarrierConfig import nrCarrierConfig

def nrPDSCHIndices(carrier: nrCarrierConfig, pdsch: nrPDSCHConfig):
frame_begin = pdsch.NRBSize * (min(pdsch.PRBSet))
frame_end = pdsch.NRBSize * (max(pdsch.PRBSet) + 1)

occupied_syms = np.arange(pdsch.SymbolAllocation[0], pdsch.SymbolAllocation[1])
indices = np.repeat(np.expand_dims(np.arange(frame_begin, frame_end), 0), occupied_syms.shape[0], axis = 0)
for i in range(indices.shape[0]):
indices[i, :] += carrier.NSizeGrid * pdsch.NRBSize * i + pdsch.NStartBWP * pdsch.NRBSize
indices = np.delete(indices, PDSCHDMRSSyms(pdsch), axis = 0)
return indices.ravel()


if __name__ == '__main__':
pdsch = nrPDSCHConfig()
carrier = nrCarrierConfig()
carrier.NSizeGrid = 52
pdsch.NSizeBWP = 25
pdsch.NStartBWP = 10
pdsch.PRBSet = np.arange(pdsch.NSizeBWP)
indices = nrPDSCHIndices(carrier, pdsch)
print(indices.shape)
print(indices)

0 comments on commit 64739c0

Please sign in to comment.