Matlab Toolbox - 4G/LTE

 

 

 

PRACH

 

The PRACH carries the random access preamble, the first signal a UE sends to a cell. Unlike the other uplink channels, it is not built on the SC-FDMA resource grid. The function ltePRACH returns it directly as time domain samples, together with a structure that describes how the preamble is built. This page first reads that structure for the four FDD preamble formats and then plots the samples.

Description/explanation will come later !

Followings are the topics to be covered in this page.

PRACH Configuration Setting and Retrieving PRACH Info

Which numbers decide the shape of a PRACH preamble? The code below sets the preamble format, the frequency offset and the preamble index, and ltePRACH reports the resulting parameters in prachInfo. Each table after it changes one setting and lists prachInfo for four cases.

    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

     

The table above uses 6 RB. For all four formats, NZC = 839, SubcarrierSpacing = 1250 Hz, K = 12 and Phi = 7. These are the values of 36.211 v19.3.0 Table 5.7.3-1 for formats 0 to 3. K is the ratio 15000 / 1250 between the uplink subcarrier spacing and the PRACH subcarrier spacing. So the 6 PRB of the PRACH hold 72 x 12 = 864 PRACH subcarriers. The sequence uses 839 of them, starting after an offset of Phi = 7.

Fields gives the lengths in units of Ts = 1/30.72 MHz. The last three values are the cyclic prefix, the sequence and the guard time. At the SamplingRate of 1.92 MHz, one sample is 16 Ts, so the fields convert to the sample counts in the table below. Each format fills exactly TotSubframes subframes of 1920 samples.

 

Format

Cyclic prefix

Sequence

Guard time

Total samples at 1.92 MHz

TotSubframes

0

3168 Ts, 198 samples

24576 Ts, 1536 samples

2976 Ts, 186 samples

1920

1

1

21024 Ts, 1314 samples

24576 Ts, 1536 samples

15840 Ts, 990 samples

3840

2

2

6240 Ts, 390 samples

49152 Ts, 3072 samples

6048 Ts, 378 samples

3840

2

3

21024 Ts, 1314 samples

49152 Ts, 3072 samples

21984 Ts, 1374 samples

5760

3

 

Formats 1 and 3 have a long cyclic prefix and a long guard time for large cells. Formats 2 and 3 repeat the sequence twice, which doubles its energy for cells with poor coverage. RootSeq = 129 is the physical root of logical root sequence 0, the first entry of 36.211 Table 5.7.2-4.

     

     

    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

     

With 25 RB, every field is the same, and only SamplingRate changes to 7.68 MHz. The preamble has a fixed bandwidth of about 1.05 MHz, so the carrier bandwidth changes only the sample rate of the output, not the preamble itself.

     

     

    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

     

FreqOffset moves the 6 PRB of the PRACH up the carrier. PRBSet starts at FreqOffset, so the offsets 1, 3 and 10 give RB 1 to 6, RB 3 to 8 and RB 10 to 15. With 25 RB, the last usable start is RB 19, because the PRACH needs 6 PRB inside RB 0 to 24. So FreqOffset = 21 gives an error. The prachInfo columns of this table show TotSubframes = 1 and the Fields of format 0 for all three rows, although the settings list formats 1 and 2. They were probably captured with Format = 0, and PRBSet is the value to read here.

     

     

    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

     

PreambleIdx selects one of the 64 preambles of the cell. CyclicShiftIdx = 0 gives NCS = 0 in 36.211 Table 5.7.2-2, so each root sequence provides only one preamble. The 64 preambles then use 64 consecutive logical roots, and PreambleIdx n takes logical root n. That gives the RootSeq values 129, 710, 56 and 24 for PreambleIdx 0, 1, 24 and 52, as Table 5.7.2-4 lists them. Here too, the Fields show format 0 in all four rows, although the settings list formats 0 to 3.

  • NZC 839, 1250 Hz, K 12, Phi 7 : the same for formats 0 to 3.
  • Formats fill 1, 2, 2 and 3 subframes : cyclic prefix, sequence and guard time in Ts.
  • FreqOffset sets the first of 6 PRB : 21 does not fit into 25 RB.
  • PreambleIdx n uses logical root n : when NCS = 0.

PRACH Symbol

What do the preamble samples look like? The code below plots the output of ltePRACH for each format. The upper row of each plot shows the whole output, and the lower row shows the first 62 samples, which belong to the cyclic prefix.

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

In the upper row, the samples stay inside a circle of radius about 0.1. The signal ends before the end of the output, and the flat line after it is the guard time. With format 0 at 1.92 MHz, the signal lasts 198 + 1536 = 1734 samples of the 1920.

     

      DuplexMode='FDD';

      NULRB = 6;

      Format = 0;

      HighSpeed = 0;

      CyclicShiftIdx = 0;

      FreqOffset = 0;

      SeqIdx = 0;

      PreambleIdx = [0];

     

    Constellation and time domain samples of PRACH preamble format 0

     

Preamble format 0 with 6 RB. The signal ends at sample 1734, and the guard time fills the rest of the subframe.

     

      DuplexMode='FDD';

      NULRB = 6;

      Format = 1;

      HighSpeed = 0;

      CyclicShiftIdx = 0;

      FreqOffset = 0;

      SeqIdx = 0;

      PreambleIdx = [0];

     

    Constellation and time domain samples of PRACH preamble format 1

     

Preamble format 1. The signal lasts 1314 + 1536 = 2850 samples, and the output is two subframes, 3840 samples, long.

The two plots below show formats 2 and 3, which repeat the sequence. Their signals end at 390 + 3072 = 3462 samples and 1314 + 3072 = 4386 samples. The lower row of format 3 is the same as that of format 1. Both formats have the same cyclic prefix length, so their first samples come from the same part of the sequence.

     

      DuplexMode='FDD';

      NULRB = 6;

      Format = 2;

      HighSpeed = 0;

      CyclicShiftIdx = 0;

      FreqOffset = 0;

      SeqIdx = 0;

      PreambleIdx = [0];

     

    Constellation and time domain samples of PRACH preamble format 2

     

Preamble format 2. The signal ends at sample 3462.

     

      DuplexMode='FDD';

      NULRB = 6;

      Format = 3;

      HighSpeed = 0;

      CyclicShiftIdx = 0;

      FreqOffset = 0;

      SeqIdx = 0;

      PreambleIdx = [0];

     

    Constellation and time domain samples of PRACH preamble format 3

     

Preamble format 3. The signal ends at sample 4386, and the first 62 samples are the same as for format 1.

Preamble Index and Root Sequence

The preamble index changes the root sequence, and with it every sample of the preamble. The plots below compare several preamble indices of format 0. Each lists the physical root that Table 5.7.2-4 gives for its logical root.

     

      DuplexMode='FDD';

      NULRB = 6;

      Format = 0;

      HighSpeed = 0;

      CyclicShiftIdx = 0;

      FreqOffset = 0;

      SeqIdx = 0;

      PreambleIdx = [1];

     

    Constellation and time domain samples of PRACH preamble format 0 with PreambleIdx 1

     

PreambleIdx = 1, physical root 710. The envelope is the same as for PreambleIdx 0, and the samples differ.

    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

    Constellation and time domain samples of PRACH preamble format 0 with PreambleIdx 22, 52 and 24

     

PreambleIdx 22, 52 and 24 from top to bottom, with the physical roots 1, 24 and 56. Only the first 100 samples are shown.

     

      PreambleIdx = [0];

      PreambleIdx = [1];

      PreambleIdx = [2];

    Physical Rool Sequence = 129

    Physical Rool Sequence = 710

    Physical Rool Sequence = 140

    Constellation and time domain samples of PRACH preamble format 0 with PreambleIdx 0, 1 and 2

     

PreambleIdx 0, 1 and 2 with the physical roots 129, 710 and 140. The top row starts with the same samples as the lower row of the format 0 plot above.

Table 5.7.2-4 lists the physical roots in pairs u and 839 - u, such as 129 and 710 or 1 and 838. The Zadoff-Chu sequence of root 839 - u is the complex conjugate of the sequence of root u. Root 1 stands out in the plot of PreambleIdx 22: its samples keep an almost constant magnitude and form a ring, while the other roots fill a disc.

  • One root per preamble with NCS = 0 : PreambleIdx n uses logical root n.
  • Logical roots come in pairs u and 839 - u : 129 and 710, 140 and 699.
  • Format 1 and 3 start alike : the same cyclic prefix length.

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 - clause 5.7, Physical random access channel: Tables 5.7.1-1, 5.7.2-2, 5.7.2-4 and 5.7.3-1