%% Generate CellRS Indices for TDD Mode
% This example shows how to create the subscripts for the positions of the cell-specific reference signal (CellRS) for antenna port 0 in subframe 6 for uplink-downlink configuration 2 and special subframe configuration 4 with extended cyclic prefix.
% First, create the parameter structure.

enb.NDLRB        = 9;
enb.NCellID      = 1;
enb.DuplexMode   = 'TDD';
enb.NSubframe    = 6;
enb.TDDConfig    = 2;
enb.SSC          = 4;
enb.CyclicPrefix = 'Extended';

%
% Next, create the cell-specific RS indices.

sub = lteCellRSIndices(enb,0,'sub')

% The second column, which gives the OFDM symbol number (1-based) within the subframe, has values of 1 indicating that only the 1st OFDM symbol will contain cell-specific reference signals in this case. This is because the chosen subframe is a special subframe with DwPTS of length 3 and therefore the other cell-specific reference signal elements (in OFDM symbols 4, 7 and 10) which would be present in full downlink subframes are not generated.
%
% To confirm this theory, change the duplex mode to FDD.

enb.DuplexMode   = 'FDD';
sub = lteCellRSIndices(enb,0,'sub');
unique(sub(:,2))

% In this case, the switch over to FDD means that the now irrelevant fields, TDDConfig and SSC, are ignored.
% Copyright 2012 The MathWorks, Inc.