Matlab Toolbox - 4G/LTE
The PUSCH DMRS is the reference signal that the eNB uses to estimate the uplink channel and demodulate the PUSCH. It occupies one SC-FDMA symbol in each slot, across the same RBs as the PUSCH. This page generates the DMRS with ltePUSCHDRS and maps it onto the uplink resource grid with ltePUSCHDRSIndices.
Description/explanation will come later !
Followings are the topics to be covered in this page.
Generation of PUSCH DMRS Symbol
What values does the UE send as PUSCH DMRS? The values follow from a small set of parameters: the cell ID, the sequence group, the cyclic shifts and the number of allocated RBs. This example sets all of them to their simplest values and plots the result.
ue1.NCellID = 0;
ue1.CyclicPrefixUL = 'Normal';
ue1.NSubframe = 0;
ue1.Hopping = 'Off';
ue1.NULRB = 25;
ue1.Shortened = 0;
ue1.NTxAnts = 1;
ue1.SeqGroup = 0;
ue1.CyclicShift = 0;
ue1.RNTI = 1;
pusch.PRBSet = (0:5).';
pusch.Modulation = 'QPSK';
pusch.RV = 0;
pusch.DynCyclicShift = 0;
pusch.NLayers = 1;
pusch.OrthCover = 'Off';
pusch_dmrs_sym = ltePUSCHDRS(ue1,pusch);
pusch_dmrs_sym_arrayIndex = 0:length(pusch_dmrs_sym)-1;
pusch_dmrs_sym_ind = ltePUSCHDRSIndices(ue1,pusch);
subplot(1,3,1);
plot(real(pusch_dmrs_sym),imag(pusch_dmrs_sym),'ro','MarkerFaceColor',[1 0 0]);
title('Constellation');
subplot(1,3,[2 3]);
plot(pusch_dmrs_sym_arrayIndex,real(pusch_dmrs_sym),'ro-',pusch_dmrs_sym_arrayIndex,imag(pusch_dmrs_sym),'bo-');
xlim([0 max(pusch_dmrs_sym_arrayIndex)]);
title('PUSCH DMRS index vs PUSCH DMRS value. Red -> real, Blue -> Imaginary');
The allocation is RB 0 to 5, so the DMRS spans 6 x 12 = 72 subcarriers in each slot. The function returns one value per subcarrier and per slot, which gives 144 values for the subframe. The length depends only on the number of allocated RBs. The carrier size NULRB does not change it, which is why the parameter table beside the plot can list NULRB = 6 while the code sets 25.
The DMRS is a cyclically shifted base sequence, defined in 36.211 v19.3.0 clause 5.5.1. For 3 RB or more, the base sequence is a Zadoff-Chu sequence whose length is the largest prime below the sequence length. Here that prime is 71, and the sequence is extended cyclically to 72. With Hopping = 'Off' and SeqGroup = 0, the sequence group u is 0 and the base sequence number v is 0.
The cyclic shift combines three parts (clause 5.5.2.1.1). CyclicShift = 0 gives nDMRS(1) = 0 from Table 5.5.2.1.1-2, and DynCyclicShift = 0 gives nDMRS(2) = 0 from Table 5.5.2.1.1-1. The third part, nPN(ns), is a pseudo-random value per slot, so the two slots can use different cyclic shifts even with both fields at 0.
The plot below shows the constellation on the left, and the real and imaginary parts of each value against its index on the right.
|
ue1.NCellID = 0; ue1.NSubframe = 0; ue1.NULRB = 6; ue1.Shortened = 0; ue1.NTxAnts = 1;
pusch.PRBSet = (0:5).'; pusch.Modulation = 'QPSK'; pusch.RV = 0; pusch.DynCyclicShift = 0; |
|
|
|
|
PUSCH DMRS for RB 0 to 5. All 144 values lie on the unit circle. Red is the real part and blue the imaginary part, indices 0 to 143.
Every value lies on the unit circle, because a Zadoff-Chu sequence has constant amplitude and a cyclic shift only rotates the phase. This constant amplitude gives the DMRS a low peak-to-average power ratio, which matters for the UE power amplifier. Indices 0 to 71 belong to slot 0, and indices 72 to 143 to slot 1.
144 values for 6 RB : 72 subcarriers in each of the two slots.Zadoff-Chu base sequence of length 71 : cyclically extended to 72.u = 0 and v = 0 : Hopping 'Off' and SeqGroup 0.Constant amplitude : all values on the unit circle.
Symbol to RE Mapping
Where does the DMRS sit in the uplink subframe? This section places the DMRS values into an uplink resource grid and plots the grid. It does this once for a 6 RB carrier and once for a 25 RB carrier with the same 6 RB allocation.
ue1.NCellID = 0;
ue1.CyclicPrefixUL = 'Normal';
ue1.NSubframe = 0;
ue1.Hopping = 'Off';
ue1.NULRB = 25;
ue1.Shortened = 0;
ue1.NTxAnts = 1;
ue1.SeqGroup = 0;
ue1.CyclicShift = 0;
ue1.RNTI = 1;
pusch.PRBSet = (0:5).';
pusch.Modulation = 'QPSK';
pusch.RV = 0;
pusch.DynCyclicShift = 0;
pusch.NLayers = 1;
pusch.OrthCover = 'Off';
pusch_dmrs_sym = ltePUSCHDRS(ue1,pusch);
pusch_dmrs_sym_arrayIndex = 0:length(pusch_dmrs_sym)-1;
pusch_dmrs_sym_ind = ltePUSCHDRSIndices(ue1,pusch);
resourceGridUL = lteULResourceGrid(ue1);
pusch_dmrs_scale = 0.5;
resourceGridUL(pusch_dmrs_sym_ind) = pusch_dmrs_scale * pusch_dmrs_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 fills an empty grid from lteULResourceGrid with the DMRS scaled by 0.5, and leaves every other RE at zero. It then adds one column and one row to the grid. The function surface draws one cell between each pair of vertices, so a grid of 14 columns needs 15 vertices to show all 14 symbols. The extra row and column only complete the plot and carry no data.
The two plots below show the grid for NULRB = 6 on the left and NULRB = 25 on the right. The yellow columns are the DMRS, and the dark blue area is empty.
|
ue1.NCellID = 0; ue1.NSubframe = 0; ue1.NULRB = 6; ue1.Shortened = 0; ue1.NTxAnts = 1;
pusch.PRBSet = (0:5).'; pusch.Modulation = 'QPSK'; pusch.RV = 0; pusch.DynCyclicShift = 0; |
ue1.NCellID = 0; ue1.NSubframe = 0; ue1.NULRB = 25; ue1.Shortened = 0; ue1.NTxAnts = 1;
pusch.PRBSet = (0:5).'; pusch.Modulation = 'QPSK'; pusch.RV = 0; pusch.DynCyclicShift = 0; |
|
|
|
Left, 6 RB: the DMRS fills symbols 3 and 10 across all 72 subcarriers. Right, 25 RB: the DMRS fills the same symbols on subcarriers 0 to 71 only.
With the normal cyclic prefix, the PUSCH DMRS takes symbol 3 of each slot, which is symbol 3 and symbol 10 of the subframe (36.211 clause 5.5.2.1.2). It sits in the middle of the slot, so the channel estimate is equally close to the data symbols on both sides. The SC-FDMA symbols 0 to 2, 4 to 9 and 11 to 13 are left for the PUSCH data.
In the 25 RB grid, the DMRS covers only subcarriers 0 to 71, the six allocated RBs. The DMRS always spans exactly the PUSCH allocation, so the eNB estimates the channel only where the UE transmits data. The horizontal dark bands in the 25 RB plot come from the dense cell edges that surface draws, not from the grid values.
DMRS in symbols 3 and 10 : the middle symbol of each slot, normal CP.DMRS only on the allocated RBs : subcarriers 0 to 71 for RB 0 to 5.Extra row and column : needed by surface, no data.
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.5.1, Generation of the reference signal sequence, and clause 5.5.2.1, Demodulation reference signal for PUSCH
[2] PUSCH DMRS, the specification page on this site


