%% Generate RMC R.3 with SIB
% This example shows use of lteRMCDLTool to generate a tx waveform with SIB transmission enabled using DCIFormat1A and localized allocation.
% Specify desired RMC, initialize configuration structure and define txData. Generate txGrid and plot it.

rc = 'R.3';
rmc = lteRMCDL(rc);

txData = [1;0;0;1];
[~,txGrid,~] = lteRMCDLTool(rmc, txData);
mesh(abs(txGrid))
view(2)

%
% To insert SIB1 message into the output waveform, initialize SIB substructure, enable SIB transmission, adjust other defaults, and regenerate txGrid. Plot txGrid to illustrate the presence of SIB1 message in subframe 5

rmc.SIB.Enable = 'On'; 
rmc.SIB.DCIFormat = 'Format1A';
rmc.SIB.AllocationType = 0;
rmc.SIB.VRBStart = 8;
rmc.SIB.VRBLength = 8;
rmc.SIB.Data = randi([0 1],144,1);

[txWaveform,txGrid,rmcCfgOut] = lteRMCDLTool(rmc, txData);
figure
mesh(abs(txGrid))
view(2)

% Copyright 2012 The MathWorks, Inc.