Main Content

nrPDSCHPrecode

Precoding for PDSCH PRG bundling

Since R2023b

    Description

    [antSym,antInd] = nrPDSCHPrecode(carrier,portSym,portInd,W) performs the precoding for the PDSCH precoding resource block group (PRG) bundling, as defined in TS 38.214 Section 5.1.2.3. The function returns antSym, the PDSCH precoded symbols, and antInd, the corresponding PDSCH antenna indices.

    example

    Examples

    collapse all

    Configure a carrier object and specify the number of transmit antennas.

    carrier = nrCarrierConfig;
    carrier.NSizeGrid = 18;
    carrier.NStartGrid = 1;
    ntxants = 4;

    Create the carrier grid.

    txgrid = nrResourceGrid(carrier,ntxants);

    Configure the PDSCH parameters.

    pdsch = nrPDSCHConfig;
    pdsch.Modulation = 'QPSK';
    pdsch.NumLayers = 2;
    pdsch.DMRS.NumCDMGroupsWithoutData = 1;

    Create PDSCH indices for a PDSCH allocated in resource blocks 2 to 16 and 7 OFDM symbols starting at symbol 1. These indices are zero-based.

    pdsch.PRBSet = 2:16;
    pdsch.SymbolAllocation = [1 7];
    [portInd,indinfo] = nrPDSCHIndices(carrier,pdsch);

    Create a PDSCH codeword and perform PDSCH modulation.

    cw = randi([0 1],indinfo.G(1),1);
    portSym = nrPDSCH(carrier,pdsch,cw);

    Create precoding matrices.

    prgSize = 4;
    prgInfo = nrPRGInfo(carrier,prgSize);
    NPRG = prgInfo.NPRG;
    W = eye(pdsch.NumLayers,ntxants);
    W = reshape(kron(2:(NPRG+1),W),pdsch.NumLayers,ntxants,[]);

    Perform PRG precoding.

    [antSym,antInd] = nrPDSCHPrecode(carrier,portSym,portInd,W);

    Map the precoded PDSCH to the carrier grid.

    txgrid(antInd) = antSym;

    Plot the carrier grid to show the PRGs. The PRGs align with common resoure block (CRB) 0, so only the last physical resource block (PRB) of the first PRG overlaps with the PDSCH allocation. The first CRB (0) is outside the carrier grid because carrier.NStartGrid=1, and the next two CRBs (1 and 2) are outside the PDSCH allocation because pdsch.PRBSet starts as 2.

    The last PRG in the allocation can be partial, depending on the allocation size and alignment.

    figure;
    imagesc(abs(txgrid(:,:,1)));
    axis xy;
    title('PDSCH PRG Bundling');
    xlabel('OFDM Symbols');
    ylabel('Subcarriers');
    hold on;
    for i = 1:NPRG
        patch(NaN,NaN,i+1);
    end
    legend("PRG " + (1:NPRG));

    Figure contains an axes object. The axes object with title PDSCH PRG Bundling, xlabel OFDM Symbols, ylabel Subcarriers contains 6 objects of type image, patch. These objects represent PRG 1, PRG 2, PRG 3, PRG 4, PRG 5.

    Create carrier and PDSCH configuration objects with default parameters.

    carrier = nrCarrierConfig;
    pdsch = nrPDSCHConfig;

    Get OFDM information for the carrier configuration.

    ofdmInfo = nrOFDMInfo(carrier);

    Create an nrTDLChannel System object™.

    tdl = nrTDLChannel;
    P = 3;
    tdl.NumTransmitAntennas = 3;
    tdl.ChannelFiltering = false;
    tdl.SampleRate = ofdmInfo.SampleRate;
    tdl.NumTimeSamples = tdl.SampleRate * 1e-3;

    Specify a PRG bundle size of 2. Get the PRG information for the bundle size and carrier configuration.

    prgSize = 2;
    prgInfo = nrPRGInfo(carrier,prgSize);

    Get PDSCH indices for the carrier and PDSCH configurations.

    portInd = nrPDSCHIndices(carrier,pdsch);

    Create a random precoding matrix.

    nLayers = pdsch.NumLayers;
    nPRG = prgInfo.NPRG;
    W = complex(randn([nLayers P nPRG]),randn([nLayers P nPRG]));

    Get the path gains and path filter impulse responses for the channel.

    pathGains = tdl();
    pathFilters = getPathFilters(tdl);

    Perform channel estimation, extract PDSCH resources, and apply precoding. In this case, the output represents the effective channel between receive antennas and transmit layers.

    H = nrPerfectChannelEstimate(carrier,pathGains,pathFilters);
    [symH,indH] = nrExtractResources(portInd,H);
    pdschH = nrPDSCHPrecode(carrier,symH,indH,permute(W,[2 1 3]));

    Input Arguments

    collapse all

    Carrier configuration parameters, specified as an nrCarrierConfig object. Only these object properties are relevant for this function.

    PDSCH symbols, specified as one of these values:

    • Complex matrix of size NRE-by-NLAYERS, where NRE is the number of resource elements and NLAYERS is the number of layers.

    • Complex 3-D array of size NRE-by-R-by-P, where R is the number of receive antennas and P is the number of transmit antennas. This array represents the symbols of a PDSCH channel estimate.

    This input and the portInd input must have equal sizes.

    Data Types: double | single
    Complex Number Support: Yes

    PDSCH indices, specified as one of these values:

    • Matrix of positive integers of size NRE-by-NLAYERS.

    • 3-D array of positive integers of size NRE-by-R-by-P. This array represents the indices of a PDSCH channel estimate.

    Data Types: double

    Precoding matrices, specified as one of these values:

    • Complex 3-D array of size NLAYERS-by-P-by-NPRG, where NPRG is the number of precoding resource block groups (PRGs) in the carrier resource grid. Use this size when you specify portSym and portInd as matrices.

    • Complex 3-D array of size P-by-NLAYERS-by-NPRG, where NPRG. Use this size when you specify portSym and portInd as 3-D arrays.

    This input contains one precoding matrix for each PRG.

    Data Types: double | single
    Complex Number Support: Yes

    Output Arguments

    collapse all

    Precoded PDSCH symbols, returned as one of these values:

    • Complex matrix of size NRE-by-P.

    • Complex 3-D array of size NRE-by-R-by-NLAYERS. This array represents the effective channel between receive antennas and transmit layers. You can use this option to precode a PDSCH allocation that you extracted from the channel estimate returned by the nrPerfectChannelEstimate function.

    The function returns a matrix when you specify portSym and portInd as matrices, and a 3-D array when you specify them as 3-D arrays.

    Data Types: double | single
    Complex Number Support: Yes

    Precoded PDSCH antenna indices, returned as one of these values:

    • Matrix of positive integers of size NRE-by-P.

    • 3-D array of positive integers of size NRE-by-R-by-NLAYERS. This corresponds to the situation when portSym, portInd, and antSym are 3-D arrays.

    Data Types: double | single

    References

    [1] 3GPP TS 38.214. “NR; Physical layer procedures for data.” 3rd Generation Partnership Project; Technical Specification Group Radio Access Network.

    [2] 3GPP TS 38.211. “NR; Physical channels and modulation.” 3rd Generation Partnership Project; Technical Specification Group Radio Access Network.

    Extended Capabilities

    C/C++ Code Generation
    Generate C and C++ code using MATLAB® Coder™.

    Version History

    Introduced in R2023b

    See Also

    Functions

    Objects