MatLab Toolbox - LTE                                      Home : www.sharetechnote.com

 

 

 

PRACH

 

Description/explanation will come later !

 

< PRACH Configuration Setting and Retrieving PRACH Info >

 

    ue.DuplexMode = 'FDD';

    ue.NULRB = 6;

    prach_config.Format = 0;

    prach_config.HighSpeed = 0;

    prach_config.CyclicShiftIdx = 0;

    prach_config.FreqOffset = 0;

    prach_config.SeqIdx = 0;

    prach_config.PreambleIdx = [ 0 ];

     

    [prach_sym,prachInfo] = ltePRACH(ue,prach_config)

     

     

    DuplexMode='FDD';

    NULRB = 6;

    Format = 0;

    HighSpeed = 0;

    CyclicShiftIdx = 0;

    FreqOffset = 0;

    SeqIdx = 0;

    PreambleIdx = [0];

    DuplexMode='FDD';

    NULRB = 6;

    Format = 1;

    HighSpeed = 0;

    CyclicShiftIdx = 0;

    FreqOffset = 0;

    SeqIdx = 0;

    PreambleIdx = [0];

    DuplexMode='FDD';

    NULRB = 6;

    Format = 2;

    HighSpeed = 0;

    CyclicShiftIdx = 0;

    FreqOffset = 0;

    SeqIdx = 0;

    PreambleIdx = [0];

    DuplexMode='FDD';

    NULRB = 6;

    Format = 3;

    HighSpeed = 0;

    CyclicShiftIdx = 0;

    FreqOffset = 0;

    SeqIdx = 0;

    PreambleIdx = [0];

                      NZC:

        SubcarrierSpacing:

                      Phi:

                        K:

             TotSubframes:

                   Fields:

                   PRBSet:

                      NCS:

              CyclicShift:

                  RootSeq:

             SamplingRate:

               BaseOffset:

    839

    1250

    7

    12

    1

    [0 3168 24576 2976]

    [0;1;2;3;4;5]

    0

    0

    129

    1920000

    0

    839

    1250

    7

    12

    2

    [0 21024 24576 15840]

    [0;1;2;3;4;5]

    0

    0

    129

    1920000

    0

    839

    1250

    7

    12

    2

    [0 6240 49152 6048]

    [0;1;2;3;4;5]

    0

    0

    129

    1920000

    0

    839

    1250

    7

    12

    3

    [0 21024 49152 21984]

    [0;1;2;3;4;5]

    0

    0

    129

    1920000

    0

     

     

    DuplexMode='FDD';

    NULRB = 25;

    Format = 0;

    HighSpeed = 0;

    CyclicShiftIdx = 0;

    FreqOffset = 0;

    SeqIdx = 0;

    PreambleIdx = [0];

    DuplexMode='FDD';

    NULRB = 25;

    Format = 1;

    HighSpeed = 0;

    CyclicShiftIdx = 0;

    FreqOffset = 0;

    SeqIdx = 0;

    PreambleIdx = [0];

    DuplexMode='FDD';

    NULRB = 25;

    Format = 2;

    HighSpeed = 0;

    CyclicShiftIdx = 0;

    FreqOffset = 0;

    SeqIdx = 0;

    PreambleIdx = [0];

    DuplexMode='FDD';

    NULRB = 25;

    Format = 3;

    HighSpeed = 0;

    CyclicShiftIdx = 0;

    FreqOffset = 0;

    SeqIdx = 0;

    PreambleIdx = [0];

                      NZC:

        SubcarrierSpacing:

                      Phi:

                        K:

             TotSubframes:

                   Fields:

                   PRBSet:

                      NCS:

              CyclicShift:

                  RootSeq:

             SamplingRate:

               BaseOffset:

    839

    1250

    7

    12

    1

    [0 3168 24576 2976]

    [0;1;2;3;4;5]

    0

    0

    129

    7680000

    0

    839

    1250

    7

    12

    2

    [0 21024 24576 15840]

    [0;1;2;3;4;5]

    0

    0

    129

    7680000

    0

    839

    1250

    7

    12

    2

    [0 6240 49152 6048]

    [0;1;2;3;4;5]

    0

    0

    129

    7680000

    0

    839

    1250

    7

    12

    3

    [0 21024 49152 21984]

    [0;1;2;3;4;5]

    0

    0

    129

    7680000

    0

     

     

    DuplexMode='FDD';

    NULRB = 25;

    Format = 0;

    HighSpeed = 0;

    CyclicShiftIdx = 0;

    FreqOffset = 1;

    SeqIdx = 0;

    PreambleIdx = [0];

    DuplexMode='FDD';

    NULRB = 25;

    Format = 1;

    HighSpeed = 0;

    CyclicShiftIdx = 0;

    FreqOffset = 3;

    SeqIdx = 0;

    PreambleIdx = [0];

    DuplexMode='FDD';

    NULRB = 25;

    Format = 2;

    HighSpeed = 0;

    CyclicShiftIdx = 0;

    FreqOffset = 10;

    SeqIdx = 0;

    PreambleIdx = [0];

    DuplexMode='FDD';

    NULRB = 25;

    Format = 3;

    HighSpeed = 0;

    CyclicShiftIdx = 0;

    FreqOffset = 21;

    SeqIdx = 0;

    PreambleIdx = [0];

                      NZC:

        SubcarrierSpacing:

                      Phi:

                        K:

             TotSubframes:

                   Fields:

                   PRBSet:

                      NCS:

              CyclicShift:

                  RootSeq:

             SamplingRate:

               BaseOffset:

    839

    1250

    7

    12

    1

    [0 3168 24576 2976]

    [1;2;3;4;5;6]

    0

    0

    129

    7680000

    0

    839

    1250

    7

    12

    1

    [0 3168 24576 2976]

    [3;4;5;6;7;8]

    0

    0

    129

    7680000

    0

    839

    1250

    7

    12

    1

    [0 3168 24576 2976]

    [10;11;12;13;14;15]

    0

    0

    129

    7680000

    0

    Error : Because FreqOffset is set too large and not enough space for 6 RB for PRACH

     

     

    DuplexMode='FDD';

    NULRB = 25;

    Format = 0;

    HighSpeed = 0;

    CyclicShiftIdx = 0;

    FreqOffset = 0;

    SeqIdx = 0;

    PreambleIdx = [0];

    DuplexMode='FDD';

    NULRB = 25;

    Format = 1;

    HighSpeed = 0;

    CyclicShiftIdx = 0;

    FreqOffset = 0;

    SeqIdx = 0;

    PreambleIdx = [1];

    DuplexMode='FDD';

    NULRB = 25;

    Format = 2;

    HighSpeed = 0;

    CyclicShiftIdx = 0;

    FreqOffset = 0;

    SeqIdx = 0;

    PreambleIdx = [24];

    DuplexMode='FDD';

    NULRB = 25;

    Format = 3;

    HighSpeed = 0;

    CyclicShiftIdx = 0;

    FreqOffset = 0;

    SeqIdx = 0;

    PreambleIdx = [52];

                      NZC:

        SubcarrierSpacing:

                      Phi:

                        K:

             TotSubframes:

                   Fields:

                   PRBSet:

                      NCS:

              CyclicShift:

                  RootSeq:

             SamplingRate:

               BaseOffset:

    839

    1250

    7

    12

    1

    [0 3168 24576 2976]

    [0;1;2;3;4;5]

    0

    0

    129

    7680000

    0

    839

    1250

    7

    12

    1

    [0 3168 24576 2976]

    [0;1;2;3;4;5]

    0

    0

    710

    7680000

    0

    839

    1250

    7

    12

    1

    [0 3168 24576 2976]

    [0;1;2;3;4;5]

    0

    0

    56

    7680000

    0

    839

    1250

    7

    12

    1

    [0 3168 24576 2976]

    [0;1;2;3;4;5]

    0

    0

    24

    7680000

    0

 

 

< PRACH Symbol >

 

    ue.DuplexMode = 'FDD';

    ue.NULRB = 6;

    prach_config.Format = 0;

    prach_config.HighSpeed = 0;

    prach_config.CyclicShiftIdx = 0;

    prach_config.FreqOffset = 0;

    prach_config.SeqIdx = 0;

    prach_config.PreambleIdx = [ 0 ];

     

    [prach_sym,prachInfo] = ltePRACH(ue,prach_config);

    prach_arrayIndex = 0:length(prach_sym)-1;

    prach_clip = 1:62;

     

    subplot(2,3,1);

    plot(real(prach_sym),imag(prach_sym),'ro','MarkerFaceColor',[1 0 0]);axis([-0.2 0.2 -0.2 0.2]);

    title('Constellation');

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

    plot(prach_arrayIndex,real(prach_sym),'ro-',prach_arrayIndex,imag(prach_sym),'bo-');ylim([-0.2 0.2]);

    xlim([0 6000]);

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

     

    subplot(2,3,4);

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

    axis([-0.2 0.2 -0.2 0.2]);

    title('Constellation');

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

    plot(prach_arrayIndex(prach_clip),real(prach_sym(prach_clip)),'ro-',

          prach_arrayIndex(prach_clip),imag(prach_sym(prach_clip)),'bo-');

    xlim([0 max(prach_arrayIndex(prach_clip))]);ylim([-0.2 0.2]);

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

     

     

      DuplexMode='FDD';

      NULRB = 6;

      Format = 0;

      HighSpeed = 0;

      CyclicShiftIdx = 0;

      FreqOffset = 0;

      SeqIdx = 0;

      PreambleIdx = [0];

     

     

      DuplexMode='FDD';

      NULRB = 6;

      Format = 1;

      HighSpeed = 0;

      CyclicShiftIdx = 0;

      FreqOffset = 0;

      SeqIdx = 0;

      PreambleIdx = [0];

     

     

      DuplexMode='FDD';

      NULRB = 6;

      Format = 2;

      HighSpeed = 0;

      CyclicShiftIdx = 0;

      FreqOffset = 0;

      SeqIdx = 0;

      PreambleIdx = [0];

     

     

      DuplexMode='FDD';

      NULRB = 6;

      Format = 3;

      HighSpeed = 0;

      CyclicShiftIdx = 0;

      FreqOffset = 0;

      SeqIdx = 0;

      PreambleIdx = [0];

     

     

      DuplexMode='FDD';

      NULRB = 6;

      Format = 0;

      HighSpeed = 0;

      CyclicShiftIdx = 0;

      FreqOffset = 0;

      SeqIdx = 0;

      PreambleIdx = [1];

     

 

    ue.DuplexMode = 'FDD';

    ue.NULRB = 6;

     

    prach_config1.Format = 0;

    prach_config1.HighSpeed = 0;

    prach_config1.CyclicShiftIdx = 0;

    prach_config1.FreqOffset = 0;

    prach_config1.SeqIdx = 0;

    prach_config1.PreambleIdx = [ 22 ];

     

    prach_config2.Format = 0;

    prach_config2.HighSpeed = 0;

    prach_config2.CyclicShiftIdx = 0;

    prach_config2.FreqOffset = 0;

    prach_config2.SeqIdx = 0;

    prach_config2.PreambleIdx = [ 52 ];

     

    prach_config3.Format = 0;

    prach_config3.HighSpeed = 0;

    prach_config3.CyclicShiftIdx = 0;

    prach_config3.FreqOffset = 0;

    prach_config3.SeqIdx = 0;

    prach_config3.PreambleIdx = [ 24 ];

     

    [prach_sym1,prachInfo1] = ltePRACH(ue,prach_config1);

    [prach_sym2,prachInfo2] = ltePRACH(ue,prach_config2);

    [prach_sym3,prachInfo3] = ltePRACH(ue,prach_config3);

    prach_arrayIndex = 0:length(prach_sym1)-1;

    prach_clip = 1:100;

     

    subplot(3,3,1);

    plot(real(prach_sym1(prach_clip)),imag(prach_sym1(prach_clip)),'ro','MarkerFaceColor',[1 0 0]);axis([-0.2 0.2 -0.2 0.2]);

    title('Constellation');

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

    plot(prach_arrayIndex(prach_clip),real(prach_sym1(prach_clip)),'ro-',prach_arrayIndex(prach_clip),imag(prach_sym1(prach_clip)),'bo-');ylim([-0.2 0.2]);

    xlim([0 max(prach_clip)]);

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

     

    subplot(3,3,4);

    plot(real(prach_sym2(prach_clip)),imag(prach_sym2(prach_clip)),'ro','MarkerFaceColor',[1 0 0]);axis([-0.2 0.2 -0.2 0.2]);

    title('Constellation');

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

    plot(prach_arrayIndex(prach_clip),real(prach_sym2(prach_clip)),'ro-',prach_arrayIndex(prach_clip),imag(prach_sym2(prach_clip)),'bo-');ylim([-0.2 0.2]);

    xlim([0 max(prach_clip)]);

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

     

    subplot(3,3,7);

    plot(real(prach_sym3(prach_clip)),imag(prach_sym3(prach_clip)),'ro','MarkerFaceColor',[1 0 0]);axis([-0.2 0.2 -0.2 0.2]);

    title('Constellation');

    subplot(3,3,[8 9]);

    plot(prach_arrayIndex(prach_clip),real(prach_sym3(prach_clip)),'ro-',prach_arrayIndex(prach_clip),imag(prach_sym3(prach_clip)),'bo-');ylim([-0.2 0.2]);

    xlim([0 max(prach_clip)]);

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

     

     

      PreambleIdx = [22];

      PreambleIdx = [52];

      PreambleIdx = [24];

    Physical Rool Sequence = 1

    Physical Rool Sequence = 24

    Physical Rool Sequence = 56

     

      PreambleIdx = [0];

      PreambleIdx = [1];

      PreambleIdx = [2];

    Physical Rool Sequence = 129

    Physical Rool Sequence = 710

    Physical Rool Sequence = 140

 

 

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.