%% Decode PUCCH Format 2A DM-RS
% Decode a PUCCH format 2A DM-RS from a synchronized and equalized resource array.
% Initialize input configuration structures demonstrating use of 'Name',Value pair assignment and direct field assignment.

ue = struct('NULRB',6,'NCellID',0,'NSubframe',0,'Hopping','Off');
pucch2 = struct('ResourceIdx',0);

%

ue.CyclicPrefixUL = 'Normal';
ue.NTxAnts = 1;
pucch2.ResourceSize = 0;
pucch2.CyclicShifts = 0;

%
% For the transmitter, create the PUCCH format 2A DM-RS.

reGrid = lteULResourceGrid(ue);
drsIndices = ltePUCCH2DRSIndices(ue,pucch2);
txAck = [1;0];
reGrid(drsIndices) = ltePUCCH2DRS(ue,pucch2,txAck);

%
% On the receiver side, decode the PUCCH format 2 DM-RS symbols and view rxAck to confirm it matches txAck

drsSymbols = reGrid(drsIndices);
rxAck = ltePUCCH2DRSDecode(ue,pucch2,length(txAck),drsSymbols)

% Copyright 2012 The MathWorks, Inc.