%% LTE Extract Resources Example
%% Create a transmit waveform for one subframe

enb = lteRMCDL('R.12');
enb.TotSubframes = 1;
txWaveform = lteRMCDLTool(enb,[1;0;0;1]);

%
%% Receive sum of transmit antenna waveforms on three receive antennas

NRxAnts = 3;
rxWaveform = repmat(sum(txWaveform,2),1,NRxAnts);
rxGrid = lteOFDMDemodulate(enb,rxWaveform);

%
%% Channel estimation

cec.FreqWindow = 1;
cec.TimeWindow = 1;
cec.InterpType = 'cubic';
cec.PilotAverage = 'UserDefined';
cec.InterpWinSize = 3;
cec.InterpWindow = 'Causal';
[hEstGrid,nEst] = lteDLChannelEstimate(enb,cec,rxGrid);

%
%% Generate PDCCH indices and extract symbols from received and channel estimate grids in preparation for PDCCH decoding

ind = ltePDCCHIndices(enb);
[pdcchRxSym,pdcchHestSym] = lteExtractResources(ind,rxGrid,hEstGrid);

%
%% pdcchRxSym is sized NRE by NRxAnts and pdcchHestSym is sized NRE by NRxAnts by CellRefP

rxSymSize = size(pdcchRxSym)
hestSymSize = size(pdcchHestSym)

%
%% Decode PDCCH with extracted resource elements

 pdcchBits = ltePDCCHDecode(enb,pdcchRxSym,pdcchHestSym,nEst);

% Copyright 2012 The MathWorks, Inc.