%% Create DCI Message Using UE-Specific Control And Bit Stream
% Use an additional UE-specific input parameter structure to control UE-specific DCI fields. Create a message to be sent on the EPDCCH that is intended for a UE configured with the carrier indicator field, CIF.
% Initialize cell-wide structure enb, UE-specific structure chs, and output options structure opts.

enb.NDLRB = 50;
enb.CellRefP = 1;
enb.DuplexMode = 'TDD';

chs.DCIFormat = 'Format1B';
chs.ControlChannelType = 'EPDCCH';
chs.EnableCarrierIndication = 'On';
chs.EnableSRSRequest = 'Off';
chs.EnableMultipleCSIRequest = 'Off';
chs.NTxAnts = 1;

opts = {'fieldsizes','excludeunusedfields'};

%
% Based on the UE-specific settings in chs, the DCI message length is extended to include fields CIF (3 bits) and HARQACKResOffset (2 bits). Using lteDCIInfo and chs to determine the correct input bitstream length, create bitsin.

info = lteDCIInfo(enb,chs);

bitsin = zeros(getfield(info,chs.DCIFormat),1);

%
% Create a new DCI message using cell-wide settings, UE-specific Control and bitsin.

[dciout,bitsout] = lteDCI(enb,chs,bitsin,opts);
dciout

% Copyright 2012 The MathWorks, Inc.