%% Create CSI-RS Symbols and Combine with Resource Grid
% Generate CSI-RS symbols and combine them with a 10 MHz, release 8, port 0 PDSCH subframe resource grid.
% Initialize a reference channel structure. Create a 10 MHz, release 8, port 0 PDSCH configuration parameter structure. Set subframe number to 1, number of CSI-RS antenna ports to 8, CSI-RS configuration to 0, and CSIRSPeriod to 6.

rmc = lteRMCDL('R.2','FDD',1);
rmc.NSubframe = 1;
rmc.CSIRefP = 8;
rmc.CSIRSConfig = 0;
rmc.CSIRSPeriod = 6;

% The 8 antenna ports are ports 15 to 22. The setting for CSIRSPeriod is Icsi-rs, which equals [ Tcsi-rs Dcsi-rs]=[10 1].
%
% Create a 3-D resource grid to contain the subframes for all eight CSI-RS ports.

rgrid = lteResourceGrid(rmc,rmc.CSIRefP);

%
% Write the release 8 port 0 transmission into the first plane of the resource grid.

[wave,rgrid(:,:,1)] = lteRMCDLTool(rmc,[1,0,0,1]);

%
% Create the CSI-RS symbols for ports 15 to 22. Overwrite all ports included in the port 0 transmission with the actual CSI-RS and unused RE.

rgrid(lteCSIRSIndices(rmc,'rs+unused')) = lteCSIRS(rmc,'rs+unused');

% Copyright 2012 The MathWorks, Inc.