lte-凯发k8网页登录
this example shows how to create a downlink lte-m transmission consisting of mtc physical downlink control channel (mpdcch) as well as its associated physical downlink shared channel (pdsch) and physical broadcast channel (pbch), including repetitions and frequency hopping. when compared to pre-release 13 devices, cat-m devices offer lower cost and complexity, enhanced coverage by the introduction of repetitions and an extended drx for further power saving.
introduction
the introduction of lte-m to the lte standard added support specifically aimed at machine-type communications (mtc). starting with cat-0 devices in release 12, this was further extended in later releases to define a separate cat-m class of devices. two categories have now been added to lte, cat-m1 in release 13 (through the emtc work items) followed by cat-m2 in release 14 ( femtc ).
there are two coverage enhancement (ce) modes of operation for cat-m devices (also referred to as bl/ce ues in 3gpp standard documents), ce mode a and ce mode b. the ce mode a targets modest coverage enhancement with up to 32 repetitions whereas ce mode b targets extensive coverage enhancement with up to 2048 repetitions for the data channel. ce mode a is signaled via dci format 6-0a/6-1a messages and ce mode b via 6-0b/6-1b messages. the mpdcch processing chain, dm-rs creation and mapping is almost identical to that of the enhanced physical downlink control channel (epdcch), plus the addition of repetitions and frequency hopping behavior. this example makes specific use of lte toolbox™'s epdcch functionality to implement the mpdcch model. the lte-m data channel is the lte pdsch with addition of repetitions and frequency hopping. the lte-m broadcast channel consists of two parts; the 'core' part corresponding to the lte pbch and the lte-m specific 'repetition' part where the symbols and cell rs signals in the 'core' part are repeated.
lte-m can be deployed in standard lte cells, therefore not all subframes are necessarily used for bl/ce transmission. the bl/ce subframes are indicated by a bitmap sent in the mib-m message (similar to the mechanism in nb-iot). for simplicity, in this example, we assume that all subframes are defined to be bl/ce. the mpdcch/pdsch starting ofdm symbol for lte-m transmissions are cell-specific and is broadcasted in the system information (si).
the main output of this matlab® example is a multi-subframe cat-m1/cat-m2 resource grid containing the mpdcch resource elements (re), associated dm-rs, the lte-m pdsch res, pbch res (both 'core' and 'repetition' parts along with corresponding cell reference signals) and other reference signals as configured for the full transmission sequence. this grid is also ofdm modulated to generate the associated time-domain baseband waveform. plots are created to provide visualization of the re assignment in the grid and of the magnitude of the baseband signal.
lte-m physical layer concepts
repetitions - to enable significantly extended coverage for lte-m devices, repetitions for mpdcch, pdsch and pbch were introduced for cat-m devices in release 13. this would provide at least 15db performance improvement over pre-release 13 devices. mpdcch can be repeated up to a maximum of 256 times, pdsch up to 2048 and pbch up to 5 including the 'core' part.
narrowbands - lte-m uses the concept of narrowbands to allocate subcarriers in the wideband lte carrier for data and control channels. each narrowband consists of 6 consecutive prbs but not all prbs are necessarily part of the narrowbands (dependent on the overall carrier bw).
widebands - release 14 lte-m uses the concept of widebands to allocate higher bandwidth for the data channel. there can be one or more widebands, each consisting of 4 narrowbands or a single wideband consisting of 1,2 or 3 narrowbands. for a cat-m2 device configured in ce mode a (dci format 6-1a), the data channel is transmitted on a single wideband if
ce-pdsch-maxbandwidth-config
is set to 5mhz orresource block assignment flag
is set to 1 or across the full lte carrier bandwidth via an rbg bitmap in the case ofresource block assignment flag
is set to 0. theresource block assignment flag
is only present if thece-pdsch-maxbandwidth-config
is set to 20mhz. for a cat-m2 device configured in ce mode b (dci format 6-1b), the data channel is transmitted on a single wideband ifce-pdsch-maxbandwidth-config
is set to 5mhz and up to 4 widebands ifce-pdsch-maxbandwidth-config
is set to 20mhz.
frequency hopping - although a release 13 emtc device has an instantaneous bandwidth of 1.4mhz (the simplest lte-m devices have a maximum bandwidth of 1.4mhz), it can access a wider lte carrier through different narrowbands between the subframes. if the transmission involves repetition over multiple subframes, optional inter-subframe frequency hopping can be applied. the frequency hopping happens between different narrowbands and in blocks of 1 to 16 subframes depending on ce mode. the hopping block length and hopping offset are cell-specific parameters. in the downlink, for both control and data, the frequency hopping can be over 2 narrowbands or 4 equally spaced narrowbands.
pdsch physical layer processing and procedures
lte-m data transmission uses the same physical channel (pdsch) as in the case of lte. the difference however is that lte-m enables optional repetitions and frequency hopping.
transmission modes - the valid transmission modes for pdsch for lte-m are 1 (single antenna), 2 (transmit diversity), 6 (closed loop codebook based precoding) and 9 (non-codebook based precoding, single layer). transmission mode 6 is only supported in ce mode a, whereas 1, 2 and 9 are supported in both ce mode a and ce mode b. unlike lte pdsch, multiple input multiple output (mimo) operation is not supported in lte-m because most lte-m devices are expected to be low cost devices with a single receive antenna.
repetitions and scrambling blocks - the pdsch is transmitted in
nreppdsch
(>=1) consecutive bl/ce downlink subframes. thesenreppdsch
subframes are transmitted in blocks ofnacc
subframes (see ts 36.211 section 6.8b.2 [ 1 ]) and the same scrambling sequence is applied to all subframes in the block.nacc
can be 1 or 4 in fdd duplex mode and 1 or 10 in tdd duplex mode. there can be up to 32 repetitions in ce mode a and up to 2048 repetitions in ce mode b. the number of pdsch repetitions is defined by a combination of semi-static configuration and dynamic selection for a particular transmission.
narrowbands and widebands - the prbs used for lte-m pdsch transmissions must belong to narrowband(s) (and wideband(s) if cat-m2). cat-m1 devices have an instantaneous transmission bandwidth of 1.4mhz in a narrowband. cat-m2 devices have a bandwidth of 5mhz or 20mhz as indicated by the higher layer parameter
ce-pdsch-maxbandwidth-config
, in this case the pdsch transmission can be in wideband(s) where each wideband consists of up to 4 non-overlapping narrowbands.
frequency hopping - if the pdsch is repeated over multiple subframes, inter-subframe frequency hopping can be optionally applied where the hopping occurs for blocks of subframes of length 1,2,4,8 for devices in ce mode a and 2,4,8,16 in ce mode b. the hopping block length and hopping offset are cell-specific parameters. the frequency hopping can be over 2 narrowbands or 4 equally spaced narrowbands. the relative positions of the rbs carrying the pdsch within each hopping narrowbands remains the same.
mpdcch physical layer processing and procedures
mpdcch carries the lte-m downlink control information (dci). the mpdcch and corresponding demodulation reference signals (dm-rs) are transmitted on one or more ports from the set (107,108,109,110). the physical layer processing stages and operations of the mpdcch and epdcch are very similar, with the differences being the repetitions, optional frequency hopping and how the scrambling is applied.
repetitions and scrambling blocks - the mpdcch is transmitted using an aggregation of one or more consecutive enhanced control channel elements (ecces) in
nrepmpdcch
(>=1) consecutive bl/ce downlink subframes. thesenrepmpdcch
subframes are transmitted in blocks ofnacc
subframes (see ts 36.211 section 6.8b.2 [ 1 ]) and the same scrambling sequence is applied to all subframes in the block. as an example, for mpdcch not associated with p-rnti or sc-rnti and configured with ce mode a,nacc
= 1 as described in ts 36.211 section 6.8b.2 [ 1 ] so the scrambling gets initialized every bl/ce subframe, as in the case of epdcch.nacc
can be 1 or 4 in fdd duplex mode and 1 or 10 in tdd duplex mode. the number of mpdcch repetitions is defined by a combination of semi-static configuration and dynamic selection for a particular transmission. the network semi-statically configures the maximum repetitionsrmax
from the set (1,2,4,8,16,32,64,128,256) then dynamically selects the actual repetitions for a specific transmission from the set (rmax, rmax/2, rmax/4, rmax/8).
narrowbands - the mpdcch is transmitted in 2, 4 or 6 rbs in a single narrowband within each subframe. mpdcch prb set consists of ecces numbered from 0...n'eccepk where n'eccepk is the number of ecces in mpdcch-prb-set p of subframe k. the number of ecces used for one mpdcch is given by ts 36.211 table 6.8a.1-2 [ 1 ] for 2 or 4 prbs if repetition is not configured and table 6.8b.1-2 for all other cases.
frequency hopping - if the mpdcch is repeated over multiple subframes, inter-subframe frequency hopping can be optionally applied where the hopping occurs for blocks of subframes of length 1,2,4,8 for devices in ce mode a and 2,4,8,16 in ce mode b. the hopping block length and hopping offset are cell-specific parameters. the frequency hopping can be over 2 narrowbands or 4 equally spaced narrowbands. the relative positions of the rbs carrying the mpdcch within each hopping narrowbands remains the same.
pbch physical layer processing and procedures
similar to the pdsch, lte-m uses the same physical broadcast channel (pbch) as in the case of lte but with optional repetitions.
core pbch and non-core pbch - lte-m pbch is divided into two parts; the 'core' pbch which is the normal lte pbch and is transmitted in the first subframe of every frame with 40ms periodicity. the non-core part is the lte-m specific repetitions where the 'core' pbch symbols are repeated up to 5 times depending on the duplex mode and cyclic prefix length.
repetitions - pbch repetitions occur in subframe 9 of the preceding frame and subframe 0 of the current radio frame for fdd as given by ts 36.211 table 6.6.4-1 [ 1 ]. for tdd, the repetitions occur in subframes 0 and 5 of the same radio frame as given by table 6.6.4-2. the subcarriers remain the same for the core part and the repetitions. note that unlike the core part, the pbch repetitions should not map to res used by csi reference signals. the repetitions are defined according to the duplex mode and cyclic prefix length. for fdd, all pbch core symbols are repeated 4 times if normal cyclic prefix and 3 times if extended cyclic prefix. for tdd, if extended cyclic prefix, all symbols are repeated 3 times. for tdd and normal cyclic prefix, pbch core symbols 0 and 1 are repeated 5 times and symbols 2 and 3 are repeated 3 times.
simulation settings
this example is divided into the following steps:
configure the simulation parameters (cell-wide and mpdcch/pdsch specific)
create and encode a dci message payload for transmission on mpdcch
create and encode a dl-sch payload for transmission on pdsch
generate the symbols for the mpdcch subframe sequence and dm-rs, and map them into the resource elements of the multi-subframe resource grid
generate the symbols for the lte-m pdsch subframe sequence, map them into the resource elements of the multi-subframe resource grid
generate the symbols for the lte-m pbch subframe sequence, map them into the resource elements of the multi-subframe resource grid
apply cp-ofdm modulation to final grid to create the associated baseband waveform
display plots of the resource grid and time-series waveform
in this first section, we specify the simulation parameters to be used in later sections for the dci, mpdcch and dm-rs creation. this example uses an lte fdd carrier with bandwidth of 5mhz and normal cyclic prefix. cell-wide settings are contained in the structure enb
, mpdcch specific parameters are contained in structure mpdcch
and pdsch specific parameters are contained in structure pdsch
.
enb = struct(); enb.ndlrb = 25; % lte carrier bw enb.ncellid = 1; % the cell id enb.cellrefp = 1; % number of cell-specific ports enb.cfi = 3; % cfi indicator enb.duplexmode = 'fdd'; % duplex mode enb.tddconfig = 1; % uplink/downlink configuration (tdd) enb.cyclicprefix = 'normal'; % cyclic prefix duration enb.nsubframe = 0; % subframe number enb.nframe = 0; % frame number enb.csirsperiod = 'off'; % csi-rs period control enb.csirsconfig = 0; % csi-rs configuration enb.csirefp = enb.cellrefp; % number of csi-rs antenna ports enb.zeropowercsirsperiod = 'off'; % zero power csi-rs period control enb.zeropowercsirsconfig = 0; % zero power csi-rs configuration enb.ng = 'sixth'; % hich group multiplier enb.phichduration = 'extended'; % phich duration % set up hopping specific parameters enb.hoppingoffset = 1;% hopping offset 1...maxavailablenarrowbands (ts 36.331) enb.nchdlnbhop = 2; % number of narrowbands over which mpdcch/pdsch hops (2 or 4) enb.nchdlnb = 2; % number of subframes in one hop/hopping block length
% mpdcch configuration mpdcch = struct(); mpdcch.hopping = true; % enable/disable frequency hopping (only for 1.4mhz) mpdcch.nrepmpdcch = 8; % the total number of mpdcch repetitions mpdcch.epdcchecce = [0 7]; % ecce range used for this mpdcch (8 ecce) mpdcch.epdcchtype = 'localized';% transmission type ('localized', 'distributed') mpdcch.epdcchnid = 1; % cell id/mpdcch id depending on search space type mpdcch.epdcchstart = 4; % mpdcch start ofdm symbol in each subframe mpdcch.rnti = 1; % rnti for use with 'localized' transmission
mpdcch allocation - the (initial) set of prbs used for the mpdcch transmission is defined by a vector of 0-based prb indices specifying the absolute positions of the prb within the wideband carrier. these prbs should fall within a valid narrowband. if frequency hopping is disabled for mpdcch, an mpdcch candidate will always be transmitted in the prbs specified by the 'initprbset' parameter. if frequency hopping is enabled for mpdcch, an mpdcch candidate will be transmitted in the same relative positions of prbs, but in different narrowbands as defined in ts 36.211 section 6.8b.5. for the 5mhz lte carrier used in this example, there are four narrowbands as given by ts 36.211 section 6.2.7 [ 1 ]. the first narrowband has prbs 0...5, second has prbs 6...11, third has prbs 13...18 and the fourth has prbs 19...24. all other prbs within the 5mhz band fall outside the narrowbands and cannot be used for lte-m transmission. in this example, we use mpdcch format 2, where 8 ecces are used for the mpdcch transmission. each prb slot pair consists of 4 ecces therefore we need to define a minimum allocation of 2 prb. in this example, we select the 3rd and 4th prbs in the first narrowband
mpdcch.initprbset = (2:3)';
mpdcch.initnsubframe = 0; % absolute subframe number of first mpdcch subframe
% pdsch configuration pdsch = struct(); pdsch.hopping = true; % enable/disable frequency hopping (only for 1.4mhz) pdsch.nreppdsch = 16; % the total number of pdsch repetitions pdsch.cemode = 'a'; % a for ce mode a and b for ce mode b pdsch.txscheme = 'port0'; % port 0 or txdiversity or spatial mux or port 7 pdsch.modulation = 'qpsk';% modulation scheme (qpsk/16qam) pdsch.nlayers = 1; % number of layers pdsch.rv = 0; % redundancy version for dl-sch processing pdsch.rnti = 1; % rnti used for the ue pdsch.nscid = 0; % scrambling identity pdsch.trblksizes = 100; % transport block size
pdsch allocation - the prb allocation is flexible in the case of ce mode a (signaled via dci format 6-1a) and fixed in the case of ce mode b (signaled via dci format 6-1b). in ce mode a, the allocation can be on 1 to 6 prbs within one or more narrowbands as defined by resource allocation type 2 or for the entire lte carrier bandwidth via resource allocation type 0. in ce mode b, the allocation spans either the entire 6 prbs or the first 4 prbs of the narrowband(s) configured. for cat-m1 devices, the transmission is in a single narrowband. for cat-m2 devices, if the higher layer parameter ce-pdsch-maxbandwidth-config
is set to 20mhz in ce mode b, the transmission can span multiple narrowbands and the overall allocation can be up to a maximum of 96 prbs (grouped into widebands, where each wideband consists of 4 narrowbands). the widebands used are signaled via the wideband combination index field in the dci as described in ts 36.213 table 7.1.6-2 [ 3 ]. if ce-pdsch-maxbandwidth-config
is set to 5mhz, the transmission occurs in a single wideband consisting of 1,2,3 or 4 narrowbands depending on the lte carrier bandwidth (ndlrb).
in this example, we specify the allocation using the initprbset
parameter and initnarrowbandindex
. if frequency hopping is disabled, lte-m pdsch will always be transmitted in the prbs specified by the initprbset
and initnarrowbandindex
parameters. if frequency hopping is enabled, pdsch will be transmitted in the same relative positions of prbs, but in different narrowbands as defined in ts 36.211 section 6.4.1 [ 1 ]. if the allocation spans more than one narrowband or one or more widebands, the initnarrowbandindex
should be a vector specifying the constituent narrowband indices. as an example, if ce-pdsch-maxbandwidth-config
is 20mhz and the lte-m transmission is within a 20mhz lte carrier, there are 4 widebands (0,1,2,3) available for lte-m pdsch transmission with corresponding narrowband indices {(0 1 2 3) (4 5 6 7) (8 9 10 11) (12 13 14 15)}. if the desired allocation is widebands 2 & 3, then the initnarrowbandindex
must be then set to [8 9 10 11 12 13 14 15].
pdsch.initprbset = (1:2)'; % 0-based prb index pdsch.initnarrowbandindex = 0; % 0-based wideband index % in this example, we disable frequency hopping when transmission is over 2 % or more narrowbands if numel(pdsch.initnarrowbandindex) > 1 pdsch.hopping = false; mpdcch.hopping = false; end
enable or disable pbch repetitions
enb.reppbchenable = true; % specify the power scaling in db for mpdcch, mpdcch dm-rs, pdsch and % reference signals (cell rs or dm-rs) mpdcch.mpdcchpower = 30; mpdcch.mpdcchdmrspower = 32; pdsch.rho = 25; pdsch.rspower = 80; % power levels for the pbch core and reps parts enb.pbchpower = 33; enb.pbchrepspower = 36; % power level for the pbch cell rs reps enb.pbchcellrsrepspower = 28;
total subframes to simulate (all downlink subframes are bl/ce subframes) and the mpdcch and pdsch are transmitted without any subframe gaps
totmtcsubframes = mpdcch.initnsubframe mpdcch.nrepmpdcch 2 pdsch.nreppdsch; % identify all downlink subframes in a frame info = arrayfun(@(x)lteduplexinginfo(setfield(enb,'nsubframe',x)),0:9); dlsfs = arrayfun(@(x)strcmpi(x.subframetype,'downlink'),info); % total absolute subframes to simulate sfsnumlastframe = getlastabssf(dlsfs,totmtcsubframes); totsubframes = floor(totmtcsubframes/sum(dlsfs)) *10 sfsnumlastframe; % absolute subframe number of first pdsch subframe, this would be two % subframes after the mpdcch subframes (assuming no non bl/ce subframes) lastsfformpdcchplus2 = getlastabssf(dlsfs,mpdcch.nrepmpdcch 2); % last subframe number in last frame for mpdcch 2 pdsch.initnsubframe = mpdcch.initnsubframe floor((mpdcch.nrepmpdcch 2)/sum(dlsfs)) *10 lastsfformpdcchplus2; % find the last absolute subframe for mpdcch transmission lastsfformpdcch = getlastabssf(dlsfs,mpdcch.nrepmpdcch); % last subframe number in last frame for mpdcch mtclastabssfformpdcch = mpdcch.initnsubframe floor((mpdcch.nrepmpdcch)/sum(dlsfs)) *10 lastsfformpdcch;
dci message encoding
the bit vector dcibits
is passed to the function ltedciencode
which performs crc masking and insertion, tail-biting convolutional coding and rate matching, following ts 36.212 sections 5.3.3.2 to 5.3.3.4. note that the third argument to ltedciencode
specifies the rate matching output size equal to the mpdcch data bit capacity in a subframe. here we use a dummy 26 bit dci message of all ones, corresponding to a dci format 6-1a message as specified in ts 36.212 section 5.3.3.1.12.
% find the mpdcch data bit capacity [~,info] = lteepdcchindices(enb,setfield(mpdcch,'epdcchprbset',mpdcch.initprbset)); %#ok% define dci message bits dcibits = ones(26,1); % create the coded dci bits codeddcibits = ltedciencode(mpdcch,dcibits,info.epdcchg);
dl-sch encoding
% find the lte-m pdsch data bit capacity, this should not include the pbch, % pss, sss and csi-rs res. so we select the subframe 9 which is a dl % subframe in both fdd and tdd duplex modes (note: subframe 9 is not dl for % tddconfig 0, tddconfig 0 does not have a 'normal' dl subframe) fullpdschsf = 9; [~,fullinfo] = ltepdschindices(setfield(enb,'nsubframe',fullpdschsf),pdsch,getpdschallocation(enb,pdsch)); %#ok% define dl-sch message bits trdata = ones(pdsch.trblksizes(1),1); % create the coded dl-sch bits codedtrblock = ltedlsch(enb,pdsch,fullinfo.g,trdata);
mpdcch generation
in this example, we use the localized type with mpdcch format 2 and 2 prbs. mpdcch with 2 or 4 prbs and no repetitions use the same format table as the epdcch (ts 36.211 table 6.8a.1-2). for all other cases, the formats are given by ts 36.211 table 6.8b.1-2. also with ce mode a, no repetitions and all lte-m subframes, the scrambling gets initialized every subframe as for the epdcch and the cinit
is the same (because nacc
= 1 for cemodea
and nabsmpdcch
= 1). all other processing stages i.e. symbol modulation, layer mapping, precoding and mapping to resource elements are the same for epdcch and mpdcch. hence, we use the epdcch functions to generate the mpdcch symbols and indices.
% number of subframes in a scrambling block nacc = 1; if strcmpi(enb.duplexmode,'fdd') && mpdcch.nrepmpdcch >= 4 nacc = 4; elseif strcmpi(enb.duplexmode,'tdd') && mpdcch.nrepmpdcch >= 10 nacc = 10; end % create a resource grid for the entire transmission. the mpdcch, pdsch and % dm-rs symbols will be mapped in this array. note that we are creating the % grid for 4 antenna planes as the mpdcch transmission can be sent on ports % selected from the set (107, 108, 109 and 110) subframesize = ltedlresourcegridsize(enb,4); sfgrid = zeros([subframesize(1) subframesize(2)*totsubframes subframesize(3:end)]); mpdcchsym = []; % initialize mpdcch symbols mpdschsym = []; % initialize pdsch symbols mpbchcoresymfull = []; % initialize pbch symbols startsubframe = enb.nframe*10 enb.nsubframe; % initial absolute subframe number for sf = startsubframe (0:totsubframes -1)
% set current absolute subframe and frame numbers enb.nsubframe = mod(sf,10); enb.nframe = floor((sf)/10); % skip processing if this is not a downlink subframe duplexinfo = lteduplexinginfo(enb); if ~strcmpi(duplexinfo.subframetype,'downlink') continue end % transmitting the mpdcch if (sf >= mpdcch.initnsubframe) && (sf < mtclastabssfformpdcch) % calculate the prbset used in the current subframe prbset = gethoppingallocation(enb,mpdcch); % calculate the mpdcch indices for the current subframe mpdcch.epdcchprbset = prbset; [mpdcchindices,info] = lteepdcchindices(enb,mpdcch); % create an empty subframe grid subframe = ltedlresourcegrid(enb,4); % encode mpdcch symbols from dci codeword % in the case of repetition, the same symbols are repeated in each of % a block of nrepmpdcch subframes. frequency hopping is applied as required if ~mod(sf,nacc) || isempty(mpdcchsym) mpdcchsym = lteepdcch(enb,mpdcch,codeddcibits)*db2mag(mpdcch.mpdcchpower); end % map mpdcch symbols to the subframe grid subframe(mpdcchindices) = mpdcchsym; % create mpdcch dm-rs % the mpdcch and its reference symbols are transmitted on the same % port(s) and is transmitted only on the prbs in which the % corresponding mpdcch is mapped. the dm-rs sequence is the same as for % the epdcch as given by the equations in ts 36.211 section 6.10.3a mpdcchdmrs = lteepdcchdmrs(enb,mpdcch)*db2mag(mpdcch.mpdcchdmrspower); % mpdcch dm-rs symbols mpdcchdmrsindices = lteepdcchdmrsindices(enb,mpdcch); % mpdcch dm-rs indices subframe(mpdcchdmrsindices) = mpdcchdmrs; % map dm-rs signals to the grid % now assign the current subframe into the overall grid sfgrid(:,(1:subframesize(2)) sf*subframesize(2),:) = subframe; end
bl/ce pdsch generation
for the lte-m pdsch, the pbch, pss, sss and csi-rs re locations are counted in the mapping, but not used in the transmission. this means that the rate matched capacity should include these re locations, but the symbols for these locations are not transmitted. so we create the codeword accordingly and puncture the symbols corresponding to the conflicting locations
if (sf >= pdsch.initnsubframe) % calculate the prbset used in the current subframe prbset = getpdschallocation(enb,pdsch); % calculate the pdsch indices for the current subframe pdsch.prbset = prbset; mpdschindices = ltepdschindices(enb,pdsch,pdsch.prbset); % if the subframe contains pbch, pss, sss, csi-rs or zero power % csi-rs res, then we need to puncture the corresponding symbols % from the mapping but the rate matching should be to the full % pdsch capacity ignoring the possible presence of these symbols. % this is done by setting the subframe and tddconfig (if tdd mode) % to a subframe containing no pbch, pss and sss and turning off the % csi-rs and zp csi-rs. the full set of possible pdsch indices are % recalculated every subframe as these can change when frequency % hopping enbtemp = enb; enbtemp.tddconfig = 1; % tddconfig 0 has no full pdsch subframe enbtemp.nsubframe = fullpdschsf; % set the subframe to a full pdsch subframe enbtemp.csirsperiod = 'off'; % csi-rs period control enbtemp.zeropowercsirsperiod = 'off'; % zero power csi-rs period control mpdschindicesfull = ltepdschindices(enbtemp,pdsch,pdsch.prbset); [~, txmpdschindicespositions] = intersect(mpdschindicesfull,mpdschindices); % create an empty subframe grid subframe = ltedlresourcegrid(enb,4); % encode pdsch symbols from the codeword % in the case of repetition, the same symbols are repeated in each of % a block of nreppdsch subframes. frequency hopping is applied as required if ~mod(sf,nacc) || isempty(mpdschsym) mpdschsym = ltepdsch(enb,pdsch,codedtrblock)*db2mag(pdsch.rho); end % map punctured pdsch symbols to the subframe grid subframe(mpdschindices) = mpdschsym(txmpdschindicespositions); % transmit ue-specific reference signal (dm-rs) if applicable if any(strcmpi(pdsch.txscheme,{'port5' 'port7-8' 'port8' 'port7-14'})) uersindices = ltedmrsindices(enb,pdsch); uerssymbols = ltedmrs(enb,pdsch); subframe(uersindices) = uerssymbols*db2mag(pdsch.rspower); % map symbols to the grid end % now assign the current subframe into the overall grid sfgrid(:,(1:subframesize(2)) sf*subframesize(2),:) = subframe; end
bl/ce pbch generation
pbch symbol generation and mapping on res of a resource grid. lte-m pbch consists of the normal lte 'core' part and the lte-m specific repetitions. core pbch symbols are only present in first subframe with a periodicity of 4 frames.
subframe = sfgrid(:,(1:subframesize(2)) sf*subframesize(2),:); if(mod(enb.nsubframe,10)==0) % generate symbols if its the first simulated frame or % when mod(nframe,4) is 0; if ~mod(enb.nframe,4) || isempty(mpbchcoresymfull) mpbchcoresymfull = getmpbchcore(enb); end mpbchcoreindices = ltepbchindices(enb,{'1based'}); % now extract out the core part for the frame mpbchcoresym = mpbchcoresymfull(:,mod(enb.nframe,4) 1); % map the pbch core symbols to the subframe subframe(mpbchcoreindices) = mpbchcoresym*db2mag(enb.pbchpower); % now assign the current subframe into the overall grid sfgrid(:,(1:subframesize(2)) sf*subframesize(2),:) = subframe; % get the cell rs symbols and indices to be repeated if pbch % repetitions are enabled [mpbchcorecellrssymbols,mpbchcorecellrsindices] = getpbchcorecellrs(enb); elseif enb.reppbchenable && strcmpi(enb.duplexmode,'fdd') && (mod(enb.nsubframe,10)==9) % if this is the 9th subframe in fdd mode, then create the core % symbols and indices for the next frame to be used for pbch % repetitions in this subframe enbnext = enb; enbnext.nsubframe = 0; enbnext.nframe = enbnext.nframe 1; % advance to the next frame % if the current frame contained the last pbch block, then we need % the new set of pbch symbols if mod(enb.nframe,4)==3 mpbchcoresymfull = getmpbchcore(enbnext); end % now extract out the core part for the frame mpbchcoresym = mpbchcoresymfull(:,mod(enbnext.nframe,4) 1); mpbchcoreindices = ltepbchindices(enbnext,{'1based'}); [mpbchcorecellrssymbols,mpbchcorecellrsindices] = getpbchcorecellrs(enbnext); end % pbch repetition part if enabled if (enb.reppbchenable) % get the pbch repetition part consisting of repeating pbch symbols % and repeating cell rs signals and corresponding indices [pbchrepsymbols, pbchrepindices, pbchcellrsrepsymbols, pbchcellrsrepindices] = getpbchrep(enb,mpbchcoresym,mpbchcoreindices,mpbchcorecellrssymbols,mpbchcorecellrsindices); % map the pbch repetitions to the grid subframe(pbchrepindices) = pbchrepsymbols*db2mag(enb.pbchrepspower); % map the cell rs repetitions to the grid subframe(pbchcellrsrepindices) = pbchcellrsrepsymbols*db2mag(enb.pbchcellrsrepspower); end % now assign the current subframe into the overall grid sfgrid(:,(1:subframesize(2)) sf*subframesize(2),:) = subframe;
end
create time domain baseband waveform
create the time domain baseband waveform by ofdm modulating the resource grid. the resulting matrix has four columns; one of which will contain the complex baseband time-domain waveform samples for the mpdcch
waveform = lteofdmmodulate(enb,sfgrid);
plot transmitted grid and baseband waveform
plot the grid and time domain baseband waveform. if the transmission uses more than one port, only the first port is shown. note that the resource grid plot uses the power levels of the individual channels and signals to assign colors to the resource elements.
% create an image of overall resource grid % plot the port used by mpdcch along with the first port for all other channels figure im = image(abs(sfgrid(:,:,info.epdcchports(1)) sfgrid(:,:,1))); cmap = parula(64); colormap(im.parent,cmap); axis xy; title(sprintf('lte-m cemode%s downlink re grid (nrepmpdcch = %d, nreppdsch = %d)',pdsch.cemode,mpdcch.nrepmpdcch,pdsch.nreppdsch)) xlabel('ofdm symbols') ylabel('subcarriers') % create the legend box to indicate the channel/signal types associated with the res renames = {'mpdcch';'mpdcch drs';'pdsch';'pbch core'; 'pbch reps'; 'cell rs reps'}; clevels = round(db2mag([mpdcch.mpdcchpower mpdcch.mpdcchdmrspower pdsch.rho enb.pbchpower enb.pbchrepspower enb.pbchcellrsrepspower])); % if using dm-rs, include in legend if any(strcmpi(pdsch.txscheme,{'port5' 'port7-8' 'port8' 'port7-14'})) renames{end 1} = 'dmrs'; clevels(end 1) = pdsch.rspower; end n = numel(renames); l = line(ones(n),ones(n), 'linewidth',8); % generate lines % set the colors according to cmap set(l,{'color'},mat2cell(cmap( min(1 clevels,length(cmap) ),:),ones(1,n),3)); % set the colors according to cmap legend(renames{:}); % create separate plots of the control/data waveforms figure plot(abs(waveform(:,info.epdcchports(1)))) title('mpdcch time domain waveform') xlabel('samples') ylabel('amplitude') figure plot(abs(waveform(:,1))) title('pbch and pdsch time domain waveform') xlabel('samples') ylabel('amplitude')
local functions
the following local functions are used in this example:
calcnarrowbandprbsets
- calculate narrowbands and associated prbsgethoppingallocation
- calculate the subframe allocationgetpdschallocation
- calculate the pdsch allocationgetpbchcore
- calculate the core pbch symbols and indicesgetpbchcorecellrs
- calculate the core pbch symbols and indicesgetpbchrep
- calculate the pbch repetition part
selected bibliography
3gpp ts 36.211 "physical channels and modulation"
3gpp ts 36.212 "multiplexing and channel coding"
3gpp ts 36.213 "physical layer procedures"
3gpp ts 36.331 "radio resource control (rrc) protocol specification"
o. liberg, m. sundberg, y.-p. wang, j. bergman and j. sachs, cellular internet of things: technologies, standards and performance, elsevier, 2018.
e. dahlman, s. parkvall and j skold 4g lte-advanced pro and the road to 5g
local functions
% calculate the widebands, narrowbands and prbsets for the lte carrier bandwidth function [prbsets,nnb,nwb] = calcnarrowbandprbsets(ndlrb) % narrowbands & widebands (see 36.211 section 6.2.7) ndlnb = floor(ndlrb/6); nnb = 0:(ndlnb-1); % narrowbands if ndlnb >= 4 ndlwb = floor(ndlnb/4); else ndlwb = 1; end nwb = 0:(ndlwb-1); % widebands % prbs in a narrowband ii = 0:5; ii0 = floor(ndlrb/2) - 6*(ndlnb/2); prbsets = zeros(6,numel(nnb)); for nb = 1:numel(nnb) if mod(ndlrb,2) && nnb(nb)>= (ndlnb/2) prbsets(:,nb) = 6*(nnb(nb)) ii0 ii 1; else prbsets(:,nb) = 6*(nnb(nb)) ii0 ii; end end end % calculate the resource blocks allocated in the hopping narrowband function prbset = gethoppingallocation(enb,chs) % if frequency hopping is disabled, the allocation is same as initial if ~chs.hopping prbset = chs.initprbset; return end % hopping narrowband calculation according to ts 36.211 section 6.8b.5 nnbi0ss = 0; % get the possible narrowbands and associated prbsets if strcmpi(enb.duplexmode,'fdd') idelta = 0; else idelta = enb.nchdlnb-2; end j0 = floor((chs.initnsubframe idelta)/enb.nchdlnb); % get the narrowbands and corresponding resources [prbsets,nnb] = calcnarrowbandprbsets(enb.ndlrb); % calculate the narrowband for this subframe enb.nsubframe = enb.nframe*10 enb.nsubframe; % get the absolute subframe number nnbi = mod( (nnbi0ss (mod(floor((enb.nsubframe idelta)/enb.nchdlnb - j0),enb.nchdlnbhop))*enb.hoppingoffset) ,numel(nnb)); % calculate the prbset for this subframe, they are on the same rbs % within the narrowband [rbstartindex,nbstartindex] = find(prbsets == chs.initprbset(1)); [rbendindex,nbendindex] = find(prbsets == chs.initprbset(end)); if (isempty(rbstartindex) || isempty(rbendindex)) || (nbstartindex ~= nbendindex) error('invalid prbset specified, must be resources within single narrowband'); end prbset = prbsets(rbstartindex:rbstartindex numel(chs.initprbset)-1,nnbi 1); end % calculate the pdsch allocation function prbset = getpdschallocation(enb,pdsch) if pdsch.hopping % cat-m1 mode with hopping prbset = gethoppingallocation(enb,pdsch); else % calculate the allocations in narrowband(s) [prbsets,nnb] = calcnarrowbandprbsets(enb.ndlrb); % calculate the prbset for this subframe, they are on the same rbs % within all narrowbands rbstartindex = mod(find(prbsets == pdsch.initprbset(1))-1,6) 1; rbendindex = mod(find(prbsets == pdsch.initprbset(end))-1,6) 1; if isempty(rbstartindex) || isempty(rbendindex) error('invalid prbset specified, must be resources within narrowbands'); end if any(pdsch.initnarrowbandindex > max(nnb)) error('invalid initnarrowbandindex specified, must be from the set 0...%d',max(nnb)); end prbset = prbsets(rbstartindex:rbendindex,pdsch.initnarrowbandindex 1); prbset = prbset(:); end end % calculate the cell rs res and symbols corresponding to the 'core' pbch % part function [pbchcorecellrssymbols,pbchcorecellrsindices] = getpbchcorecellrs(enb) % we need to repeat the cell reference signals within the (k,l) region nscrb = 12; k = (enb.ndlrb*nscrb)/2 -36 (0:71) 1; % 1-based full possible pbch subcarrier locations if strcmpi(enb.cyclicprefix,'normal') nsymbdl = 7; else nsymbdl = 6; end l = nsymbdl (0:3) 1; % 1-based ofdm symbol numbers in the subframe corresponding to pbch core part % note: the cell rs symbols and indices can be looked up from the % grid if provided or can be created here as shown below cellrsindices = ltecellrsindices(enb); cellrssymbols = ltecellrs(enb); rsgrid = ltedlresourcegrid(enb); rsgrid(cellrsindices) = cellrssymbols; % now remove all rs symbols outside of the core pbch band excludesubs = setdiff(1:enb.ndlrb*nscrb,k); excludeofdmsymbols = setdiff(1:nsymbdl*2,l); % now remove all the unwanted re locations rsgrid(:,excludeofdmsymbols,:) = 0; rsgrid(excludesubs,:,:) = 0; % what is in the grid is the rs symbols to be repeated pbchcorecellrsindices = find(rsgrid); pbchcorecellrssymbols = rsgrid(pbchcorecellrsindices); end % calculate the prbch and cell rs res and symbols corresponding to the % repetition part function [pbchrepsymbols,pbchrepindices, pbchcellrsrepsymbols, pbchcellrsrepindices] = getpbchrep(enb,pbchcoresymbols,pbchcoreindices,pbchcorecellrssymbols,pbchcorecellrsindices) pbchrepindices = []; pbchrepsymbols = []; symmappings = {}; pbchcellrsrepindices = []; pbchcellrsrepsymbols = []; % for both fdd and tdd modes, there is no repetition if ndlrb = 6 if enb.ndlrb==6 return end % get the subcarriers for the pbch core part [pbchcoresubcarriers,ofdmsymbols,~] = ind2sub(ltedlresourcegridsize(enb),pbchcoreindices); % get the subcarriers for the cell rs core part [pbchcellrscoresubcarriers,ofdmsymbolscellrs,~] = ind2sub(ltedlresourcegridsize(enb),pbchcorecellrsindices); % fdd reps only in subframes 9 (frame n-1) and 0 (frame n) and tdd only % reps in subframes 0 and 5 in the same frame % get the subframe symbol numbers in which the reps go onto if strcmpi(enb.duplexmode,'fdd') if strcmpi(enb.cyclicprefix,'normal') nsymbdl = 7; if (mod(enb.nsubframe,10) == 0) symmappings = { 5 ; 12 ; 13 ; [4 14]}; elseif (mod(enb.nsubframe,10)==9) symmappings = { [4 8 12] ; [5 9 13] ; [6 10 14] ; [7 11]}; end else nsymbdl = 6; if (mod(enb.nsubframe,10) == 0) symmappings = {[] ; 4 ; 11 ; 12}; elseif (mod(enb.nsubframe,10)==9) symmappings = { [4 7] ; [5 8] ; [6 9] ; [10 11]}; end end else if strcmpi(enb.cyclicprefix,'normal') nsymbdl = 7; if (mod(enb.nsubframe,10) == 0) symmappings = { [4 12] ; [5 13] ; 6 ; 7}; elseif (mod(enb.nsubframe,10)==5) && enb.ndlrb>15 symmappings = { [4 8 12] ; [5 9 13] ; [6 10] ; [7 11]}; end else nsymbdl = 6; if (mod(enb.nsubframe,10) == 0) symmappings = {4 ; 5 ; 6 ; 11}; elseif (mod(enb.nsubframe,10)==5) && enb.ndlrb>15 symmappings = { [4 7] ; [5 8] ; [6 9] ; [10 11]}; end end end % if this is a repetition subframe, find the indices if ~isempty(symmappings) % create an empty subframe grid sfgrid = ltedlresourcegrid(enb); sfgridrs = ltedlresourcegrid(enb); for osymb = 1:4 % for all 4 pbch symbols % extract out each core symbol to map to one or more ofdm % symbols coreofdmsymb = pbchcoresymbols(ofdmsymbols==(osymb nsymbdl)); coreofdmsymbrs = pbchcorecellrssymbols(ofdmsymbolscellrs==(osymb nsymbdl)); % map to all new repetition ofdm symbols in the current % subframe for m = 1:numel(symmappings{osymb,1}) % create the indices for the current symbol (subcarriers % are the same as core symbols) symtomap = symmappings{osymb,1}(m); sfgrid(pbchcoresubcarriers(ofdmsymbols==(osymb nsymbdl)),symtomap,:) = coreofdmsymb; sfgridrs(pbchcellrscoresubcarriers(ofdmsymbolscellrs==(osymb nsymbdl)),symtomap,:) = coreofdmsymbrs; end end % as per ts 36.211 section 6.6.4, the pbch repetitions and cell rs % repetitions are punctured by csi (& zp csi) rs signals. so clear % these positions csirsindices = ltecsirsindices(enb); sfgrid(csirsindices) = 0; sfgridrs(csirsindices) = 0; % now get the pbch repeating symbols and indices pbchrepindices = find(sfgrid); pbchrepsymbols = sfgrid(pbchrepindices); % now get the cellrs repeating symbols and indices pbchcellrsrepindices = find(sfgridrs); pbchcellrsrepsymbols = sfgridrs(pbchcellrsrepindices); end end % get the mpbch core part symbols function mpbchcoresym = getmpbchcore(enb) bchbits = ltemib(enb); pbchbits = ltebch(enb,bchbits); mpbchcoresym = ltepbch(enb,pbchbits); % reshape to the four parts to go on to 4 frames mpbchcoresym = reshape(mpbchcoresym,numel(mpbchcoresym)/4,4); end % get the absolute subframe number in a frame which is used for the last % transmission of a channel function sfsnumlastframe = getlastabssf(dlsfs,totmtcsubframes) sfslastframe = mod(totmtcsubframes,sum(dlsfs)); % subframes to tx in the last frame if sfslastframe % find the subframe number corresponding to the last subframe to transmit sfsnumlastframe = find(dlsfs,sfslastframe); sfsnumlastframe = sfsnumlastframe(end); else % no partial frames required sfsnumlastframe = 0; end end