5g nr downlink vector waveform generation -凯发k8网页登录
this example shows how to configure and generate a 5g nr downlink vector waveform for a baseband component carrier by using the function.
introduction
this example shows how to parameterize and generate a 5g new radio (nr) downlink waveform by using the nrwaveformgenerator
function. the generated waveform contains these channels and signals.
pdsch and its associated dm-rs and pt-rs
pdcch and its associated dm-rs
pbch and its associated dm-rs
pss and sss
csi-rs
this example demonstrates how to parameterize and generate a baseband component carrier waveform characterized by multiple subcarrier spacing (scs) carriers and bandwidth parts (bwp). you can generate multiple instances of the physical downlink shared channel (pdsch), the physical downlink control channel (pdcch), and the channel state information reference signal (csi-rs) over the different bwps. you can configure sets of control resource sets (coresets) and search space monitoring opportunities for mapping the pdcchs. this example does not apply precoding to the physical channels and signals.
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 downlink carrier configuration parameters.
label for this dl 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 = nrdlcarrierconfig; % create a downlink carrier configuration object waveconfig.label = 'dl carrier 1'; % label for this downlink 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;
ss burst
in this section you can set the parameters for the signal synchronization (ss) burst. the numerology of the ss burst can be different from other parts of the waveform. this is specified via the block pattern parameter, as specified in ts 38.213 section 4.1. a bitmap specifies the blocks to transmit in a 5 ms half-frame burst. you can also set the periodicity in milliseconds and the power of the burst. for a full list of configurable ss burst properties, see .
% ss burst configuration ssburst = nrwavegenssburstconfig; ssburst.enable = 1; % enable ss burst ssburst.power = 0; % power scaling in db ssburst.blockpattern = 'case b'; % case b (30khz) subcarrier spacing ssburst.transmittedblocks = [1 1 1 1]; % bitmap indicating blocks transmitted in a 5ms half-frame burst ssburst.period = 20; % ss burst set periodicity in ms (5, 10, 20, 40, 80, 160) ssburst.ncrbssb = []; % frequency offset of ss burst (crb), use [] for the waveform center
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 = 12; % 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 = 50; % size of bwp in prbs bwp{2}.nstartbwp = 51; % position of bwp, relative to point a, in crbs
coreset and search space configuration
specify the coreset and the pdcch search space configuration. the coreset and search spaces specify the possible locations (in time and frequency) of the control channel transmissions for a given numerology. each element in the cell array of objects defines a coreset and each element in the cell array of objects defines a search space.
set these parameters for each coreset and search space.
the ofdm symbols which specify the first symbol of each coreset monitoring opportunity in a slot.
the duration of the block of allocated slots within a period.
periodicity of the allocation pattern.
the coreset duration in symbols, either 1, 2 or 3.
a bitmap defining the allocated physical resource blocks (prb) of the coreset. the coreset frequency allocation is defined in blocks of 6 prbs, aligned in crb numbering, relative to point a. each bit in the bitmap selects all 6 prbs in the crb aligned block that contains it.
cce-to-reg mapping which can be 'interleaved' or 'noninterleaved'.
resource element group (reg) bundle size (l), either (2,6) or (3,6), based on coreset duration.
interleaver size, either 2, 3, or 6.
shift index, a scalar value in the range 0...274.
the figure below shows the meaning of some of the coreset parameters.
% coreset and search space configurations coresets = {nrcoresetconfig}; coresets{1}.coresetid = 1; % coreset id coresets{1}.duration = 3; % coreset symbol duration (1,2,3) coresets{1}.frequencyresources = [1 1 0 1]; % bitmap indicating blocks of 6 prb for coreset (rrc - frequencydomainresources) coresets{1}.cceregmapping = 'noninterleaved'; % mapping: 'interleaved' or 'noninterleaved' coresets{1}.regbundlesize = 3; % l (2,6) or (3,6) coresets{1}.interleaversize = 2; % r (2,3,6) coresets{1}.shiftindex = waveconfig.ncellid; % set to ncellid searchspaces = {nrsearchspaceconfig}; searchspaces{1}.searchspaceid = 1; % search space id searchspaces{1}.coresetid = 1; % coreset associated with this search space searchspaces{1}.searchspacetype = 'ue'; % search space type, 'ue' or 'common' searchspaces{1}.slotperiodandoffset = [5 0]; % allocated slot period and slot offset of search space pattern searchspaces{1}.duration = 2; % number of slots in the block of slots in pattern period searchspaces{1}.startsymbolwithinslot = 0; % first symbol of each coreset monitoring opportunity in a slot searchspaces{1}.numcandidates = [8 8 4 2 0]; % number of candidates at each al (set to 0 if the al doesn't fit in coreset)
pdcch instances configuration
specify the set of pdcch transmission instances in the waveform by using a cell array. each element in the cell array of objects defines a sequence of pdcch instances.
set these parameters for each pdcch sequence.
enable or disable this pdcch sequence.
specify a label for this pdcch sequence.
specify the bwp carrying the pdcch. the pdcch uses the scs specified for this bwp.
power scaling in db.
enable or disable downlink control information (dci) channel coding.
allocated search spaces within the coreset monitoring occasion sequence.
search space (and coreset) that carries the pdcch instances.
period of the allocation in slots. empty period indicates no repetition of the slot pattern.
the aggregation level (al) of the pdcch (number of control channel elements (cces)).
the allocated candidate which specifies the cce used for the transmission of the pdcch.
rnti.
scrambling nid for this pdcch and its associated dm-rs.
dm-rs power boosting in db.
dci message payload size.
dci message 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.
pdcch = {nrwavegenpdcchconfig}; pdcch{1}.enable = 1 ; % enable pdcch sequence pdcch{1}.label = 'ue 1 - pdcch @ 15 khz'; % label for this pdcch sequence pdcch{1}.bandwidthpartid = 1; % bandwidth part of pdcch transmission pdcch{1}.power = 1.1; % power scaling in db pdcch{1}.coding = 1; % enable dci coding pdcch{1}.searchspaceid = 1; % search space pdcch{1}.slotallocation = 0; % allocated slots indices for pdcch sequence pdcch{1}.period = 5; % allocation period in slots pdcch{1}.aggregationlevel = 8; % aggregation level (1,2,4,8,16 cces) pdcch{1}.allocatedcandidate = 1; % pdcch candidate in search space (1 based) pdcch{1}.rnti = 11; % rnti pdcch{1}.dmrsscramblingid = 1; % pdcch and dm-rs scrambling nid pdcch{1}.dmrspower = 0; % additional dm-rs power boosting in db pdcch{1}.datablocksize = 20; % dci payload size pdcch{1}.datasource = 'pn9'; % dci data source
pdsch instances configuration
specify the set of pdsch transmission instances in the waveform by using a cell array. each element in the cell array of objects defines a sequence of pdsch instances. this example defines two pdsch sequences that model two user equipment (ue) transmissions.
general parameters
set these parameters for each pdsch sequence.
enable or disable this pdsch sequence.
specify a label for this pdsch sequence.
specify the bwp carrying the pdsch. the pdsch uses the scs specified for this bwp.
power scaling in db.
enable or disable the dl-sch transport channel coding.
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.target code rate used to calculate the transport block sizes.
overhead parameter.
symbol modulation.
number of layers.
redundancy version (rv) sequence.
enable or disable the interleaving of the virtual to physical resource block mapping.
bundle size for the interleaved map, specified by the higher layer parameter vrb-toprb-interleaver.
pdsch = {nrwavegenpdschconfig}; % create a pdsch configuration object for the first ue pdsch{1}.enable = 1; % enable pdsch sequence pdsch{1}.label = 'ue 1 - pdsch @ 15 khz'; % label for this pdsch sequence pdsch{1}.bandwidthpartid = 1; % bandwidth part of pdsch transmission pdsch{1}.power = 0; % power scaling in db pdsch{1}.coding = 1; % enable the dl-sch transport channel coding pdsch{1}.datasource = 'pn9'; % channel data source pdsch{1}.targetcoderate = 0.4785; % code rate used to calculate transport block sizes pdsch{1}.xoverhead = 0; % rate matching overhead pdsch{1}.modulation = 'qpsk'; % 'qpsk', '16qam', '64qam', '256qam' pdsch{1}.numlayers = 2; % number of pdsch layers pdsch{1}.rvsequence = [0 2 3 1]; % rv sequence to be applied cyclically across the pdsch allocation sequence pdsch{1}.vrbtoprbinterleaving = 0; % disable interleaved resource mapping pdsch{1}.vrbbundlesize = 2; % vrb-toprb-interleaver parameter
allocation
this figure shows the parameters of the pdsch allocation.
you can set these parameters to control the pdsch allocation. these parameters are relative to the bwp. the specified pdsch allocation will avoid the locations used for the ss burst.
symbols in a slot allocated to each pdsch instance.
slots in a frame used for the sequence of pdsch.
period of the allocation in slots. empty period indicates no repetition of the slot pattern.
the allocated prbs relative to the bwp.
rnti. this value is used to link the pdsch to an instance of the pdcch.
nid for scrambling the pdsch bits.
pdsch{1}.symbolallocation = [2 9]; % first symbol and length pdsch{1}.slotallocation = 0:9; % allocated slot indices for pdsch sequence pdsch{1}.period = 15; % allocation period in slots pdsch{1}.prbset = [0:5, 10:20]; % prb allocation pdsch{1}.rnti = 11; % rnti for the first ue pdsch{1}.nid = 1; % scrambling for data part
coresets and sets of prb can be specified for rate matching around, if required
the pdsch can be rate matched around one or more coresets.
the pdsch can be rate matched around other resource allocations.
pdsch{1}.reservedcoreset = 1; % rate matching pattern, defined by coreset ids pdsch{1}.reservedprb{1}.prbset = []; % rate matching pattern, defined by set of prb (rrc 'bitmaps') pdsch{1}.reservedprb{1}.symbolset = []; pdsch{1}.reservedprb{1}.period = [];
pdsch dm-rs configuration
set the dm-rs parameters.
% antenna port and dm-rs configuration (ts 38.211 section 7.4.1.1) pdsch{1}.mappingtype = 'a'; % pdsch mapping type ('a'(slot-wise),'b'(non slot-wise)) pdsch{1}.dmrspower = 0; % additional power boosting in db pdsch{1}.dmrs.dmrsconfigurationtype = 2; % dm-rs configuration type (1,2) pdsch{1}.dmrs.numcdmgroupswithoutdata = 1; % number of dm-rs cdm groups without data. the value can be one of the set {1,2,3} pdsch{1}.dmrs.dmrsportset = []; % dm-rs antenna ports used ([] gives port numbers 0:numlayers-1) pdsch{1}.dmrs.dmrstypeaposition = 2; % mapping type a only. first dm-rs symbol position (2,3) pdsch{1}.dmrs.dmrslength = 1; % number of front-loaded dm-rs symbols (1(single symbol),2(double symbol)) pdsch{1}.dmrs.dmrsadditionalposition = 0; % additional dm-rs symbol positions (max range 0...3) pdsch{1}.dmrs.nidnscid = 1; % scrambling identity (0...65535) pdsch{1}.dmrs.nscid = 0; % scrambling initialization (0,1)
pdsch pt-rs configuration
set the pt-rs parameters.
% pt-rs configuration (ts 38.211 section 7.4.1.2) pdsch{1}.enableptrs = 0; % enable or disable the pt-rs (1 or 0) pdsch{1}.ptrspower = 0; % additional pt-rs power boosting in db pdsch{1}.ptrs.timedensity = 1; % time density (l_pt-rs) of pt-rs (1,2,4) pdsch{1}.ptrs.frequencydensity = 2; % frequency density (k_pt-rs) of pt-rs (2,4) pdsch{1}.ptrs.reoffset = '00'; % pt-rs resource element offset ('00','01','10','11') pdsch{1}.ptrs.ptrsportset = 0; % pt-rs antenna ports must be a subset of dm-rs ports
when pt-rs is enabled, 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. nominally, the antenna port of pt-rs is the lowest dm-rs port number.
specifying multiple pdsch instances
specify the second pdsch sequence for the second bwp.
pdsch{2} = pdsch{1}; % create a pdsch configuration object for the second ue pdsch{2}.enable = 1; pdsch{2}.label = 'ue 2 - pdsch @ 30 khz'; pdsch{2}.bandwidthpartid = 2; % pdsch mapped to the second bwp pdsch{2}.rnti = 12; % rnti for the second ue pdsch{2}.symbolallocation = [0 12]; pdsch{2}.slotallocation = [2:4, 6:20]; pdsch{2}.prbset = [25:30, 35:38]; % prb allocation, relative to bwp
csi-rs instances configuration
this section configures csi-rs in the waveform. each element in the cell array of objects defines a set of csi-rs resources associated with a bwp. define two disabled sets of csi-rs resources.
general parameters
set these parameters for a set of csi-rs resources.
enable or disable this set of csi-rs resources.
specify a label for this set of csi-rs resources.
specify the bwp carrying this set of csi-rs resources. the csi-rs resource(s) configuration uses the scs specified for this bwp.
specify the power scaling in db. providing a scalar defines the power scaling for a single csi-rs resource or all configured csi-rs resources. providing a vector defines a separate power level for each of the csi-rs resources.
csirs = {nrwavegencsirsconfig}; csirs{1}.enable = 0; csirs{1}.label = 'csi-rs @ 15 khz'; csirs{1}.bandwidthpartid = 1; csirs{1}.power = 3; % power scaling in db
csi-rs configuration
you can configure these parameters for one or more zero-power (zp) or non-zero-power (nzp) csi-rs resource configurations.
type of csi-rs resource(s) ('nzp','zp').
row number corresponds to csi-rs resource(s) as defined in ts 38.211 table 7.4.1.5.3-1 (1...18).
frequency density of csi-rs resource(s). it can be
'one'
,'three'
,'dot5even'
, or'dot5odd'
.subcarrier locations of csi-rs resource(s) within a resource block (rb)
number of rbs allocated to csi-rs resource(s) (1...275).
starting rb index of csi-rs resource(s) allocation relative to the carrier resource grid (0...274).
ofdm symbol locations of csi-rs resource(s) within a slot.
the period and offset of slots (0-based) of csi-rs resource(s). this parameter can be a vector or a cell array of vectors. in the latter case, each cell corresponds to an individual csi-rs resource. in case of a vector, the same set of slots is used for all csi-rs resources.
scrambling identity corresponds to csi-rs resource(s) for pseudo-random sequence generation (0...1023).
csirs{1}.csirstype = {'nzp','zp'}; csirs{1}.rownumber = [3 5]; csirs{1}.density = {'one','one'}; csirs{1}.subcarrierlocations = {6 4}; csirs{1}.numrb = 25; csirs{1}.rboffset = 12; csirs{1}.symbollocations = {13 9}; csirs{1}.csirsperiod = {[5 0], [5 0]}; csirs{1}.nid = 5;
specifying multiple csi-rs instances
specify the second set of csi-rs resources for the second bwp.
csirs{2} = nrwavegencsirsconfig; csirs{2}.enable = 0; csirs{2}.label = 'csi-rs @ 30 khz'; csirs{2}.bandwidthpartid = 2; csirs{2}.power = 3; % power scaling in db csirs{2}.csirstype = {'nzp','nzp'}; csirs{2}.rownumber = [1 1]; csirs{2}.density = {'three','three'}; csirs{2}.subcarrierlocations = {0 0}; csirs{2}.numrb = 50; csirs{2}.rboffset = 50; csirs{2}.symbollocations = {6 10}; csirs{2}.csirsperiod = {[10 1], [10 1]}; csirs{2}.nid = 0;
waveform generation
assign all the channel and signal parameters into the main carrier configuration object nrdlcarrierconfig
, then generates and plot the waveform.
waveconfig.ssburst = ssburst;
waveconfig.scscarriers = scscarriers;
waveconfig.bandwidthparts = bwp;
waveconfig.coreset = coresets;
waveconfig.searchspaces = searchspaces;
waveconfig.pdcch = pdcch;
waveconfig.pdsch = pdsch;
waveconfig.csirs = csirs;
% 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 downlink 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 downlink 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 pdsch and pdcch 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
- | | | | | | | |