Main Content

nrWaveformGenerator

Generate 5G NR waveform

Description

example

[wave,info] = nrWaveformGenerator(cfg) generates 5G NR waveform wave for the specified configuration cfg. The input cfg contains configuration parameters for single or multiple subcarrier spacing (SCS) carriers, bandwidth parts (BWPs), synchronization signal (SS) burst, control-resource sets (CORESETs), search spaces, physical shared channels and control channels and associated reference signals, and channel-state information reference signals (CSI-RS). The function also returns a structure, info, containing information about the resource grid, physical downlink shared channels (PDSCH), and physical downlink control channels (PDCCH).

nrWaveformGenerator opens the 5G Waveform Generator app.

Examples

collapse all

Create an SCS carrier configuration object with the default SCS of 15 kHz and 100 resource blocks.

carrier = nrSCSCarrierConfig('NSizeGrid',100);

Create a customized BWP configuration object for the SCS carrier.

bwp = nrWavegenBWPConfig('NStartBWP',carrier.NStartGrid+10);

Create an SS burst configuration object with block pattern Case A.

ssb = nrWavegenSSBurstConfig('BlockPattern','Case A');

Create a PDCCH configuration object, specifying an aggregation of size two and the fourth candidate for the PDCCH instance.

pdcch = nrWavegenPDCCHConfig('AggregationLevel',2,'AllocatedCandidate',4);

Create a CORESET configuration object, specifying four frequency resources and a duration of three OFDM symbols.

coreset = nrCORESETConfig;
coreset.FrequencyResources = [1 1 1 1];
coreset.Duration = 3;

Create a search space set configuration object, specifying two aggregation levels.

ss = nrSearchSpaceConfig;
ss.NumCandidates = [8 4 0 0 0];

Create a PDSCH configuration object, specifying the modulation scheme and the target code rate. Enable the PDSCH PT-RS.

pdsch = nrWavegenPDSCHConfig( ...
    'Modulation','16QAM','TargetCodeRate',658/1024,'EnablePTRS',true);

Create a PDSCH DM-RS and a PDSCH PT-RS configuration object with the specified property values.

dmrs = nrPDSCHDMRSConfig('DMRSTypeAPosition',3);
pdsch.DMRS = dmrs;
ptrs = nrPDSCHPTRSConfig('TimeDensity',2);
pdsch.PTRS = ptrs;

Create a CSI-RS configuration object with the specified property values.

csirs = nrWavegenCSIRSConfig('RowNumber',4,'RBOffset',10);

Create a single-user 5G downlink waveform configuration object, specifying the previously defined configurations.

cfgDL = nrDLCarrierConfig( ...
    'FrequencyRange','FR1', ...
    'ChannelBandwidth',40, ...
    'NumSubframes',20, ...
    'SCSCarriers',{carrier}, ...
    'BandwidthParts',{bwp}, ...
    'SSBurst',ssb, ...
    'CORESET',{coreset}, ...
    'SearchSpaces',{ss}, ...
    'PDCCH',{pdcch}, ...
    'PDSCH',{pdsch}, ...
    'CSIRS',{csirs});

Generate a 5G downlink waveform using the specified configuration.

waveform = nrWaveformGenerator(cfgDL);

Create two SCS carrier configuration objects with mixed numerologies and custom numbers of resource blocks.

carriers = {
    nrSCSCarrierConfig('SubcarrierSpacing',15,'NStartGrid',10,'NSizeGrid',100), ...
    nrSCSCarrierConfig('SubcarrierSpacing',30,'NStartGrid',0,'NSizeGrid',70)};
    

Create two custom BWP configuration objects, one for each of the carriers.

bwp = {
    nrWavegenBWPConfig('BandwidthPartID',1,'SubcarrierSpacing',15,'NStartBWP',10,'NSizeBWP',80), ...
    nrWavegenBWPConfig('BandwidthPartID',2,'SubcarrierSpacing',30,'NStartBWP',0,'NSizeBWP',60)};

Create an SS burst configuration object with block pattern Case A, corresponding to an SCS of 15 kHz.

ssb = nrWavegenSSBurstConfig('BlockPattern','Case A');

Create two PDCCH configuration objects.

pdcch = {
    nrWavegenPDCCHConfig('SearchSpaceID',1,'BandwidthPartID',1,'RNTI',1,'DMRSScramblingID',1), ...
    nrWavegenPDCCHConfig('SearchSpaceID',2,'BandwidthPartID',2,'RNTI',2,'DMRSScramblingID',2, ...
        'AggregationLevel',4)};
    

Create two CORESET configuration objects and two search space set configuration objects for the two PDCCH.

coreset = {
    nrCORESETConfig('CORESETID',1,'FrequencyResources',[1 1 1 1 1 0 0 0 0 0 1],'Duration',3), ...
    nrCORESETConfig('CORESETID',2,'FrequencyResources',[0 0 0 0 0 0 0 0 1 1])};

ss = {
    nrSearchSpaceConfig('SearchSpaceID',1,'CORESETID',1,'StartSymbolWithinSlot',4), ...
    nrSearchSpaceConfig('SearchSpaceID',2,'CORESETID',2,'NumCandidates',[8 8 4 0 0])};

Create two PDSCH configuration objects with mixed modulation schemes.

pdsch = {
    nrWavegenPDSCHConfig('BandwidthPartID',1,'Modulation','16QAM','RNTI',1,'NID',1), ...
    nrWavegenPDSCHConfig('BandwidthPartID',2,'Modulation','QPSK','RNTI',2,'NID',2, ...
            'PRBSet', 50:59)};

Create two CSI-RS configuration objects.

 csirs = {
     nrWavegenCSIRSConfig('BandwidthPartID',1,'RowNumber',2,'RBOffset',10), ... 
     nrWavegenCSIRSConfig('BandwidthPartID',2,'Density','three','RowNumber',4)};

Create a multiuser 5G downlink waveform configuration object, specifying the previously defined configurations.

cfgDL = nrDLCarrierConfig( ...
    'FrequencyRange','FR1', ...
    'ChannelBandwidth',40, ...
    'NumSubframes',20, ...
    'SCSCarriers',carriers, ...
    'BandwidthParts',bwp, ...
    'SSBurst',ssb, ...
    'CORESET',coreset, ...
    'SearchSpaces',ss, ...
    'PDCCH',pdcch, ...
    'PDSCH',pdsch, ...
    'CSIRS',csirs);

Generate a 5G downlink waveform using the specified configuration.

waveform = nrWaveformGenerator(cfgDL);

Input Arguments

collapse all

Configuration parameters for 5G NR waveform generation, specified as an nrDLCarrierConfig object.

Output Arguments

collapse all

Time-domain 5G NR waveform, returned as a complex matrix. The number of matrix columns correspond to the number of transmit antennas.

Data Types: double
Complex Number Support: Yes

Metadata of 5G waveform, returned as a structure with these fields.

BWP information, returned as a structure with these fields.

FieldsValuesDescription
ResourceGridBWPComplex 2-D or 3-D arrayBWP resource grid
ResourceGridInCarrierComplex 2-D or 3-D arrayBWP resource grid in carrier
InfoStructure array

Each structure in the array contains these fields.

FieldsValuesDescription
NfftPositive integerNumber of fast Fourier transform (FFT) points
SampleRateReal numberWaveform sample rate
CyclicPrefixLengthsRow vector of positive integersCyclic prefix lengths of each OFDM symbol in a subframe, in samples
SymbolLengthsRow vector of positive integersOFDM symbol lengths, in samples
WindowingPositive integerNumber of time-domain samples over which the function applies raised cosine windowing and overlapping of OFDM symbols
SymbolPhasesInteger vector

Phase compensation of each OFDM symbol, in radians

SymbolsPerSlot12 or 14Number of OFDM symbols in a slot
SlotsPerSubframe1, 2, 4, or 8 Number of slots in a 1 ms subframe
SlotsPerFramePositive integerNumber of slots in a 10 ms frame
k0Nonnegative integerFrequency starting position per antenna port and OFDM symbol

Channel information, returned as a structure with these fields.

FieldsValuesDescription
PDCCH

1-by-NPDCCH structure array, where NPDCCH is the number of configured PDCCH in input cfg

Each structure in the array contains these fields.

FieldsValuesDescription
NameCharacter arrayName of PDCCH configuration
CDMLengthsTwo-element integer vectorCDM arrangement for reference signals
Resources

1-by-MPDCCH structure array, where MPDCCH is the number of allocated slots for the specified PDCCH

Each structure in the array contains these fields.

FieldsValuesDescription
NSlotNonnegative integerSlot number
DCIBitsBinary column vectorDownlink control information (DCI) bits
CodewordBinary column vectorEncoded DCI codeword
GNonnegative integerBit capacity of the PDCCH
GdNonnegative integerNumber of resource elements per layer or port
ChannelIndicesColumn vector of positive integersPDCCH indices
ChannelSymbolsComplex column vectorPDCCH symbols
DMRSIndicesColumn vector of positive integersPDCCH demodulation reference signal (DM-RS) indices
DMRSSymbolsComplex column vectorPDCCH DM-RS symbols

PDSCH

1-by-NPDSCH structure array, where NPDSCH is the number of configured PDSCH in cfg

Each structure in the array contains these fields.

FieldsValuesDescription
NameCharacter arrayName of PDSCH configuration
CDMLengthsTwo-element integer vectorCDM arrangement for reference signals
Resources

1-by-MPDSCH structure array, where MPDSCH is the number of allocated slots for the specified PDSCH)

Each structure in the array contains these fields.

FieldsValues 
NSlotNonnegative integerSlot number
TransportBlockSizeNonnegative integerSize of PDSCH transport block
TransportBlockBinary column vectorPDSCH transport block
RVNonnegative integerRedundancy version
CodewordBinary column vectorCodeword from DL-SCH transport channel
GNonnegative integerBit capacity of the PDSCH. This value is equal to the length of the codeword from the DL-SCH transport channel.
GdNonnegative integer

Number of resource elements per layer or port

ChannelIndicesColumn vector of positive integersPDSCH indices
ChannelSymbolsComplex column vectorPDSCH symbols
DMRSIndicesColumn vector of positive integersPDSCH DM-RS indices
DMRSSymbolsComplex column vectorPDSCH DM-RS symbols
DMRSSymbolSetVector of nonnegative integers

OFDM symbol locations in a slot containing the DM-RS (0-based)

PTRSIndicesColumn vector of positive integersPDSCH phase tracking reference signal (PT-RS) indices
PTRSSymbolsComplex column vectorPDSCH PT-RS symbols
PTRSSymbolSetVector of nonnegative integers

OFDM symbol locations in a slot containing PT-RS (0-based)

Data Types: struct

See Also

Objects

Introduced in R2020b