Matlab Toolbox - 5G/NR
CSI Codebook
NOTE : It is required to have Matlab 5G Toolbox to run this script. Matlab Versionthat I used for this page is 5G Toolbox Version 2.2 (R2021a)
| CSI_RS_Codebook.m |
|
% NOTE : This code is based on the example in the Matlab document linked here.
NStartBWP = 0; NSizeBWP = 66;
reportConfig.NStartBWP = NStartBWP; reportConfig.NSizeBWP = NSizeBWP; reportConfig.PanelDimensions = [2 1]; reportConfig.CQIMode = 'Wideband'; reportConfig.PMIMode = 'Wideband'; reportConfig.SubbandSize = 4; reportConfig.PRGSize = []; reportConfig.CodebookMode = 1; reportConfig.CodebookSubsetRestriction = []; reportConfig.i2Restriction = []; reportConfig.PanelDimensions(1) = 2; reportConfig.PanelDimensions(2) = 1; nLayers = 1;
N1 = reportConfig.PanelDimensions(1); N2 = reportConfig.PanelDimensions(2);
% Supported panel configurations and oversampling factors, as defined in TS 38.214 Table 5.2.2.2.1-2 panelConfigs = [2 2 4 3 6 4 8 4 6 12 4 8 16 % N1 1 2 1 2 1 2 1 3 2 1 4 2 1 % N2 4 4 4 4 4 4 4 4 4 4 4 4 4 % O1 1 4 1 4 1 4 1 4 4 1 4 4 1]; % O2 configIdx = find(panelConfigs(1,:) == N1 & panelConfigs(2,:) == N2,1); if isempty(configIdx) error('nr5g:hDLPMISelect:InvalidPanelConfiguration',['The given panel configuration ['... num2str(reportConfig.PanelDimensions(1)) ' ' num2str(reportConfig.PanelDimensions(2)) '] is not valid for the given CSI-RS configuration. '... 'For a number of CSI-RS ports, the panel configuration should be one of the possibilities from TS 38.214 Table 5.2.2.2.1-2.']); end
% Extract the oversampling factors O1 = panelConfigs(3,configIdx); O2 = panelConfigs(4,configIdx);
reportConfig.PanelDimensions = [N1 N2]; reportConfig.OverSamplingFactors = [O1 O2];
W = getPMIType1SinglePanelCodebook(reportConfig,nLayers);
% The source code of following functions are copied from hDLPMISelect.m
function W = getPMIType1SinglePanelCodebook(reportConfig,nLayers) function vlm = getVlm(N1,N2,O1,O2,l,m) function vbarlm = getVbarlm(N1,N2,O1,O2,l,m) function [vlmRestricted,i2Restricted] = isRestricted(codebookSubsetRestriction,bitIndex,n,i2Restriction) function info = getDLCSISubbandInfo(nSizeBWP,nStartBWP,reportingMode,NSBPRB,ignoreBWPSize) function sinr = getPrecodedSINR(H,nVar,W)
|
I have created the codebooks based on the configuration specified in 38.214 v15.3-Table 5.2.2.2.1-2. The generated the codebook itself would not mean much to you. This is to help you to verify your understandings on the codebook. I would recommend you to try this if you really want to dig into the details of the codebook.
i) calculate the codebook as shown in my CSI codebook page.
ii) Check your calculation with the codebook that I created here.
<Type 1 Single Panel : Based on 38.214 v15.3-Table 5.2.2.2.1-2: Supported configurations of (N1,N2) and (O1,O2)>
|
Number of CSI-RS antenna ports |
(N1,N2) |
(O1,O2) |
Number of Layers |
||
|
1 |
2 |
4 |
|||
|
4 |
(4,1) |
||||
|
8 |
(4,4) |
||||
|
(4,1) |
|||||
|
12 |
(4,4) |
||||
|
(4,1) |
|||||
|
16 |
(4,4) |
||||
|
(4,1) |
|||||
|
24 |
(4,4) |
||||
|
(4,4) |
|||||
|
(4,1) |
|||||
|
32 |
(4,4) |
||||
|
(4,4) |
|||||
|
(4,1) |
|||||