% 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)
|