%% Compare PSCCH DM-RS Resource Element Indexing
% Compare PSCCH DM-RS resource element indexing formats.
% Create a UE settings structure.

ue = struct('NSLRB',15,'CyclicPrefixSL','Normal','PRBSet',5);

%
%% One-based linear indexing, this is the default output style
% Generate PSCCH DM-RS indices, using the default one-based linear indexing style.

ind1 = ltePSCCHDRSIndices(ue);
ind1(1)

%
%% Zero-based linear indexing
% Generate PSCCH DM-RS indices, using zero-based linear indexing style.

opts = '0based';
ind0 = ltePSCCHDRSIndices(ue,opts);
ind0(1)

% For zero-based indexing, the first assigned index is one lower than the one-based indexing.
%
%% One-based indexing in [subcarrier,symbol,port] subscript row style
% Generate PSCCH DM-RS indices, one-based subscript row style.

opts = {'sub','1based'};
ind1sub = ltePSCCHDRSIndices(ue,opts);
size(ind1sub)
ind1sub(1,:)

% The subscript row style outputs a 24-by-3 matrix. Viewing the first row you can see symbol number 4 is occupied.
%
% Two PSCCH subframe symbols are reserved for transmission of the PSCCH DM-RS. Inspecting the output matrix for unique symbol values, shows that the PSCCH DM-RS occupy symbols 4 and 11 for one-based indexing.

unique(ind1sub(:,2,:))

%
% Copyright 2012 The MathWorks, Inc.