MatLab Toolbox - LTE                                      Home : www.sharetechnote.com

 

 

 

PUCCH Format 2

 

Description/explanation will come later !

 

< Generation of PUCCH Format 1 Symbol >

    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');

     

      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];

     

     

      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];

     

     

      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];

     

 

< Symbol to RE Mapping >

 

    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]]);

     

    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];

 

     

    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];

 

 

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.