main content

release 14 v2x sidelink pscch and pssch throughput -凯发k8网页登录

this example demonstrates how to measure the physical sidelink shared channel (pssch) and physical sidelink control channel (pscch) throughput performance in frequency-selective fading and additive white gaussian noise (awgn).

introduction

3gpp release 14 introduced the support for lte v2x (vehicle-to-everything) to enable connected vehicular services with the aim of providing a safer, cleaner, faster and more efficient transportation. v2x offers several modes of operation including vehicle-to-vehicle (v2v), vehicle-to-infrastructure (v2i) and vehicle-to-pedestrian (v2p) direct communication without necessarily relying on network involvement for scheduling. some of the distinguishing aspects of v2x over the release 12 device-to-device sidelink are:

  • low latency and high reliability requirements

  • large doppler shift due to high relative speeds

  • very large number of nodes and high node densities

  • challenges to synchronization especially when out-of-coverage

this example measures release 14 v2x sidelink shared and control channel throughput for a number of snr points. for information on how to model release 12 sidelink device-to-device (d2d) interface (aimed primarily at allowing lte to support public safety communication systems), see the example.

operating on a subframe by subframe basis for each snr point, the following steps are performed for the throughput and bler calculation:

  • a resource grid populated with pscch and/or pssch is generated and ofdm modulated to create the baseband waveform to transmit

  • this waveform is passed through a noisy fading channel

  • receiver operations (sc-fdma demodulation, channel estimation, and equalization) are performed

  • the equalized symbols are decoded to obtain the block crc

  • the performance of the pscch and/or pssch is determined using the block crc result at the output of the channel decoder

simulation configuration

by default, the example runs uses a simulation length of four frames over a range of snr points. to produce meaningful throughput results, use a larger value of nframes. you can specify snrin as an array of values or a scalar.

% set the number of frames to simulate
nframes = 4;
% set a range of snr points to cover both high and low bler operating
% conditions
snrin = [-5 0 5];

transmission configuration

a set of top-level parameters is initially specified, these include the bandwidth, the cyclic prefix, the modulation scheme and the allocated set of resource blocks. the baseline configuration is taken from the "reference measurement channel for transmitter characteristics" as defined by ts 36.101 table a.8.3-1 [ 2 ]. to simulate a more realistic v2x transmission, multiple harq processes and harq retransmissions have been introduced in this example. the data rate is defined in terms of the subframe gap sfgap and transmission time interval tti.

sfgap = 8; % time in subframes between initial and retransmission
tti = 4;   % time in subframes between different harq processes
if tti > sfgap
   error('tti cannot be greater than sfgap');
end
% number of allocated resource blocks (nprb) and transport block size (tbs)
% as given by ts 36.101 table a.8.3-1. note that tbs must be chosen
% according to ts 36.213 section 14.1.1 and nprb according to ts 36.213
% section 14.1.1.4c. if an invalid tbs/nprb is specified, the transmitted
% modcoding value in the sci message would be incorrect and this could
% result in the sl-sch decoding to fail. an invalid nprb could also result
% in an sci message and corresponding pssch transmission where the
% allocated resources are different from the nprb specified here.
nprb = 48;        % number of allocated resource blocks (nprb)
tbs = 3496;       % the transport block size
% define the starting rb for the resource allocations. the initial and
% subsequent transmission can have different allocations
rbstart = [0 0];
% define the ue configuration parameters
ueconfig = struct('sidelinkmode','v2x');% release 14 v2x mode
ueconfig.nslrb = 50;                    % 10mhz bandwidth
ueconfig.duplexmode = 'fdd';            % duplex mode
ueconfig.cyclicprefixsl = 'normal';     % cyclic prefix length
ueconfig.modulation = 'qpsk';           % symbol modulation ('qpsk','16qam')

propagation channel configuration

the structure channel contains the channel model configuration parameters.

channel = struct;                    % channel config structure
channel.seed = 6;                    % channel seed
channel.nrxants = 2;                 % number of receive antennas
channel.delayprofile ='eva';         % delay profile
channel.dopplerfreq = 500;           % doppler frequency in hz
channel.mimocorrelation = 'low';     % multi-antenna correlation
channel.nterms = 16;                 % oscillators used in fading model
channel.modeltype = 'gmeds';         % rayleigh fading model type
channel.initphase = 'random';        % random initial phases
channel.normalizepathgains = 'on';   % normalize delay profile power
channel.normalizetxants = 'on';      % normalize for transmit antennas
% the channel sampling rate depends on the fft size used in the ofdm
% modulator. this can be obtained using the function lteslscfdmainfo.
ofdminfo = lteslscfdmainfo(ueconfig);
channel.samplingrate = ofdminfo.samplingrate;

channel estimator configuration

the variable perfectchanestimator controls channel estimator behavior. valid values are true or false. when set to true, a perfect channel response is used as estimate, otherwise an imperfect estimate based on the values of received dm-rs signals is obtained. if perfectchanestimator is set to false a configuration structure cec is needed to parameterize the channel estimator.

% perfect channel estimator flag
perfectchanestimator = false;
% define the practical channel estimator configuration structure. note that
% depending on the channel delay profile and doppler frequency, the
% operating snr, pssch modulation order and the number of allocated
% resource blocks, different channel estimation parameters may give better
% performance.
cec = struct;                        % channel estimation config structure
cec.pilotaverage = 'userdefined';    % type of pilot symbol averaging
cec.freqwindow = 27;                 % frequency window size
cec.timewindow = 1;                  % time window size
cec.interptype = 'cubic';            % 2d interpolation type

configure throughput measurements

the logical variables measureblerforsci and measuretputforslsch allow the throughput measurements and all related receiver processing to be disabled for the sci and sl-sch respectively. this allows the simulation to be configured to measure throughput for only one of the channels. disabling the receiver processing for the other channel improves the execution speed.

measureblerforsci = true;
measuretputforslsch = true;

select receiver behavior when sci decoding fails

the logical variable sciassumed controls the simulation behavior in terms of the effect the control channel decoding has on the shared channel decoding. if sciassumed is true, the receiver will assume that the sci message was correctly decoded when attempting shared channel reception. this allows the performance of the shared channel reception to be measured independently from the performance of the control channel reception. if sciassumed is false, a control channel decoding failure implies a shared channel decoding failure. note that if the throughput measurement for the sci is disabled above (measureblerforsci=false), and the throughput measurement for the sl-sch is enabled (measuretputforslsch=true), the receiver will assume that the sci message was correctly decoded when measuring sl-sch throughput regardless of the setting of sciassumed here.

sciassumed = false;

display simulation information

the variable displaysimulationinformation controls the display of simulation information such as the harq process id used and the resource allocation plot for each subframe. for long simulations, it is recommended to turn off the display as it increases simulation time.

displaysimulationinformation = true;

display v2x sidelink communication resource pool

transmission and reception opportunities for sidelink direct communications are associated with a set of periodically occurring time-domain periods known as resource pools. a ue can be configured with multiple messages and therefore multiple resource pools for transmission and reception. a single resource pool contains both the shared and control subframe and resource pools and a specific transmission is defined by a combination of semi-static rrc parameters with dynamic dci/sci parameters. the pscch associated with a pssch is sent in the same subframe, on either adjacent or non-adjacent prb. in order to illustrate the structure of v2x resource pools, the example uses the class v2xsidelinkresourcepool, which models a resource pool and provides parameters and methods to define a specific transmission. the method v2xsidelinkresourcepool.displayperiod creates a plot showing the locations of the control resource pool (dark blue) and shared resource pool (yellow) within the resource pool.

resourcepool = v2xsidelinkresourcepool;
resourcepool.config.nslrb = ueconfig.nslrb;
resourcepool.config.duplexmode = ueconfig.duplexmode;
if displaysimulationinformation
    resourcepool.displayperiod;
    drawnow;
end

processing chain

to determine the throughput at each snr point, the subframe by subframe processing chain includes:

  • update configuration for current harq process - the ue either carries new transport data or a retransmission of previously sent pssch transport data with a different redundancy version. all this is handled by the harq scheduler. the harq buffer decstate stores the decoder state for soft combining.

  • create and encode the sci message - the sci message carries sidelink scheduling information. the sci parameters are: priority indicating prose per-packet priority, resourcereservation set by higher layers for reserving the resource for the next transmission of the transport block, riv carrying allocation information, timegap signaling the time gap in subframes between the initial transmission and retransmission, modcoding signaling the modulation scheme are used for pssch reception and retransmissionidx indicating whether the transmission is the first or second (retransmission). the sci message is then encoded and mapped on to the pscch for transmission. the crc of the sci message is the scrambling identity for pssch.

  • plot the allocated resources - the resource allocation for the first harq process is plotted if the displaysimulationinformation flag is enabled. all harq processes have the same pssch (orange) and pscch (green) resource block allocation. the pscch and pssch can be transmitted on adjacent or non-adjacent resource blocks.

  • create transmit waveform - pass the data generated by the ue to the physical layer processing stage to produce an sc-fdma modulated waveform, containing the pscch and pssch physical channels and drs signals.

  • noisy channel modeling - pass the waveform through a fading channel and add noise (awgn).

  • perform blind detection of pscch - the pscch resources and cyclic shift used in the transmitter in the subframe is unknown, so the synchronization, channel estimation and decoding is performed for each prb set in the pscch resource block pool (provided by v2xsidelinkresourcepool.pscchresourceblockpool for all cyclic shifts until the sci is successfully decoded or the entire resource pool is searched. the timing offset for the dm-rs correlation with the strongest peak is used for synchronization.

  • perform pscch channel estimation: pscch channel estimation is performed using . the channel estimator also produces an estimate of the noise power which can be used for mmse equalization.

  • extract the pscch symbols and channel estimate: the received pscch symbols are extracted from the subframe resource grid, the corresponding channel estimates are extracted using and the indices provided by .

  • perform pscch equalization: the pscch symbols are mmse equalized using with the channel estimate and noise estimate obtained above.

  • perform pscch demodulation: the equalized pscch symbols are demodulated using . this function performs the inverse of the transmitter modulation steps (sc-fdma transform deprecoding, qpsk symbol demodulation and descrambling).

  • perform sci decoding: sci decoding is attempted using . the number of original information bits in the sci message is given by . if the decoded crc is zero and the recovered crc mask is the expected value, the sci decoding is considered successful and the decoded message bits are converted into the corresponding message structure using . the crc mask value provides the pssch scrambling identity, nxid.

the behavior of the shared channel decoding with respect to a failed sci decoding is controlled by the variable sciassumed. if sciassumed is false, the failed sci decoding immediately implies a failure to decode the sl-sch and no further processing takes place for the current subframe. if sciassumed is true, the transmitted sci message is assumed to be known to the receiver and will be used in place of the received sci message. if sciassumed is true or if sci decoding was successful, the receiver proceeds with sl-sch decoding. note that if sci bler measurement is disabled but sl-sch throughput measurement is enabled then the transmitted sci message is assumed to be known to the receiver.

for sl-sch decoding:

  • get the pssch resource allocation - the riv obtained from the recovered sci message is then decoded to get the number of subchannels and the starting sub channel allocated for this transmission. this in combination with the pscch adjacency, size of each subchannel and first allocated resource block provides the set of allocated pssch rbs prbset.

  • synchronize and sc-fdma demodulate subframe carrying pssch: the appropriate subframe of the waveform is synchronized using . the synchronized waveform is sc-fdma demodulated using . note that although the control and shared channel are transmitted in the same subframe, it is sufficient to perform the synchronization and sc-fdma demodulation only for the pscch. however, in this example, since the shared and control channel can be independently received, pssch synchronization and sc-fdma demodulation are performed. this is to enable pssch reception when the pscch reception is disabled.

  • perform pssch channel estimation: pssch channel estimation is performed using . the channel estimator also produces an estimate of the noise power which can be used for mmse equalization.

  • extract the pssch symbols and channel estimate: the received pssch symbols are extracted from the subframe resource grid and the corresponding channel estimates are extracted using and the indices provided by .

  • perform pssch equalization: the pssch symbols are mmse equalized using lteequalizemmse with the channel estimate and noise estimate obtained above.

  • perform pssch demodulation: the equalized pssch symbols are demodulated using . this function performs the inverse of the transmitter modulation steps (sc-fdma transform deprecoding, qpsk or 16qam symbol demodulation and descrambling). the descrambling uses the pscch crc obtained from the sci decoding stage.

  • decoding the sidelink shared channel (sl-sch) and storing the block crc error for a ue - pass the vector of decoded soft bits to , which decodes the codeword and returns the block crc error used to determine the throughput of the system. the contents of the new soft buffer, harqprocesses(harqid).decstate, is available at the output of this function to be used when decoding the next subframe.

% initialize variables used in the simulation and analysis
maxthroughputslsch = zeros(length(snrin),1);
simthroughputslsch = zeros(length(snrin),1);
simblersci = zeros(length(snrin),1);
% get the number of harq processes required
nharqprocesses = floor(sfgap/tti);
% calculate the harq id sequence for each of the transmitting subframes
harqprocesssequence = zeros(1,nframes*10);
for h = 1:nharqprocesses
    harqprocesssequence(1 tti*(h-1):sfgap:nframes*10) = h;
end
% create the partial sci message with the parameters that have fixed values
% for the simulation. other parameters that have variable values will be
% set further down in the simulation loop
scimessage = struct('sciformat','format1');
scimessage.timegap = sfgap;
% set the pssch mcs according to the tbs and modulation scheme
[itbs,modn] = ltemcs(0:28,'pusch');
% according to ts 36.213 section 14.1.1, for imcs (0 to 28), the modulation
% order is set to q' = min(4,qm') where qm' can be 2, 4 or 6. so change the
% cases where qm' = 6 ('64qam') to qm' = 4 ('16qam')
modn(strcmpi(modn, '64qam')) = {'16qam'};
% filter valid transport block sizes according to modulation scheme used
possibletbs = ltetbs(nprb,itbs);
possibletbs(~strcmpi(modn,ueconfig.modulation)) = 0;
% now set the mcs index according to the tbs
scimessage.modcoding = find(possibletbs==tbs,1) - 1;
% create new figure for displaying resource allocation, if required
if displaysimulationinformation
    figure;
end
% if sci bler is not being measured, 'sciassumed' must be set so that the
% receiver can assume knowledge of the sci
if (~measureblerforsci)
    sciassumed = true;
end
rng('default');
for snridx = 1:numel(snrin)
    % set the random number generator seed depending on the loop variable
    % to ensure independent random streams
    rng(snridx);
    % initialize the state of all harq buffers
    harqprocess = struct('rvidx',1,'data',[],'decstate',[]);
    harqprocesses(1:nharqprocesses) = harqprocess;
    rvseq = [0 2];    % rv for initial transmission and retransmission
    % set up variables for the main loop
    lastoffset = 0;       % initialize overall frame timing offset
    frameoffset = 0;      % initialize frame timing offset
    sharedbittput = [];   % number of successfully received bits per subframe
    txedtrblksizes = [];  % number of transmitted bits per subframe
    controlerrors = [];   % number of sci block errors
    for subframeno = 0:(nframes*10-1)
        harqid = harqprocesssequence(subframeno 1);
        if  harqid == 0
            % if there is no harq process transmitting in the current
            % subframe, continue to the next
            continue
        end
        % update current harq process with new transport data and reset the
        % receive buffer if it is the initial transmission. the pssch is
        % transmitted twice with a gap of 'sfgap' subframes irrespective of
        % the success of the first transmission
        if harqprocesses(harqid).rvidx == 1
            harqprocesses(harqid).data = randi([0 1], tbs, 1);
            harqprocesses(harqid).decstate = [];
        end
        % set the rv
        ueconfig.rv = rvseq(harqprocesses(harqid).rvidx);
        % set the subframe number
        ueconfig.nsubframepssch = subframeno;
        % display run time information
        if displaysimulationinformation
            fprintf('subframe: %d. harq process index: %d. redundancy version: %d\n',subframeno,harqid,ueconfig.rv)
        end
        % channel time for the current subframe
        channel.inittime = subframeno/1000;
        % create an empty resource grid
        slgrid = lteslresourcegrid(ueconfig);
        % update the transmission config with the starting rb
        startingrb = rbstart(harqprocesses(harqid).rvidx);
        resourcepool.config.startrb_subchannel_r14 = startingrb;
        % calculate the riv from the number of allocated subchannels and
        % the starting subchannel
        ueconfig.firstsubchannelidx = 0;
        beta = 0;
        if strcmpi(resourcepool.config.adjacencypscch_pssch_r14,'on')
            beta = 2;
        end
        lsubch = ceil((nprb beta)/resourcepool.config.sizesubchannel_r14);
        scimessage.riv = resourcepool.encoderiv(lsubch,ueconfig.firstsubchannelidx);
        % set the retransmission index
        scimessage.retransmissionidx = harqprocesses(harqid).rvidx - 1;
        % create the sci and message bits
        sciconfig = ueconfig;
        sciconfig.psschnsubchannels = resourcepool.config.numsubchannel_r14;
        [scimessage, scibits] = ltesci(sciconfig,scimessage);
        % perform sci encoding
        [cw,crc] = ltesciencode(sciconfig, scibits);
        % nxid is the 16 bit crc associated with the pscch sci grant and is
        % used as the pssch scrambling identity
        ueconfig.nxid = crc;
        % store nxid value in 'expectednxid' so that the receiver won't
        % have to access 'scimessage' at all
        expectednxid = ueconfig.nxid;
        % display the subframes and resource blocks for transmission. note
        % that the allocations are the same for all harq processes and that
        % the plot does not show the subframe offset for harq processes
        % other than 1
        if (displaysimulationinformation) && (harqid==1)
            % specify the additional parameters required for the resource
            % pool display
            scimessage.firstsubchannelidx = ueconfig.firstsubchannelidx;
            scimessage.slindex = 0;
            resourcepool.displayperiod(scimessage,10);
            drawnow;
        end
        % create the pscch codeword
        pscchsymbols = ltepscch(cw);
        % get the resource allocation for the pscch
        [pscchsf,pscchrb] = resourcepool.getpscchresources(setfield(scimessage,'firstsubchannelidx',ueconfig.firstsubchannelidx)); %#ok
        % select the resource for this transmission
        sciconfig.prbset = pscchrb(:,harqprocesses(harqid).rvidx);
        % get the pscch symbol indices
        pscchindices = ltepscchindices(sciconfig);
        % map the pscch symbols on to the grid
        slgrid(pscchindices) = pscchsymbols;
        % define a random cyclic shift from the set {0,3,6,9} for each
        % pscch transmission
        sciconfig.cyclicshift = randi([0 3])*3;
        % create the dm-rs symbols and indices
        pscchdrssymbols = ltepscchdrs(sciconfig);
        pscchdrsindices = ltepscchdrsindices(sciconfig);
        % map the pscch drs symbols on to the grid
        slgrid(pscchdrsindices) = pscchdrssymbols;
        % get the resource allocations for the two transmissions
        [psschsf,psschrb] = resourcepool.getpsschresources(setfield(scimessage,'firstsubchannelidx',ueconfig.firstsubchannelidx)); %#ok
        % now select the resource for this transmission
        ueconfig.prbset = psschrb(:,harqprocesses(harqid).rvidx);
        % calculate the pssch resource indices
        [psschindices,psschinfo] = ltepsschindices(ueconfig);
        % sl-sch and pssch
        cw = lteslsch(ueconfig,psschinfo.g,harqprocesses(harqid).data);
        psschsymbols = ltepssch(ueconfig,cw);
        slgrid(psschindices) = psschsymbols;
        % pssch drs and drs indices
        psschdrssymbols = ltepsschdrs(ueconfig);
        psschdrsindices = ltepsschdrsindices(ueconfig);
        slgrid(psschdrsindices) = psschdrssymbols;
        % the sc-fdma modulation will not use windowing due to the
        % piece-wise nature of the waveform construction
        windowing = 0;
        % perform sidelink sc-fdma modulation
        [txwaveform,scfdmainfo] = lteslscfdmamodulate(ueconfig,slgrid,windowing);
        % add 25 sample padding. this is to cover the range of delays
        % expected from channel modeling (a combination of
        % implementation delay and channel delay spread)
        ntxants = size(txwaveform,2);
        txwaveform = [txwaveform; zeros(25, ntxants)]; %#ok
        % pass data through channel model
        rxnoiselesswaveform = ltefadingchannel(channel,txwaveform);
        % calculate noise gain
        snr = 10^((snrin(snridx))/20);
        % normalize noise power to take account of sampling rate,
        % which is a function of the ifft size used in ofdm
        % modulation, and the number of antennas
        n0 = 1/(sqrt(2.0*ntxants*double(ofdminfo.nfft))*snr);
        % create awgn
        noise = n0*complex(randn(size(rxnoiselesswaveform)),...
            randn(size(rxnoiselesswaveform)));
        % add awgn to the received time domain waveform
        rxwaveform = rxnoiselesswaveform   noise;
        %------------------------------------------------------------------
        %            receiver
        %------------------------------------------------------------------
        % define the receiver top-level configuration
        rxconfig = [];
        rxconfig.sidelinkmode = ueconfig.sidelinkmode;
        rxconfig.cyclicprefixsl = ueconfig.cyclicprefixsl;
        rxconfig.firstsubchannelidx = ueconfig.firstsubchannelidx;
        rxconfig.nslrb = resourcepool.config.nslrb;
        rxconfig.duplexmode = resourcepool.config.duplexmode;
        rxconfig.tddconfig = resourcepool.config.tddconfig;
        rxconfig.psschnsubchannels = resourcepool.config.numsubchannel_r14;
        rxconfig.psschsubchannelsize = resourcepool.config.sizesubchannel_r14;
        rxconfig.psschadjacency = resourcepool.config.adjacencypscch_pssch_r14;
        rxconfig.psschsubchannelprbstart = resourcepool.config.startrb_subchannel_r14;
        rxconfig.nsubframepssch = subframeno; % set the subframe number
        % if sci bler measurement is configured:
        scidecoded = false;
        if measureblerforsci
            % blind decoding of the control channel
            % we know that the current subframe contains control and data,
            % but do not know the location. check for the sci message in
            % the resource pool for all cyclic shifts till it is found or
            % the whole resource pool is searched
            pscchpool = resourcepool.pscchresourceblockpool;
            % re-arrange the resources into the possible prb pairs
            pscchpool = reshape(pscchpool,2,numel(pscchpool)/2);
            p = 1;
            while p <= size(pscchpool,2) && ~scidecoded
                % pscch drs for v2x is transmitted on two consecutive rbs
                rxconfig.prbset = pscchpool(:,p);
                for cs = [0 3 6 9]
                    rxconfig.cyclicshift = cs;
                    [frameoffset,corr] = lteslframeoffsetpscch(rxconfig,rxwaveform);
                    % perform subframe synchronization
                    if (frameoffset > 25) || (frameoffset < 0)
                        frameoffset = lastoffset;
                    end
                    lastoffset = frameoffset;
                    % perform sc-fdma demodulation on the received data to obtain
                    % the resource grid
                    rxsubframe = lteslscfdmademodulate(rxconfig,rxwaveform(1 frameoffset:end,:));
                    % perform channel estimation
                    if(perfectchanestimator)
                        [hest,nest] = perfectchannelestimate(rxconfig,channel,noise,frameoffset);
                    else
                        [hest,nest] = lteslchannelestimatepscch(rxconfig,cec,rxsubframe);
                    end
                    % get the pscch candidate for the current prbset,
                    % extract the corresponding received symbols and
                    % channel estimate and perform equalization
                    pscchcandidate = ltepscchindices(rxconfig);
                    [pscchrx,pscchhest] = lteextractresources(pscchcandidate,rxsubframe,hest);
                    pscchsymbols = lteequalizemmse(pscchrx,pscchhest,nest);
                    % demodulate the pscch
                    codedscibits = ltepscchdecode(pscchsymbols);
                    % get the payload size for the release 14 v2x sci message
                    scilengthinfo = ltesciinfo(rxconfig);
                    % decode the sci and recover the message
                    [rxinfo,rxscierr,rxcrc] = ltescidecode(scilengthinfo.format1,codedscibits);
                    if  ~rxscierr && (rxcrc==expectednxid)
                        scimessagerx = ltesci(rxconfig,rxinfo);
                        rxconfig.nxid = rxcrc;
                        scidecoded = true;
                        if (displaysimulationinformation)
                            fprintf('   sci decoded\n');
                        end
                        break;
                    end
                end
                % increment the pool index
                p = p 1;
            end
            if ~scidecoded
                 if (displaysimulationinformation)
                    fprintf('   sci decoding failed\n');
                 end
            end
            % store values needed to calculate bler
            controlerrors = [controlerrors ~scidecoded];  %#ok
        end
        % if sci decoding failed and the sci is assumed for sl-sch
        % decoding, set the decoded sci message equal to the transmitted
        % sci message. also set the nxid to the expected value
        if (~scidecoded) && (sciassumed)
            scimessagerx = scimessage;
            rxconfig.nxid = expectednxid;
        end
        % if sl-sch throughput measurement is configured and if the sci was
        % successfully decoded or if sci decoding success is assumed,
        % perform pssch reception and sl-sch decoding
        if measuretputforslsch
            if (scidecoded || sciassumed)
                % get the pssch resource allocation from the decoded sci
                % message and pool configuration
                rxconfig.prbset = ltesciresourceallocation(rxconfig,scimessagerx);
                % perform subframe synchronization
                frameoffset = lteslframeoffsetpssch(rxconfig,rxwaveform);
                if (frameoffset > 25) || (frameoffset < 0)
                    frameoffset = lastoffset;
                end
                lastoffset = frameoffset;
                % perform sc-fdma demodulation on the received data to obtain
                % the resource grid
                rxsubframe = lteslscfdmademodulate(rxconfig,rxwaveform(1 frameoffset:end,:));
                % perform channel estimation, extract the received pssch
                % symbols and the corresponding channel estimate, and
                % perform equalization
                if(perfectchanestimator)
                    [hest,nest] = perfectchannelestimate(rxconfig,channel,noise,frameoffset);
                else
                    [hest,nest] = lteslchannelestimatepssch(rxconfig,cec,rxsubframe);
                end
                [psschrx,psschhest] = lteextractresources(psschindices,rxsubframe,hest);
                psschsymbols = lteequalizemmse(psschrx,psschhest,nest);
                % demodulate the pssch
                [~,rxconfig.modulation] = ltemcs(scimessagerx.modcoding,'pusch');
                if (strcmpi(rxconfig.modulation,'64qam'))
                    rxconfig.modulation = '16qam';
                end
                codedslschbits = ltepsschdecode(rxconfig,psschsymbols);
                % decode the sl-sch, including soft combining into the
                % receiver buffer and check the crc
                rxconfig.nturbodecits = 5;  % turbo decoder iterations
                rxconfig.rv = rvseq(harqprocesses(harqid).rvidx);
                [~,slschcrc,harqprocesses(harqid).decstate] = ...
                        lteslschdecode(rxconfig,tbs,codedslschbits, ...
                        harqprocesses(harqid).decstate);
                slschdecoded = ~slschcrc;
            else
                % if sci decoding failed, sl-sch decoding also failed
                slschdecoded = false;
            end
            % store values needed to calculate throughput
            sharedbittput = [sharedbittput tbs*slschdecoded]; %#ok
            txedtrblksizes = [txedtrblksizes tbs]; %#ok
            if (displaysimulationinformation)
                if  slschdecoded
                    fprintf('   sl-sch decoded\n');
                else
                    fprintf('   sl-sch decoding failed\n');
                end
            end
        end
        % update the rv sequence index for the next transmission
        harqprocesses(harqid).rvidx = mod(harqprocesses(harqid).rvidx,size(rvseq,2)) 1;
    end
    if measureblerforsci
        % calculate the sci bler
        simblersci(snridx) = 100*mean(controlerrors,2);
        % display the results dynamically in the command window
        fprintf('\nsnr = %.2f db. sci bler(%%) for %d frame(s) = %.4f %%\n',...
        snrin(snridx),nframes,simblersci(snridx));
    end
    if measuretputforslsch
        % calculate the maximum and simulated throughput
        maxthroughputslsch(snridx) = sum(txedtrblksizes); % max possible throughput
        simthroughputslsch(snridx) = sum(sharedbittput);  % simulated throughput
        % display the results dynamically in the command window
        fprintf('\nsnr = %.2f db. sl-sch throughput for %d frame(s) = %.4f mbps\n',...
             snrin(snridx),nframes,1e-6*simthroughputslsch(snridx)/(nframes*10e-3));
        fprintf('snr = %.2f db. sl-sch throughput(%%) for %d frame(s) = %.4f %%\n',...
        snrin(snridx),nframes,simthroughputslsch(snridx)*100/maxthroughputslsch(snridx));
    end
end
subframe: 0. harq process index: 1. redundancy version: 0
   sci decoding failed
   sl-sch decoding failed
subframe: 4. harq process index: 2. redundancy version: 0
   sci decoded
   sl-sch decoding failed
subframe: 8. harq process index: 1. redundancy version: 2
   sci decoded
   sl-sch decoding failed
subframe: 12. harq process index: 2. redundancy version: 2
   sci decoded
   sl-sch decoded
subframe: 16. harq process index: 1. redundancy version: 0
   sci decoded
   sl-sch decoding failed
subframe: 20. harq process index: 2. redundancy version: 0
   sci decoded
   sl-sch decoding failed
subframe: 24. harq process index: 1. redundancy version: 2
   sci decoded
   sl-sch decoded
subframe: 28. harq process index: 2. redundancy version: 2
   sci decoded
   sl-sch decoded
subframe: 32. harq process index: 1. redundancy version: 0
   sci decoded
   sl-sch decoding failed
subframe: 36. harq process index: 2. redundancy version: 0
   sci decoded
   sl-sch decoding failed
snr = -5.00 db. sci bler(%) for 4 frame(s) = 10.0000 %
snr = -5.00 db. sl-sch throughput for 4 frame(s) = 0.2622 mbps
snr = -5.00 db. sl-sch throughput(%) for 4 frame(s) = 30.0000 %
subframe: 0. harq process index: 1. redundancy version: 0
   sci decoded
   sl-sch decoded
subframe: 4. harq process index: 2. redundancy version: 0
   sci decoded
   sl-sch decoded
subframe: 8. harq process index: 1. redundancy version: 2
   sci decoded
   sl-sch decoded
subframe: 12. harq process index: 2. redundancy version: 2
   sci decoded
   sl-sch decoded
subframe: 16. harq process index: 1. redundancy version: 0
   sci decoded
   sl-sch decoded
subframe: 20. harq process index: 2. redundancy version: 0
   sci decoded
   sl-sch decoded
subframe: 24. harq process index: 1. redundancy version: 2
   sci decoded
   sl-sch decoded
subframe: 28. harq process index: 2. redundancy version: 2
   sci decoded
   sl-sch decoded
subframe: 32. harq process index: 1. redundancy version: 0
   sci decoded
   sl-sch decoded
subframe: 36. harq process index: 2. redundancy version: 0
   sci decoded
   sl-sch decoded
snr = 0.00 db. sci bler(%) for 4 frame(s) = 0.0000 %
snr = 0.00 db. sl-sch throughput for 4 frame(s) = 0.8740 mbps
snr = 0.00 db. sl-sch throughput(%) for 4 frame(s) = 100.0000 %
subframe: 0. harq process index: 1. redundancy version: 0
   sci decoded
   sl-sch decoded
subframe: 4. harq process index: 2. redundancy version: 0
   sci decoded
   sl-sch decoded
subframe: 8. harq process index: 1. redundancy version: 2
   sci decoded
   sl-sch decoded
subframe: 12. harq process index: 2. redundancy version: 2
   sci decoded
   sl-sch decoded
subframe: 16. harq process index: 1. redundancy version: 0
   sci decoded
   sl-sch decoded
subframe: 20. harq process index: 2. redundancy version: 0
   sci decoded
   sl-sch decoded
subframe: 24. harq process index: 1. redundancy version: 2
   sci decoded
   sl-sch decoded
subframe: 28. harq process index: 2. redundancy version: 2
   sci decoded
   sl-sch decoded
subframe: 32. harq process index: 1. redundancy version: 0
   sci decoded
   sl-sch decoded
subframe: 36. harq process index: 2. redundancy version: 0
   sci decoded
   sl-sch decoded
snr = 5.00 db. sci bler(%) for 4 frame(s) = 0.0000 %
snr = 5.00 db. sl-sch throughput for 4 frame(s) = 0.8740 mbps
snr = 5.00 db. sl-sch throughput(%) for 4 frame(s) = 100.0000 %

throughput results

the simulation results are displayed in the matlab® command window after each snr point is completed. they are also captured in output arrays simblersci, simthroughputslsch and maxthroughputslsch. for each simulated snr point, simblersci stores the measured sci bler, simthroughputslsch stores the measured sl-sch throughput in number of bits and maxthroughputslsch stores the maximum possible sl-sch throughput in number of bits.

if measureblerforsci
    % plot pscch/sci bler
    plotresults('sci', 'bler',channel,snrin,simblersci);
end
if measuretputforslsch
    % plot pssch/sl-sch throughput
    plotresults('sl-sch', 'throughput',channel,snrin,simthroughputslsch*100./maxthroughputslsch);
end

for statistically valid results, run the simulation for a larger number of frames. the figures below show the sci bler and sl-sch throughput results when simulating 1000 frames for an extended range of snr values with practical channel estimation.

references

  1. 3gpp ts 36.213 "physical layer procedures"

  2. 3gpp ts 36.101 "user equipment (ue) radio transmission and reception"

local functions

this example uses these helper functions.

  • perfectchannelestimate: perfect channel estimation

  • plotresults: plot the results of the example

% calculate the perfect channel estimate and the noise estimate
function [hest,nest] = perfectchannelestimate(rxconfig,channel,noise,frameoffset)
    % use the uplink perfect channel estimator to calculate
    % the sidelink estimate as both use sc-fdma
    rxconfig.ntxants = 1;
    rxconfig.nulrb = rxconfig.nslrb;
    hest = lteulperfectchannelestimate(rxconfig,channel,frameoffset);
    noisegrid = lteslscfdmademodulate(rxconfig,noise(1 frameoffset:end ,:));
    nest = var(noisegrid(:));
end
% plot the sci bler or sl-sch throughput
function plotresults(chname,simopt,channel,xvalues,yvalues)
    fadingdescription = sprintf('%s%s',channel.delayprofile,num2str(channel.dopplerfreq));
    figure;
    plot(xvalues, yvalues,'*-.');
    v = axis;
    axis([v(1) v(2) -10 110])
    title(sprintf('v2x sidelink %s %s (%%) in %s fading and awgn',chname,simopt,fadingdescription));
    xlabel('snr (db)');
    ylabel([simopt ' (%)']);
    grid on;
end
网站地图