main content

5g nr uplink vector waveform generation -凯发k8网页登录

this example shows how to configure and generate a 5g nr uplink vector waveform with physical uplink shared channel (pusch) and sounding reference signal (srs) for a baseband component carrier by using the function.

introduction

this example shows how to parameterize and generate a 5g new radio (nr) uplink waveform by using the nrwaveformgenerator function. the generated waveform contains these channels and signals.

  • pusch and its associated demodulation reference signal (dm-rs) and phase-tracking reference signal (pt-rs)

  • srs

the baseband component carrier waveform in this example is characterized by multiple subcarrier spacing (scs) carriers and bandwidth parts (bwp), and multiple sequences of pusch and srs transmission instances over the different bwps. the example also shows how to parameterize and generate uplink control information (uci) on pusch with cg-uci and srs for positioning.

for an example on how to generate a 5g uplink waveform with physical uplink control channel (pucch), see .

waveform and carrier configuration

use the object to parameterize the baseband waveform generation. this object contains a set of additional objects associated with the waveform channels and signals and enables you to set these uplink carrier configuration parameters.

  • label for this ul carrier configuration

  • scs carrier bandwidth in resource blocks

  • carrier cell id

  • length of the generated waveform in subframes

  • windowing

  • sample rate of the ofdm-modulated waveform

  • carrier frequency for symbol phase compensation

you can control scs carrier bandwidths and guardbands using the nstartgrid and nsizegrid properties of the object.

waveconfig = nrulcarrierconfig;    % create an uplink carrier configuration object
waveconfig.label = 'ul carrier 1'; % label for this uplink waveform configuration
waveconfig.ncellid = 0;            % cell identity
waveconfig.channelbandwidth = 40;  % channel bandwidth (mhz)
waveconfig.frequencyrange = 'fr1'; % 'fr1' or 'fr2'
waveconfig.numsubframes = 10;      % number of 1 ms subframes in generated waveform (1, 2, 4, 8 slots per 1 ms subframe, depending on scs)
waveconfig.windowingpercent = 0;   % percentage of windowing relative to fft length
waveconfig.samplerate = [];        % sample rate of the ofdm-modulated waveform
waveconfig.carrierfrequency = 0;   % carrier frequency in hz. this property is used for symbol phase
                                   % compensation before ofdm modulation
% define a set of scs-specific carriers, using the maximum sizes for a
% 40 mhz nr channel. see ts 38.101-1 for more information on defined
% bandwidths and guardband requirements.
scscarriers = {nrscscarrierconfig,nrscscarrierconfig};
scscarriers{1}.subcarrierspacing = 15;
scscarriers{1}.nsizegrid = 216;
scscarriers{1}.nstartgrid = 0;
scscarriers{2}.subcarrierspacing = 30;
scscarriers{2}.nsizegrid = 106;
scscarriers{2}.nstartgrid = 1;

bwps

a bwp is formed by a set of contiguous resources sharing a numerology on a given scs carrier. you can define multiple bwps using a cell array. each element in the cell array of objects defines a bwp. for each bwp, you can specify the scs, the cyclic prefix (cp) length, and the bandwidth. the subcarrierspacing property links the bwp to one of the scs specific carriers defined earlier. the nstartbwp property controls the location of the bwp in the carrier, relative to point a. nstartbwp is expressed in common resource blocks (crb) in terms of the bwp numerology. different bwps can overlap with each other.

% bwp configurations
bwp = {nrwavegenbwpconfig,nrwavegenbwpconfig};
bwp{1}.bandwidthpartid = 1;        % bwp id
bwp{1}.label = 'bwp 1 @ 15 khz';   % label for this bwp
bwp{1}.subcarrierspacing = 15;     % bwp subcarrier spacing
bwp{1}.cyclicprefix = 'normal';    % bwp cyclic prefix for 15 khz
bwp{1}.nsizebwp = 25;              % size of bwp in prbs
bwp{1}.nstartbwp = 10;             % position of bwp, relative to point a, in crbs
bwp{2}.bandwidthpartid = 2;        % bwp id
bwp{2}.label = 'bwp 2 @ 30 khz';   % label for this bwp
bwp{2}.subcarrierspacing = 30;     % bwp subcarrier spacing
bwp{2}.cyclicprefix = 'normal';    % bwp cyclic prefix for 30 khz
bwp{2}.nsizebwp = 51;              % size of bwp in prbs
bwp{2}.nstartbwp = 40;             % position of bwp, relative to point a, in crbs

pusch instances configuration

specify the set of pusch transmission instances in the waveform by using a cell array. each element in the cell array of objects defines a sequence of pusch transmission instances. this example defines two pusch sequences that model two user equipment (ue) transmissions.

general parameters

set these parameters for each pusch sequence.

  • enable or disable this pusch sequence.

  • specify a label for this pusch sequence.

  • specify the bwp carrying the pusch. the pusch uses the scs specified for this bwp.

  • power scaling in db.

  • enable or disable the ul-sch transport channel coding.

  • rnti.

  • nid for scrambling the pusch bits.

  • transform precoding. when transform precoding is true, the transform precoding is enabled and the resultant waveform is dft-s-ofdm. when transform precoding is false, the resultant waveform is cp-ofdm.

  • target code rate used to calculate the transport block sizes.

  • overhead parameter.

  • transmission scheme. when the transmission scheme is 'codebook', the mimo precoding is enabled and a precoding matrix is selected based on the number of layers, number of antenna ports and the transmitted precoding matrix indicator. when the transmission is set to 'noncodebook', an identity matrix is used, leading to no mimo precoding.

  • symbol modulation.

  • number of layers. the number of layers is restricted to a maximum of 4 in uplink as there is only one code word transmission. nominally, the number of layers is set to 1 when transform precoding is enabled. this value is ignored, when the dmrs.portset property is specified.

  • number of antenna ports. it is used when codebook transmission is enabled. the number of antenna ports must be greater than or equal to number of dm-rs ports configured.

  • transmitted precoding matrix indicator.

  • redundancy version (rv) sequence.

  • frequency hopping.

  • resource block offset for second hop.

  • transport block data source. you can use an array of bits or one of these standard pn sequences: 'pn9-itu', 'pn9', 'pn11', 'pn15', 'pn23'. you can specify the seed for the generator as a cell array in the form {'pn9', seed}. if you do not specify a seed, the generator is initialized with all ones.

pusch = {nrwavegenpuschconfig};           % create a pusch configuration object for the first ue
pusch{1}.enable = 1;                      % enable pusch sequence
pusch{1}.label = 'ue 1 - pusch @ 15 khz'; % label for this pusch sequence
pusch{1}.bandwidthpartid = 1;             % bwp of pusch transmission
pusch{1}.power = 0;                       % power scaling in db
pusch{1}.coding = 1;                      % enable the ul-sch transport channel coding
pusch{1}.nid = 1;                         % scrambling for data part
pusch{1}.rnti = 11;                       % rnti for the first ue
pusch{1}.transformprecoding = false;      % transform precoding
pusch{1}.targetcoderate = 0.47;           % code rate used to calculate transport block sizes
pusch{1}.xoverhead = 0;                   % rate matching overhead
% transmission settings
pusch{1}.transmissionscheme = 'codebook'; % 'codebook','noncodebook'
pusch{1}.modulation = 'qpsk';             % 'pi/2-bpsk','qpsk','16qam','64qam','256qam'
pusch{1}.numlayers = 2;                   % number of pusch layers
pusch{1}.numantennaports = 4;             % number of antenna ports
pusch{1}.tpmi = 0;                        % transmitted precoding matrix indicator (0...27)
pusch{1}.rvsequence = [0 2 3 1];          % rv sequence to be applied cyclically across the pusch allocation sequence
pusch{1}.frequencyhopping = 'interslot';  % frequency hopping configuration
pusch{1}.secondhopstartprb = 10;          % resource block offset for second hop
% data source
pusch{1}.datasource = 'pn9';              % channel data source

allocation

this figure shows the parameters of the pusch allocation.

you can set these parameters to control the pusch allocation. these parameters are relative to the bwp.

  • pusch mapping type.

  • symbols in a slot allocated to each pusch instance. for pusch mapping type 'a', the start symbol within a slot must be zero and the length can be from 4 to 14 (for normal cp) and up to 12 (for extended cp). for pusch mapping type 'b', the start symbol can be from any symbol in the slot

  • slots in a frame used for the sequence of pusch.

  • period of the allocation in slots. empty period indicates no repetition of the slot pattern.

  • the allocated prbs relative to the bwp.

pusch{1}.mappingtype = 'a';         % pusch mapping type ('a'(slot-wise),'b'(non slot-wise))
pusch{1}.symbolallocation = [0 14]; % first symbol and length
pusch{1}.slotallocation = [0 1];    % allocated slots indices for pusch sequence
pusch{1}.period = 5;                % allocation period in slots
pusch{1}.prbset = 0:10;             % prb allocation

pusch dm-rs configuration

set the dm-rs parameters.

% antenna port and dm-rs configuration (ts 38.211 section 6.4.1.1)
pusch{1}.dmrspower = 0;                    % additional power boosting in db
pusch{1}.dmrs.dmrsconfigurationtype = 1;   % dm-rs configuration type (1,2)
pusch{1}.dmrs.numcdmgroupswithoutdata = 2; % number of dm-rs cdm groups without data. the value can be one of the set {1,2,3}
pusch{1}.dmrs.dmrsportset = [0 2];         % dm-rs antenna ports used ([] gives port numbers 0:numlayers-1)
pusch{1}.dmrs.dmrstypeaposition = 2;       % mapping type a only. first dm-rs symbol position (2,3)
pusch{1}.dmrs.dmrslength = 1;              % number of front-loaded dm-rs symbols (1(single symbol),2(double symbol))
pusch{1}.dmrs.dmrsadditionalposition = 2;  % additional dm-rs symbol positions (max range 0...3)
pusch{1}.dmrs.nidnscid = 1;                % scrambling identity for cp-ofdm (0...65535). use empty ([]) to use physical layer cell identity
pusch{1}.dmrs.nscid = 0;                   % scrambling initialization for cp-ofdm (0,1)
pusch{1}.dmrs.nrsid = 0;                   % scrambling identity for dft-s-ofdm dm-rs (0...1007). use empty ([]) to use physical layer cell identity
pusch{1}.dmrs.grouphopping = true;         % group hopping configuration. this property is used only when transform precoding is enabled
pusch{1}.dmrs.sequencehopping = false;     % sequence hopping configuration. this property is used only when transform precoding is enabled

the grouphopping property is used in dm-rs sequence generation when transform precoding is enabled. you can set grouphopping to:

  • 'enable' to indicate the presence of group hopping. it is configured by higher-layer parameter sequencegrouphopping.

  • 'disable' to indicate the presence of sequence hopping. it is configured by higher-layer parameter sequencehopping.

  • 'neither' to indicate both group hopping and sequence hopping are not present.

the number of dm-rs cdm groups without data depends on the configuration type. the maximum number of dm-rs cdm groups can be 2 for dm-rs configuration type 1 and it can be 3 for dm-rs configuration type 2.

pusch pt-rs configuration

set the pt-rs parameters.

% pt-rs configuration (ts 38.211 section 6.4.1.2)
pusch{1}.enableptrs = 0;            % enable or disable the pt-rs (1 or 0)
pusch{1}.ptrspower = 0;             % additional pt-rs power boosting in db for cp-ofdm
pusch{1}.ptrs.timedensity = 1;      % time density (l_pt-rs) of pt-rs (1,2,4)
pusch{1}.ptrs.frequencydensity = 2; % frequency density (k_pt-rs) of pt-rs for cp-ofdm (2,4)
pusch{1}.ptrs.numptrssamples = 2;   % number of pt-rs samples (ngroupsamp) for dft-s-ofdm (2,4)
pusch{1}.ptrs.numptrsgroups = 2;    % number of pt-rs groups (nptrsgroup) for dft-s-ofdm (2,4,8)
pusch{1}.ptrs.reoffset = '00';      % pt-rs resource element offset for cp-ofdm ('00','01','10','11')
pusch{1}.ptrs.ptrsportset = 0;      % pt-rs antenna ports must be a subset of dm-rs ports for cp-ofdm
pusch{1}.ptrs.nid = 0;              % pt-rs scrambling identity for dft-s-ofdm (0...1007)

when pt-rs is enabled for cp-ofdm, the dm-rs ports must be in the range from 0 to 3 for dm-rs configuration type 1, and in the range from 0 to 5 for dm-rs configuration type 2. when pt-rs is enabled for dft-s-ofdm and the number of pt-rs groups is set to 8, the number of pt-rs samples must be set to 4.

uci on pusch

you can set these parameters to configure the transmission of uci on pusch.

  • enable or disable the transmission of harq-ack, csi part 1, csi part2, and cg-uci

  • number of harq-ack, csi part 1, csi part 2, and cg-uci bits.

  • betaoffsetack, betaoffsetcsi1, betaoffsetcsi2, and betaoffsetcguci can be set from the tables 9.3-1 and 9.3-2 of ts 38.213.

  • data source for harq-ack, csi part 1, csi part 2, and cg-uci. you can use an array of bits or one of these standard pn sequences: 'pn9-itu', 'pn9', 'pn11', 'pn15', 'pn23'. you can specify the seed for the generator as a cell array in the form {'pn9', seed}. if you do not specify a seed, the generator is initialized with all ones.

  • enable ul-sch transmission with uci.

  • uciscaling is provided by higher layer parameter scaling, as per ts 38.212, section 6.3.2.4.

pusch{1}.enableack = true;        % enable or disable harq-ack
pusch{1}.numackbits = 5;          % number of harq-ack bits
pusch{1}.betaoffsetack = 1;       % power factor of harq-ack
pusch{1}.datasourceack = 'pn9';   % harq-ack data source
pusch{1}.enablecsi1 = true;       % enable or disable csi part 1
pusch{1}.numcsi1bits = 10;        % number of csi part 1 bits
pusch{1}.betaoffsetcsi1 = 2;      % power factor of csi part 1
pusch{1}.datasourcecsi1 = 'pn9';  % csi part 1 data source
pusch{1}.enablecsi2 = true;       % enable or disable csi part 2
pusch{1}.numcsi2bits = 10;        % number of csi part 2 bits
pusch{1}.betaoffsetcsi2 = 2;      % power factor of csi part 2
pusch{1}.datasourcecsi2 = 'pn9';  % csi part 2 data source
pusch{1}.enablecguci = false;     % enable or disable cg-uci
pusch{1}.numcgucibits = 10;       % number of cg-uci bits
pusch{1}.betaoffsetcguci = 2;     % power factor of cg-uci
pusch{1}.datasourcecguci = 'pn9'; % cg-uci data source
pusch{1}.enableulsch = true;      % enable or disable ul-sch when there is uci transmission on pusch
pusch{1}.uciscaling = 1;          % scaling factor (0.5, 0.65, 0.8, 1)

when both harq-ack and cg-uci are enabled, section 6.3.2.1.4 of ts 38.212 specifies the uci bit sequence as the union of the cg-uci bits and the harq-ack bits. therefore, the processing of uci on pusch considers any active cg-uci source as an extension to harq-ack and only the value of betaoffsetack is used in this case.

specifying multiple pusch sequences

specify the second pusch sequence for the second bwp.

pusch{2} = pusch{1};                 % create a pusch configuration object for the second ue
pusch{2}.enable = 1;
pusch{2}.label = 'ue 2 - pusch @ 30 khz';
pusch{2}.bandwidthpartid = 2;        % pusch mapped to the second bwp
pusch{2}.rnti = 12;                  % rnti for the second ue
pusch{2}.symbolallocation = [0 12];
pusch{2}.slotallocation = [5 6 7 8];
pusch{2}.prbset = 5:10;              % prb allocation, relative to bwp
pusch{2}.period = 10;
pusch{2}.transformprecoding = 1;
pusch{2}.frequencyhopping = 'interslot';
pusch{2}.numlayers = 1;
pusch{2}.rnti = 1;
pusch{2}.dmrs.grouphopping = false;
pusch{2}.dmrs.dmrsportset = 1;

srs instances configuration

specify srs in the waveform. each element in the cell array of objects defines a sequence of srs instances associated with a bwp. define two disabled srs sequences.

general parameters

set these parameters for each srs sequence.

  • enable or disable this srs sequence.

  • specify a label for this srs sequence.

  • specify the bwp carrying this srs sequence. the srs sequence configuration uses the scs specified for this bwp.

  • specify the power scaling in db.

srs = {nrwavegensrsconfig};
srs{1}.enable = 0;
srs{1}.label = 'srs @ 15 khz';
srs{1}.bandwidthpartid = 1;
srs{1}.power = 3; % power scaling in db

srs configuration

you can configure these parameters for each srs sequence.

  • number of srs antenna ports.

  • symbols in a slot allocated to each srs sequence.

  • slots within a period used for srs transmission.

  • period of the allocation in slots. empty period indicates no repetition of the slot pattern.

  • starting position of the srs sequence in the bwp in rbs.

  • additional frequency offset from the starting position in 4-prb blocks.

  • bandwidth and frequency hopping configuration. the occupied bandwidth depends on the properties csrs, bsrs, and bhop. set bhop < bsrs to enable frequency hopping.

  • transmission comb to specify the srs frequency density in subcarriers.

  • offset of the transmission comb in subcarriers.

  • cyclic shift rotating the low-papr base sequence. the maximum number of cyclic shifts, 8 or 12, depends on the transmission comb number, 2 or 4. for 4 srs antenna ports, the subcarrier set allocated to the srs in the first and third antenna ports depends on the cyclic shift.

  • number of repeated srs symbols within a slot. it disables frequency hopping in blocks of repetition symbols. set repetition = 1 for no repetition.

  • group or sequence hopping. it can be 'neither', 'grouphopping' or 'sequencehopping'.

  • scrambling identity. it initializes the pseudo-random binary sequence when group or sequence hopping are enabled.

srs{1}.numsrsports = 1;             % number of srs ports (1,2,4)
srs{1}.numsrssymbols = 4;           % number of srs symbols in a slot (1,2,4)
srs{1}.symbolstart = 10;            % time-domain position of the srs in the slot. (8...13) for normal cp and (6...11) for extended cp
srs{1}.slotallocation = 2;          % allocated slots indices
srs{1}.period = 5;                  % allocation period in slots
srs{1}.frequencystart = 0;          % frequency position of the srs in bwp in rbs
srs{1}.nrrc = 0;                    % additional offset from freqstart specified in blocks of 4 prbs (0...67)
srs{1}.csrs = 13;                   % bandwidth configuration c_srs (0...63). it controls the allocated bandwidth to the srs
srs{1}.bsrs = 2;                    % bandwidth configuration b_srs (0...3). it controls the allocated bandwidth to the srs
srs{1}.bhop = 1;                    % frequency hopping configuration (0...3). set bhop < bsrs to enable frequency hopping
srs{1}.ktc = 2;                     % comb number (2,4). it indicates the allocation of the srs every ktc subcarriers
srs{1}.kbartc = 0;                  % subcarrier offset of the srs sequence (0...ktc-1)
srs{1}.cyclicshift = 0;             % cyclic shift number (0...ncsmax-1). ncsmax = 8 for ktc = 2 and ncsmax = 12 for ktc = 4.
srs{1}.repetition = 1;              % repetition factor (1,2,4). it indicates the number of equal consecutive srs symbols in a slot
srs{1}.groupseqhopping = 'neither'; % group or sequence hopping ('neither', 'grouphopping', 'sequencehopping')
srs{1}.nsrsid = 0;                  % scrambling identity (0...1023)
srs{1}.srspositioning = false;      % enable srs for user positioning

specifying multiple srs sequences

specify the second srs sequence for the second bwp.

srs{2} = srs{1};
srs{2}.enable = 0;
srs{2}.label = 'srs @ 30 khz';
srs{2}.bandwidthpartid = 2;
srs{2}.numsrssymbols = 2;
srs{2}.symbolstart = 12;
srs{2}.slotallocation = [5 6 7 8];
srs{2}.period = 10;
srs{2}.bsrs = 0;
srs{2}.bhop = 0;

waveform generation

assign all the channel and signal parameters to the main carrier configuration object nrulcarrierconfig, then generate and plot the waveform.

waveconfig.scscarriers = scscarriers;
waveconfig.bandwidthparts = bwp;
waveconfig.pusch = pusch;
waveconfig.srs = srs;
% generate complex baseband waveform
[waveform,info] = nrwaveformgenerator(waveconfig);

plot the magnitude of the baseband waveform for the set of antenna ports defined.

figure;
plot(abs(waveform));
title('magnitude of 5g uplink baseband waveform');
xlabel('sample index');
ylabel('magnitude');

plot the spectogram of the waveform for the first antenna port.

samplerate = info.resourcegrids(1).info.samplerate;
nfft = info.resourcegrids(1).info.nfft;
figure;
spectrogram(waveform(:,1),ones(nfft,1),0,nfft,'centered',samplerate,'yaxis','minthreshold',-130);
title('spectrogram of 5g uplink baseband waveform');

the waveform generator function returns the time-domain waveform and a structure info. the info structure contains the underlying resource element grid and a breakdown of the resources that all the pusch and srs instances use in the waveform.

the resourcegrids field is a structure array, which contains these fields.

  • the resource grid corresponding to each bwp.

  • the resource grid of the overall bandwidth containing the channels and signals in each bwp.

  • an info structure with information corresponding to each bwp. for example, display the information of the first bwp.

disp('modulation information associated with bwp 1:')
disp(info.resourcegrids(1).info)
modulation information associated with bwp 1:
                   nfft: 4096
             samplerate: 61440000
    cyclicprefixlengths: [320 288 288 288 288 288 288 320 288 288 288 ... ]
          symbollengths: [4416 4384 4384 4384 4384 4384 4384 4416 4384 ... ]
              windowing: 0
           symbolphases: [0 0 0 0 0 0 0 0 0 0 0 0 0 0]
         symbolsperslot: 14
       slotspersubframe: 1
          slotsperframe: 10
                     k0: 0

the generated resource grid is a 3-d matrix. the different planes in the grid represent the antenna ports in increasing port number order.

see also

functions

objects

  • | | |

related topics

网站地图