Matlab Toolbox - 4G/LTE

 

 

 

PUCCH Format 2

 

PUCCH format 2 carries periodic CSI, such as CQI and PMI, from the UE to the eNB. It codes up to 13 bits into 20 bits, sends them as 10 QPSK symbols, and spreads each symbol over one RB with a cyclically shifted sequence. This page generates the format 2 symbols and its DMRS with the LTE Toolbox, and shows where they sit in the uplink grid.

Description/explanation will come later !

Followings are the topics to be covered in this page.

Generation of PUCCH Format 2 Symbol

How does a handful of CQI bits become the 120 values of a PUCCH format 2 transmission? The code below follows the chain from the CQI bits to the modulated symbols, and generates the DMRS that goes with them. The four examples then change only ResourceIdx.

    ue1.NCellID = 0;

    ue1.CyclicPrefixUL = 'Normal';

    ue1.NSubframe = 0;

    ue1.Hopping = 'Off';

    ue1.NULRB = 6;

    ue1.Shortened = 0;

    ue1.RNTI = 77;

    ue1.NTxAnts = 1;

     

    pucch2.ResourceIdx = 0;

    pucch2.CyclicShifts = 6;

    pucch2.ResourceSize = 0;

     

    cqi = [0 1 1 0 0 1];

    cqi_cw = lteUCIEncode(cqi);

     

    pucch2_sym = ltePUCCH2(ue1,pucch2,cqi_cw);

    pucch2_sym_arrayIndex = 0:length(pucch2_sym)-1;

    pucch2_sym_ind = ltePUCCH2Indices(ue1,pucch2);

     

    dmrs2_sym = ltePUCCH2DRS(ue1,pucch2,[]);

    dmrs2_sym_arrayIndex = 0:length(dmrs2_sym)-1;

    dmrs2_sym_ind = ltePUCCH2DRSIndices(ue1,pucch2);

     

    subplot(2,3,1);

    plot(real(pucch2_sym),imag(pucch2_sym),'ro','MarkerFaceColor',[1 0 0]);

    title('Constellation');

    subplot(2,3,[2 3]);

    plot(pucch2_sym_arrayIndex,real(pucch2_sym),'ro-',pucch2_sym_arrayIndex,imag(pucch2_sym),'bo-');

    xlim([0 max(pucch2_sym_arrayIndex)]);

    title('PUCCH index vs PUCCH value. Red -> real, Blue -> Imaginary');

     

    subplot(2,3,4);

    plot(real(dmrs2_sym),imag(dmrs2_sym),'ro','MarkerFaceColor',[1 0 0]);

    title('Constellation');

    subplot(2,3,[5 6]);

    plot(dmrs2_sym_arrayIndex,real(dmrs2_sym),'ro-',dmrs2_sym_arrayIndex,imag(dmrs2_sym),'bo-');

    xlim([0 max(dmrs2_sym_arrayIndex)]);

    title('DMRS index vs DMRS value. Red -> real, Blue -> Imaginary');

The function lteUCIEncode codes the 6 CQI bits with the (20, A) Reed-Muller code of 36.212 v19.3.0 clause 5.2.3.3, so cqi_cw has 20 bits. The function ltePUCCH2 then follows 36.211 v19.3.0 clause 5.4.2. It scrambles the 20 bits with a sequence initialized from the C-RNTI, which is why ue1.RNTI is set, and maps them to 10 QPSK symbols. Each QPSK symbol is multiplied by a length-12 sequence with a cyclic shift, so the output has 10 x 12 = 120 values.

The function ltePUCCH2DRS generates the DMRS. Format 2 has two DMRS symbols per slot, so the DMRS has 4 x 12 = 48 values. The third argument is empty because plain format 2 carries no HARQ-ACK bit; formats 2a and 2b would modulate the DMRS with one here.

Each plot below shows the constellation and the real and imaginary parts of the PUCCH values in the upper row, and the same for the DMRS in the lower row. The PUCCH values run from index 0 to 119 and the DMRS values from 0 to 47.

     

      ue1.NCellID = 0;

      ue1.NSubframe = 0;

      ue1.NULRB = 6;

      ue1.Shortened = 0;

      ue1.RNTI = 77;

      ue1.NTxAnts = 1;

       

      pucch2.ResourceIdx = 0;

      pucch2.CyclicShifts = 6;

      pucch2.ResourceSize = 0;

       

      cqi = [0 1 1 0 0 1];

     

    Constellation and values of PUCCH format 2 and its DMRS with ResourceIdx 0

     

ResourceIdx 0. All PUCCH and DMRS values lie on the unit circle, because the QPSK symbols and the sequence both have a constant magnitude.

     

      ue1.NCellID = 0;

      ue1.NSubframe = 0;

      ue1.NULRB = 6;

      ue1.Shortened = 0;

      ue1.RNTI = 77;

      ue1.NTxAnts = 1;

       

      pucch2.ResourceIdx = 1;

      pucch2.CyclicShifts = 6;

      pucch2.ResourceSize = 0;

       

      cqi = [0 1 1 0 0 1];

     

    Constellation and values of PUCCH format 2 and its DMRS with ResourceIdx 1

     

ResourceIdx 1. The DMRS values fall on only four points at 45, 135, 225 and 315 degrees.

     

      ue1.NCellID = 0;

      ue1.NSubframe = 0;

      ue1.NULRB = 6;

      ue1.Shortened = 0;

      ue1.RNTI = 77;

      ue1.NTxAnts = 1;

       

      pucch2.ResourceIdx = 2;

      pucch2.CyclicShifts = 6;

      pucch2.ResourceSize = 0;

       

      cqi = [0 1 1 0 0 1];

     

    Constellation and values of PUCCH format 2 and its DMRS with ResourceIdx 2

     

ResourceIdx 2.

     

      ue1.NCellID = 0;

      ue1.NSubframe = 0;

      ue1.NULRB = 6;

      ue1.Shortened = 0;

      ue1.RNTI = 77;

      ue1.NTxAnts = 1;

       

      pucch2.ResourceIdx = 3;

      pucch2.CyclicShifts = 6;

      pucch2.ResourceSize = 0;

       

      cqi = [0 1 1 0 0 1];

     

    Constellation and values of PUCCH format 2 and its DMRS with ResourceIdx 3

     

ResourceIdx 3.

ResourceIdx is nPUCCH(2) of 36.211. Clause 5.4.2 derives the cyclic shift of the sequence from it, so each ResourceIdx gives a different set of values, although the CQI bits are the same. That is how several UEs share one RB: each uses its own cyclic shift, and the sequences stay orthogonal.

  • 6 CQI bits to 20 coded bits : (20, A) code of 36.212 clause 5.2.3.3.
  • 10 QPSK symbols, each spread over 12 subcarriers : 120 PUCCH values.
  • 2 DMRS symbols per slot : 48 DMRS values.
  • ResourceIdx sets the cyclic shift : UEs share an RB by using different shifts.

Symbol to RE Mapping

Where in the uplink grid do these 120 PUCCH values and 48 DMRS values go? This section maps them into the resource grid of one subframe with 6 RB and plots the grid. The RB and the SC-FDMA symbols of format 2 can then be seen directly.

    ue1.NCellID = 0;

    ue1.CyclicPrefixUL = 'Normal';

    ue1.NSubframe = 0;

    ue1.Hopping = 'Off';

    ue1.NULRB = 6;

    ue1.Shortened = 0;

    ue1.RNTI = 77;

    ue1.NTxAnts = 1;

     

    pucch2.ResourceIdx = 0;

    pucch2.CyclicShifts = 6;

    pucch2.ResourceSize = 0;

     

    cqi = [0 1 1 0 0 1];

    cqi_cw = lteUCIEncode(cqi);

     

    pucch2_sym = ltePUCCH2(ue1,pucch2,cqi_cw);

    pucch2_sym_arrayIndex = 0:length(pucch2_sym)-1;

    pucch2_sym_ind = ltePUCCH2Indices(ue1,pucch2);

     

    dmrs2_sym = ltePUCCH2DRS(ue1,pucch2,[]);

    dmrs2_sym_arrayIndex = 0:length(dmrs2_sym)-1;

    dmrs2_sym_ind = ltePUCCH2DRSIndices(ue1,pucch2);

     

    resourceGridUL = lteULResourceGrid(ue1);

     

    pucch2_scale = 1.0;

    dmrs2_scale = 0.5;

     

    resourceGridUL(pucch2_sym_ind) = pucch2_scale * pucch2_sym;

    resourceGridUL(dmrs2_sym_ind) = dmrs2_scale * dmrs2_sym;

    resourceGridUL = [ resourceGridUL resourceGridUL(:,13)];

    resourceGridUL = [ resourceGridUL; resourceGridUL((ue1.NULRB*12-1),:) ];

     

    xStep = 0:14;

    yStep = 0:(ue1.NULRB*12);

    surface(xStep,yStep,abs(resourceGridUL));

    axis([0 14 0 (ue1.NULRB*12) 0 2]);

    view([0,90]);

    set(gca,'xtick',[0 6 7 13]);

    set(gca,'ytick',[[0:12:ue1.NULRB*12-1] [ue1.NULRB*12-1]]);

The code writes the PUCCH values with scale 1.0 and the DMRS values with scale 0.5, so the two appear in different colours. The last column and the last row are repeated only because the function surface draws cells between grid points. The plots below show the grid of each ResourceIdx side by side, with the SC-FDMA symbol on the x axis and the subcarrier on the y axis.

 

    ue1.NCellID = 0;

    ue1.NSubframe = 0;

    ue1.NULRB = 6;

    ue1.Shortened = 0;

    ue1.RNTI = 77;

    ue1.NTxAnts = 1;

     

    pucch2.ResourceIdx = 0;

    pucch2.CyclicShifts = 6;

    pucch2.ResourceSize = 0;

     

    cqi = [0 1 1 0 0 1];

    ue1.NCellID = 0;

    ue1.NSubframe = 0;

    ue1.NULRB = 6;

    ue1.Shortened = 0;

    ue1.RNTI = 77;

    ue1.NTxAnts = 1;

     

    pucch2.ResourceIdx = 1;

    pucch2.CyclicShifts = 6;

    pucch2.ResourceSize = 0;

     

    cqi = [0 1 1 0 0 1];

PUCCH format 2 and DMRS resource element map with ResourceIdx 0

PUCCH format 2 and DMRS resource element map with ResourceIdx 1

 

ResourceIdx 0 on the left and ResourceIdx 1 on the right. Yellow is the PUCCH and green the DMRS. On the left, the PUCCH takes RB 0 in slot 0 and RB 5 in slot 1. On the right, it takes RB 1 and RB 4 instead.

 

    ue1.NCellID = 0;

    ue1.NSubframe = 0;

    ue1.NULRB = 6;

    ue1.Shortened = 0;

    ue1.RNTI = 77;

    ue1.NTxAnts = 1;

     

    pucch2.ResourceIdx = 3;

    pucch2.CyclicShifts = 6;

    pucch2.ResourceSize = 0;

     

    cqi = [0 1 1 0 0 1];

    ue1.NCellID = 0;

    ue1.NSubframe = 0;

    ue1.NULRB = 6;

    ue1.Shortened = 0;

    ue1.RNTI = 77;

    ue1.NTxAnts = 1;

     

    pucch2.ResourceIdx = 4;

    pucch2.CyclicShifts = 6;

    pucch2.ResourceSize = 0;

     

    cqi = [0 1 1 0 0 1];

PUCCH format 2 and DMRS resource element map with ResourceIdx 3

PUCCH format 2 and DMRS resource element map with ResourceIdx 4

 

ResourceIdx 3 on the left and ResourceIdx 4 on the right. Both take RB 0 in slot 0 and RB 5 in slot 1, the same RBs as ResourceIdx 0.

In every map, the DMRS take SC-FDMA symbols 1 and 5 of each slot, which are symbols 1, 5, 8 and 12 of the subframe. That is the format 2 row of 36.211 Table 5.5.2.2.2-1 for the normal cyclic prefix. The PUCCH takes the other five symbols of each slot: 0, 2, 3, 4 and 6. So 10 symbols carry the 10 QPSK symbols, one per SC-FDMA symbol.

The two slots use RBs at opposite edges of the carrier. That frequency hopping at the slot boundary gives the PUCCH frequency diversity, and it keeps the middle of the carrier free for the PUSCH. 36.211 clause 5.4.3 sets the RB from m = floor(nPUCCH(2) / 12) for format 2. ResourceIdx 0 to 11 therefore all give m = 0, which is RB 0 in slot 0 and RB 5 in slot 1.

The map for ResourceIdx 1 does not match that rule. It shows RB 1 and RB 4, which is m = 2 and would need a ResourceIdx from 24 to 35. The maps for ResourceIdx 0, 3 and 4 follow the rule, so the map labelled ResourceIdx 1 was probably generated with a different value.

  • DMRS in symbols 1 and 5 of each slot : 36.211 Table 5.5.2.2.2-1.
  • PUCCH in symbols 0, 2, 3, 4 and 6 : one QPSK symbol per SC-FDMA symbol.
  • RB at opposite edges in the two slots : hopping at the slot boundary.
  • m = floor(ResourceIdx / 12) : ResourceIdx 0 to 11 stay on RB 0 and RB 5.

Disclaimer !

This page is only to show you the overall logics and visualization for various LTE physical layer channels. I haven't investigated much about verifying about the accuracy.

If you think the code is not so efficient, it is 100% my fault. I haven't made any effort for effiecient code. I just tried to create code as simple as possible for the readers. As you know, easy-to-read code is not always efficient for a specific chipset.

If you find any mistake in terms of accuracy, it is also very highly likely be my fault. Not the problem of Matlab tool box itself.

Any comment and corrections if you find any mistake will be welcome and appreciated.

Reference

[1] 3GPP TS 36.211 v19.3.0 - clauses 5.4.2 and 5.4.3, PUCCH formats 2, 2a and 2b and mapping to physical resources, and Table 5.5.2.2.2-1, DMRS location for PUCCH

[2] 3GPP TS 36.212 v19.3.0 - clause 5.2.3.3, Channel coding for UCI channel quality information