Documentation

This is machine translation

Translated by Microsoft
Mouse over text to see original. Click the button below to return to the English verison of the page.

PDSCH Throughput Conformance Test for Single Antenna (TM1), Transmit Diversity (TM2), Open Loop (TM3) and Closed Loop (TM4/6) Spatial Multiplexing

This example demonstrates how to measure the Physical Downlink Shared Channel (PDSCH) throughput performance using the LTE System Toolbox™ for the following transmission modes (TM):

  • TM1: Single antenna (Port 0)

  • TM2: Transmit diversity

  • TM3: Open loop codebook based precoding: Cyclic Delay Diversity (CDD)

  • TM4: Closed loop codebook based spatial multiplexing

  • TM6: Single layer closed loop codebook based spatial multiplexing

The example also shows how to parameterize and customize the settings for the different TMs. It also supports the use of Parallel Computing Toolbox™ to reduce effective simulation time.

Introduction

This example measures the throughput for a number of SNR points. The provided code can operate under a number of transmission modes: TM1, TM2, TM3, TM4 and TM6.

The example works on a subframe by subframe basis. For each of the considered SNR points a populated resource grid is generated and OFDM modulated to create a transmit waveform. The generated waveform is passed through a noisy fading channel. The following operations are then performed by the receiver: channel estimation, equalization, demodulation and decoding. The throughput performance of the PDSCH is determined using the block CRC result at the output of the channel decoder.

Precoder Matrix Indication (PMI) feedback is implemented for the TMs requiring the feedback of a precoding matrix (TM4 and TM6).

A parfor loop can be used instead of the for loop for the SNR calculation. This is indicated within the example. The parfor statement is part of the Parallel Computing Toolbox and executes the SNR loop in parallel to reduce the total simulation time.

Simulation Configuration

The example is executed for a simulation length of 2 frames for a number of SNR points. A large number of NFrames should be used to produce meaningful throughput results. SNRIn can be an array of values or a scalar. Some TMs are more robust to noise and channel impairments than others, therefore different values of SNR should be used for the supported TMs to get meaningful results.

NFrames = 2;                % Number of frames
SNRIn = [10.3 12.3 14.3];   % SNR range

eNodeB Configuration

This section selects the TM of interest and sets the eNodeB parameters. The TM is selected using the variable txMode, which can take the values TM1, TM2, TM3, TM4 and TM6.

txMode = 'TM4'; % TM1, TM2, TM3, TM4, TM6

The following switch statement sets the eNodeB parameters for the supported TMs. The easiest way to setup the enb configuration structure is to select an existing RMC [ 1 ] with parameters similar to the desired configuration and then make the required modifications. The table below provides a summary of some RMCs defined for the TMs used in this example, and their basic parameters:

                               Alloc    Mod               Coding  Number
RMC   TM                         RBs    scheme  CellRefP    rate   layers
-------------------------------------------------------------------------
R.0  Port0                        1 RB   16QAM   CellRefP=1  R=1/2    1
R.1  Port0                        1 RB   16QAM   CellRefP=1  R=1/2    1
R.2  Port0                       50 RB    QPSK   CellRefP=1  R=1/3    1
R.3  Port0                       50 RB   16QAM   CellRefP=1  R=1/3    1
R.10 TxDiversity|SpatialMux      50 RB    QPSK   CellRefP=2  R=1/3    2
R.11 TxDiversity|SpatialMux|CDD  50 RB   16QAM   CellRefP=2  R=1/2    2
R.12 TxDiversity                  6 RB    QPSK   CellRefP=4  R=1/3    4
R.13 SpatialMux                  50 RB    QPSK   CellRefP=4  R=1/3    1

A convenient way of parameterizing the eNodeB structure enb is:

  • Choose an RMC with similar parameters to the desired configuration, in particular the coding rate. Set this in the field enb.RC

  • Modify the fields of enb which may differ from those in the selected RMC

  • Call lteRMCDL to populate all the other fields in enb

This process is illustrated below.

For the selected TM we choose an RMC and set the fields of interest which may be different from the default RMC values.

simulationParameters = []; % clear simulationParameters
switch txMode
% The single antenna (Port0) mode (TM1) configuration used is based on R.3,
% so we set simulationParameters.RC to R.3. We then set the other required
% field values: NDLRB, CellRefP, TxScheme and Modulation. In this case,
% these correspond to the default values for R.3, but they have been
% included here to show how to specify the value of some of the fields of
% simulationParameters.
    case 'TM1' % based on R.3
        fprintf('\nTM1 - Single antenna (port 0)\n');
        % R.3: Port 0, 50 RB, 16QAM, CellRefP=1, R=1/2
        simulationParameters.RC = 'R.3';
        simulationParameters.NDLRB = 50;
        simulationParameters.CellRefP = 1;
        simulationParameters.PDSCH.TxScheme = 'Port0';
        simulationParameters.PDSCH.Modulation = {'16QAM'};
% The transmit diversity mode (TM2) configuration used is based on R.11, so
% we set simulationParameters.RC to R.11. We then set the other required
% field values: NDLRB, CellRefP, TxScheme, Modulation and NLayers. In this
% case, these correspond to the default values for R.11, but they have been
% included here to show how to specify the value of some of the fields of
% simulationParameters.
    case 'TM2' % based on R.11
        fprintf('\nTM2 - Transmit diversity\n');
        % R.11: TxDiversity, 50 RB, 16QAM, CellRefP=2, R=1/2
        simulationParameters.RC = 'R.11';
        simulationParameters.NDLRB = 50;
        simulationParameters.CellRefP = 2;
        simulationParameters.PDSCH.TxScheme = 'TxDiversity';
        simulationParameters.PDSCH.Modulation = {'16QAM'};
        simulationParameters.PDSCH.NLayers = 2;
% The CDD mode (TM3) configuration used is based on R.11, so we set
% simulationParameters.RC to R.11. We then set the other required field
% values: NDLRB, CellRefP, TxScheme, Modulation and NLayers. By default
% simulationParameters.PDSCH.TxScheme in R.11 is set to TxDiversity, so it
% needs to be set to CDD as shown below.
    case 'TM3' % based on R.11
        fprintf('\nTM3 - CDD\n');
        % R.11: CDD, 50 RB, 16QAM, CellRefP=2, R=1/2
        simulationParameters.RC = 'R.11';
        simulationParameters.NDLRB = 50;
        simulationParameters.CellRefP = 2;
        simulationParameters.PDSCH.TxScheme = 'CDD';
        simulationParameters.PDSCH.Modulation = {'16QAM', '16QAM'};
        simulationParameters.PDSCH.NLayers = 2;
% The spatial multiplexing mode (TM4) configuration used is based on R.11,
% so we set simulationParameters.RC to R.11. We then set the other required
% field values: NDLRB, CellRefP, TxScheme, Modulation and NLayers. By
% default simulationParameters.PDSCH.TxScheme in R.11 is set to
% TxDiversity, so it needs to be set to SpatialMux as shown below. In this
% case we also set the fields CodebookSubset and Rho in order to match the
% conformance test conditions as defined in TS36.101, Section 8.2.1.4.2.
    case 'TM4' % based on R.11
        fprintf('\nTM4 - Codebook based spatial multiplexing\n');
        % R.11: SpatialMux, 50 RB, 16QAM, CellRefP=2, R=1/2
        simulationParameters.RC = 'R.11';
        simulationParameters.NDLRB = 50;
        simulationParameters.CellRefP = 2;
        simulationParameters.PDSCH.TxScheme = 'SpatialMux';
        simulationParameters.PDSCH.Modulation = {'16QAM', '16QAM'};
        simulationParameters.PDSCH.NLayers = 2;
        simulationParameters.PDSCH.CodebookSubset = '110000';
        simulationParameters.PDSCH.Rho = -3;
% The single layer spatial multiplexing mode (TM6) configuration used is
% based on R.13, so we set simulationParameters.RC to R.13. We then set the
% other required field values: NDLRB, CellRefP, TxScheme, Modulation and
% NLayers. In this case, these correspond to the default values for R.13,
% but they have been included here to show how to specify the value of some
% of the fields of simulationParameters. The CodebookSubset field is set to
% an empty string to indicate there is no codebook restriction.
    case 'TM6' % based on R.13
        fprintf('\nTM6 - Codebook based spatial multiplexing with single layer\n');
        % R.13: SpatialMux, 50 RB, QPSK, CellRefP=4, R=1/3
        simulationParameters.RC = 'R.13';
        simulationParameters.NDLRB = 50;
        simulationParameters.CellRefP = 4;
        simulationParameters.PDSCH.TxScheme = 'SpatialMux';
        simulationParameters.PDSCH.Modulation = {'QPSK'};
        simulationParameters.PDSCH.NLayers = 1;
        % No codebook restriction
        simulationParameters.PDSCH.CodebookSubset = '';
    otherwise
        error('Non-supported TM')
end

% Set simulationParameters fields applying to all TMs
simulationParameters.TotSubframes = 1; % Generate one subframe at a time
simulationParameters.PDSCH.CSI = 'On'; % Soft bits are weighted by channel state information
TM4 - Codebook based spatial multiplexing

Now we call lteRMCDL to populate all the fields in simulationParameters not specified above. This function makes use of the specified RC and the user provided fields. The simulationParameters output will include all the required fields not specified by the user, in addition to the specified fields.

enb = lteRMCDL(simulationParameters);

The output enb structure contains, amongst other fields, the transport block sizes and redundancy version sequence for each codeword subframe within a frame. These will be used later in the simulation.

rvSequence = enb.PDSCH.RVSeq;
trBlkSizes = enb.PDSCH.TrBlkSizes;

The number of codewords, ncw, is the number of entries in the enb.PDSCH.Modulation field if it is a cell.

if iscell(enb.PDSCH.Modulation)
    ncw = length(enb.PDSCH.Modulation);
else
    ncw = 1;
end

Set the PMI delay for the closed-loop TMs (TM4 and TM6). This is the delay between a PMI being passed from UE to eNodeB as defined in TS36.101, Table 8.2.1.4.2-1 [ 1 ].

pmiDelay = 8;

Next we print a summary of some of the more relevant simulation parameters. Check these values to make sure they are as expected. The code rate displayed can be useful to detect problems if manually specifying the transport block sizes. Typical values are 1/3, 1/2 and 3/4.

hDisplayENBParameterSummary(enb, txMode);
-- Parameter summary: --------------------------------------------
                   Transmission mode: TM4
                 Transmission scheme: SpatialMux
  Number of downlink resource blocks: 50
 Number of allocated resource blocks: 50
Cell-specific reference signal ports: 2
         Number of transmit antennas: 2
                 Transmission layers: 2
                 Number of codewords: 2
               Modulation codeword 1: 16QAM
    Transport block sizes codeword 1:    12960   12960   12960   12960   12960       0   12960   12960   12960   12960
                Code rate codeword 1:   0.5271  0.4945  0.4945  0.4945  0.4945       0  0.4945  0.4945  0.4945  0.4945
               Modulation codeword 2: 16QAM
    Transport block sizes codeword 2:    12960   12960   12960   12960   12960       0   12960   12960   12960   12960
                Code rate codeword 2:   0.5271  0.4945  0.4945  0.4945  0.4945       0  0.4945  0.4945  0.4945  0.4945
------------------------------------------------------------------

Propagation Channel Model Configuration

The structure channel contains the channel model configuration parameters.

channel.Seed = 10;                   % Random channel seed
channel.NRxAnts = 2;                 % 2 receive antennas
channel.DelayProfile = 'ETU';        % Delay profile
channel.DopplerFreq = 70;            % Doppler frequency
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 sampling rate for the channel model is set using the value returned
% from <matlab:doc('lteOFDMInfo') lteOFDMInfo>.

ofdmInfo = lteOFDMInfo(enb);
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 estimation based on the values of received pilot signals is obtained.

% Perfect channel estimator flag
perfectChanEstimator = false;

If perfectChanEstimator is set to false a configuration structure cec is needed to parameterize the channel estimator. A Doppler frequency of 70 Hz causes the channel to fade relatively slowly over time, therefore a large time averaging window can be used. No averaging is performed in the frequency domain.

% Configure channel estimator
cec.PilotAverage = 'UserDefined';   % Type of pilot symbol averaging
cec.FreqWindow = 1;                 % Frequency window size in REs
cec.TimeWindow = 31;                % Time window size in REs
cec.InterpType = 'Cubic';           % 2D interpolation type
cec.InterpWindow = 'Centered';      % Interpolation window type
cec.InterpWinSize = 1;              % Interpolation window size

Setup HARQ Processes

This example models an implementation of a HARQ retransmission scheme. The HARQ table stores the index of each HARQ processes to use. This is generated for 8-HARQ processes using the helper function hHARQTable.m.

[harqTable, noHarqProcesses] = hHARQTable();

Display Simulation Information

The variable displaySimulationInformation controls the display of simulation information such as the HARQ process number used for each subframe. In case of CRC error the value of the index to the RV sequence is also displayed.

displaySimulationInformation = true;

Processing Loop

To determine the throughput at each SNR point, the PDSCH data is analyzed on a subframe by subframe basis using the following steps:

  • Update Current HARQ Process. The HARQ process either carries new transport data or a retransmission of previously sent transport data depending upon the Acknowledgment (ACK) or Negative Acknowledgment (NACK) based on CRC results. All this is handled by the HARQ scheduler, hHARQScheduling.m. The PDSCH data is updated based on the HARQ state.

  • Set PMI. This step is only applicable to TM4 and TM6 (closed loop spatial multiplexing and single layer closed loop spatial multiplexing). A PMI is taken sequentially from a set of PMIs, txPMIs, each subframe and used by the eNodeB to select a precoding matrix. The PMI recommended by the UE is used by the eNodeB for data transmission. There is a delay of pmiDelay subframes between the UE recommending the PMI and the eNodeB using it to select a precoding matrix. Initially a set of pmiDelay random PMIs is used.

  • Create Transmit Waveform. The data generated by the HARQ process is passed to lteRMCDLTool which produces an OFDM modulated waveform, containing the physical channels and signals.

  • Noisy Channel Modeling. The waveform is passed through a fading channel and AWGN noise is added.

  • Perform Synchronization and OFDM Demodulation. The received symbols are offset to account for a combination of implementation delay and channel delay spread. The symbols are then OFDM demodulated.

  • Perform Channel Estimation. The channel response and noise levels are estimated. These estimates are used to decode the PDSCH.

  • Decode the PDSCH. The recovered PDSCH symbols for all transmit and receive antenna pairs, along with a noise estimate, are demodulated and descrambled by ltePDSCHDecode to obtain an estimate of the received codewords.

  • Decode the Downlink Shared Channel (DL-SCH) and Store the Block CRC Error for a HARQ Process. The vector of decoded soft bits is passed to lteDLSCHDecode; this decodes the codeword and returns the block CRC error used to determine the throughput of the system. The contents of the new soft buffer, harqProc(harqIdx).decState, is available at the output of this function to be used when decoding the next subframe.

  • Update PMI. A PMI is selected and fed back to the eNodeB for future use. This step is only applicable to TM4 and TM6 (close loop spatial multiplexing and single layer closed loop spatial multiplexing).

% The number of transmit antennas P is obtained from the resource grid
% dimensions. 'dims' is M-by-N-by-P where M is the number of subcarriers, N
% is the number of symbols and P is the number of transmit antennas.
dims = lteDLResourceGridSize(enb);
P = dims(3);

% Initialize variables used in the simulation and analysis
% Array to store the maximum throughput for all SNR points
maxThroughput = zeros(length(SNRIn),1);
% Array to store the simulation throughput for all SNR points
simThroughput = zeros(length(SNRIn),1);

% The temporary variables 'enb_init' and 'channel_init' are used to create
% the temporary variables 'enb' and 'channel' within the SNR loop to create
% independent simulation loops for the parfor loop
enb_init = enb;
channel_init = channel;
legendString = ['Throughput: ' enb.PDSCH.TxScheme];
allRvSeqPtrHistory = cell(1,numel(SNRIn));
nFFT = ofdmInfo.Nfft;

for snrIdx = 1:numel(SNRIn)
% To enable the use of parallel computing for increased speed comment out
% the 'for' statement above and uncomment the 'parfor' statement below.
% This needs the Parallel Computing Toolbox. If this is not installed
% 'parfor' will default to the normal 'for' statement. If 'parfor' is
% used it is recommended that the variable 'displaySimulationInformation'
% above is set to false, otherwise the simulation information displays for
% each SNR point will overlap.
% parfor snrIdx = 1:numel(SNRIn)

    % Set the random number generator seed depending to the loop variable
    % to ensure independent random streams
    rng(snrIdx,'combRecursive');

    SNRdB = SNRIn(snrIdx);
    fprintf('\nSimulating at %gdB SNR for %d Frame(s)\n' ,SNRdB, NFrames);

    % Initialize variables used in the simulation and analysis
    offsets = 0;            % Initialize frame offset value
    offset = 0;             % Initialize frame offset value for the radio frame
    blkCRC = [];            % Block CRC for all considered subframes
    bitTput = [];           % Number of successfully received bits per subframe
    txedTrBlkSizes = [];    % Number of transmitted bits per subframe
    enb = enb_init;         % Initialize RMC configuration
    channel = channel_init; % Initialize channel configuration
    pmiIdx = 0;             % PMI index in delay queue

    % The variable harqPtrTable stores the history of the value of the
    % pointer to the RV sequence values for all the HARQ processes
    rvSeqPtrHistory = zeros(ncw, NFrames*10);

    % Initialize state of all HARQ processes
    harqprocess = hDownlinkNewHARQProcess(enb);
    harqProcesses = repmat(harqprocess, 1, max(harqTable));

    % Use random PMIs for the first 'pmiDelay' subframes until feedback is
    % available from the UE; note that PMI feedback is only applicable for
    % spatial multiplexing TMs (TM4 and TM6), but the code here is required
    % for complete initialization of variables in the SNR loop when using
    % the Parallel Computing Toolbox.
    pmidims = ltePMIInfo(enb,enb.PDSCH);
    txPMIs = randi([0 pmidims.MaxPMI], pmidims.NSubbands, pmiDelay);

    for subframeNo = 0:(NFrames*10-1)

        % Reinitialize channel seed for each subframe to increase
        % variability
        channel.Seed = 1+subframeNo;

        % Update subframe number
        enb.NSubframe = subframeNo;

        % Get HARQ index for given subframe from HARQ index table
        harqIdx = harqTable(mod(subframeNo, length(harqTable))+1);

        % Update current HARQ process
        harqProcesses(harqIdx) = hHARQScheduling( ...
            harqProcesses(harqIdx), subframeNo, rvSequence);

        % Extract the current subframe transport block size(s)
        trBlk = trBlkSizes(:, mod(subframeNo, 10)+1).';

        % Display run time information
        if displaySimulationInformation && (any(trBlk) ~= 0)
            % map harqIdx to harq process number
            harqProcNo = find([1:5 7:9]==harqIdx);
            disp(' ');
            disp(['Subframe: ' num2str(subframeNo) '. HARQ process index: ' num2str(harqProcNo)]);
        end

        % Update RV sequence pointer table
        if any(trBlk) ~= 0
            rvSeqPtrHistory(:,subframeNo+1) = harqProcesses(harqIdx).txConfig.RVIdx.';
        else
            rvSeqPtrHistory(:,subframeNo+1) = NaN; % no data in subframe
        end

        % Update the PDSCH transmission config with HARQ process state
        enb.PDSCH = harqProcesses(harqIdx).txConfig;
        data = harqProcesses(harqIdx).data;

        % Set the PMI to the appropriate value in the delay queue
        if strcmpi(enb.PDSCH.TxScheme,'SpatialMux')
            pmiIdx = mod(subframeNo, pmiDelay);     % PMI index in delay queue
            enb.PDSCH.PMISet = txPMIs(:, pmiIdx+1); % Set PMI
        end

        % Create transmit waveform and 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)
        txWaveform = [lteRMCDLTool(enb, data); zeros(25, P)];

        % Initialize channel time for each subframe
        channel.InitTime = subframeNo/1000;

        % Pass data through channel model
        rxWaveform = lteFadingChannel(channel, txWaveform);

        % Calculate noise gain including compensation for downlink power
        % allocation
        SNR = 10^((SNRdB-enb.PDSCH.Rho)/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*enb.CellRefP*double(nFFT))*SNR);

        % Create additive white Gaussian noise
        noise = N0*complex(randn(size(rxWaveform)), ...
                            randn(size(rxWaveform)));

        % Add AWGN to the received time domain waveform
        rxWaveform = rxWaveform + noise;

        % Once every frame, on subframe 0, calculate a new synchronization
        % offset
        if (mod(subframeNo,10) == 0)
            offset = lteDLFrameOffset(enb, rxWaveform);
            if (offset > 25)
                offset = offsets(end);
            end
            offsets = [offsets offset]; %#ok
        end

        % Synchronize the received waveform
        rxWaveform = rxWaveform(1+offset:end, :);

        % Perform OFDM demodulation on the received data to recreate the
        % resource grid
        rxSubframe = lteOFDMDemodulate(enb, rxWaveform);

        % Channel estimation
        if(perfectChanEstimator)
            estChannelGrid = lteDLPerfectChannelEstimate(enb, channel, offset); %#ok
            noiseGrid = lteOFDMDemodulate(enb, noise(1+offset:end ,:));
            noiseEst = var(noiseGrid(:));
        else
            [estChannelGrid, noiseEst] = lteDLChannelEstimate( ...
                enb, enb.PDSCH, cec, rxSubframe);
        end

        % Get PDSCH indices
        [pdschIndices,~] = ...
            ltePDSCHIndices(enb, enb.PDSCH, enb.PDSCH.PRBSet);

        % Get PDSCH resource elements from the received subframe. Scale the
        % received subframe by the PDSCH power factor Rho. The PDSCH is
        % scaled by this amount, while the cell reference symbols used for
        % channel estimation (used in the PDSCH decoding stage) are not.
        [pdschRx, pdschHest] = lteExtractResources(pdschIndices, ...
            rxSubframe*(10^(-enb.PDSCH.Rho/20)), estChannelGrid);

        % Decode PDSCH
        [dlschBits,~] = ltePDSCHDecode(enb, enb.PDSCH,...
            pdschRx, pdschHest, noiseEst);

        % Decode the DL-SCH
        [decbits, harqProcesses(harqIdx).blkerr, ...
            harqProcesses(harqIdx).decState] = lteDLSCHDecode( ...
            enb, enb.PDSCH, trBlk, dlschBits, ...
            harqProcesses(harqIdx).decState);

        % Display block errors
        if displaySimulationInformation && any(harqProcesses(harqIdx).blkerr)
            disp(['Block error. RV index: ' num2str(harqProcesses(harqIdx).txConfig.RVIdx) ', CRC: ' num2str(harqProcesses(harqIdx).blkerr)])
        end

        % Store values to calculate throughput
        % Only for subframes with data
        if(any(trBlk) ~= 0)
            blkCRC = [blkCRC harqProcesses(harqIdx).blkerr]; %#ok<AGROW>
            bitTput = [bitTput trBlk.*(1- ...
                harqProcesses(harqIdx).blkerr)]; %#ok<AGROW>
            txedTrBlkSizes = [txedTrBlkSizes trBlk]; %#ok<AGROW>
        end

        % Provide PMI feedback to the eNodeB
        if strcmpi(enb.PDSCH.TxScheme,'SpatialMux')
            PMI = ltePMISelect(enb, enb.PDSCH, estChannelGrid, noiseEst);
            txPMIs(:, pmiIdx+1) = PMI;
        end
    end

    % Calculate maximum and simulated throughput
    maxThroughput(snrIdx) = sum(txedTrBlkSizes); % Maximum possible throughput
    simThroughput(snrIdx) = sum(bitTput,2);      % Simulated throughput

    % Display the results dynamically in the command window
    fprintf([['\nThroughput(Mbps) for ', num2str(NFrames) ' Frame(s) '],...
        '= %.4f\n'], 1e-6*simThroughput(snrIdx)/(NFrames*10e-3));
    fprintf(['Throughput(%%) for ', num2str(NFrames) ' Frame(s) = %.4f\n'],...
        simThroughput(snrIdx)*100/maxThroughput(snrIdx));

    allRvSeqPtrHistory{snrIdx} = rvSeqPtrHistory;

end

% Plot the RV sequence for all HARQ processes
hPlotRVSequence(SNRIn,allRvSeqPtrHistory,NFrames);
Simulating at 10.3dB SNR for 2 Frame(s)
 
Subframe: 0. HARQ process index: 1
Block error. RV index: 1  1, CRC: 1  1
 
Subframe: 1. HARQ process index: 2
Block error. RV index: 1  1, CRC: 1  1
 
Subframe: 2. HARQ process index: 3
Block error. RV index: 1  1, CRC: 1  1
 
Subframe: 3. HARQ process index: 4
Block error. RV index: 1  1, CRC: 1  1
 
Subframe: 4. HARQ process index: 5
Block error. RV index: 1  1, CRC: 1  1
 
Subframe: 6. HARQ process index: 6
Block error. RV index: 1  1, CRC: 1  1
 
Subframe: 7. HARQ process index: 7
Block error. RV index: 1  1, CRC: 1  1
 
Subframe: 8. HARQ process index: 8
Block error. RV index: 1  1, CRC: 1  1
 
Subframe: 9. HARQ process index: 2
 
Subframe: 10. HARQ process index: 1
 
Subframe: 11. HARQ process index: 3
Block error. RV index: 2  2, CRC: 1  0
 
Subframe: 12. HARQ process index: 4
 
Subframe: 13. HARQ process index: 5
 
Subframe: 14. HARQ process index: 6
 
Subframe: 16. HARQ process index: 7
Block error. RV index: 2  2, CRC: 1  0
 
Subframe: 17. HARQ process index: 8
 
Subframe: 18. HARQ process index: 2
Block error. RV index: 1  1, CRC: 1  1
 
Subframe: 19. HARQ process index: 3
Block error. RV index: 3  1, CRC: 0  1

Throughput(Mbps) for 2 Frame(s) = 9.7200
Throughput(%) for 2 Frame(s) = 41.6667

Simulating at 12.3dB SNR for 2 Frame(s)
 
Subframe: 0. HARQ process index: 1
Block error. RV index: 1  1, CRC: 1  1
 
Subframe: 1. HARQ process index: 2
 
Subframe: 2. HARQ process index: 3
Block error. RV index: 1  1, CRC: 1  1
 
Subframe: 3. HARQ process index: 4
Block error. RV index: 1  1, CRC: 1  1
 
Subframe: 4. HARQ process index: 5
Block error. RV index: 1  1, CRC: 0  1
 
Subframe: 6. HARQ process index: 6
Block error. RV index: 1  1, CRC: 1  1
 
Subframe: 7. HARQ process index: 7
Block error. RV index: 1  1, CRC: 1  1
 
Subframe: 8. HARQ process index: 8
Block error. RV index: 1  1, CRC: 1  1
 
Subframe: 9. HARQ process index: 2
 
Subframe: 10. HARQ process index: 1
 
Subframe: 11. HARQ process index: 3
 
Subframe: 12. HARQ process index: 4
 
Subframe: 13. HARQ process index: 5
Block error. RV index: 1  2, CRC: 1  0
 
Subframe: 14. HARQ process index: 6
 
Subframe: 16. HARQ process index: 7
 
Subframe: 17. HARQ process index: 8
 
Subframe: 18. HARQ process index: 2
Block error. RV index: 1  1, CRC: 1  1
 
Subframe: 19. HARQ process index: 3
Block error. RV index: 1  1, CRC: 1  0

Throughput(Mbps) for 2 Frame(s) = 12.3120
Throughput(%) for 2 Frame(s) = 52.7778

Simulating at 14.3dB SNR for 2 Frame(s)
 
Subframe: 0. HARQ process index: 1
Block error. RV index: 1  1, CRC: 1  1
 
Subframe: 1. HARQ process index: 2
 
Subframe: 2. HARQ process index: 3
Block error. RV index: 1  1, CRC: 1  1
 
Subframe: 3. HARQ process index: 4
Block error. RV index: 1  1, CRC: 1  0
 
Subframe: 4. HARQ process index: 5
Block error. RV index: 1  1, CRC: 1  0
 
Subframe: 6. HARQ process index: 6
Block error. RV index: 1  1, CRC: 1  1
 
Subframe: 7. HARQ process index: 7
Block error. RV index: 1  1, CRC: 1  0
 
Subframe: 8. HARQ process index: 8
Block error. RV index: 1  1, CRC: 0  1
 
Subframe: 9. HARQ process index: 2
 
Subframe: 10. HARQ process index: 1
 
Subframe: 11. HARQ process index: 3
 
Subframe: 12. HARQ process index: 4
 
Subframe: 13. HARQ process index: 5
 
Subframe: 14. HARQ process index: 6
 
Subframe: 16. HARQ process index: 7
Block error. RV index: 2  1, CRC: 0  1
 
Subframe: 17. HARQ process index: 8
Block error. RV index: 1  2, CRC: 1  0
 
Subframe: 18. HARQ process index: 2
Block error. RV index: 1  1, CRC: 1  1
 
Subframe: 19. HARQ process index: 3
Block error. RV index: 1  1, CRC: 1  0

Throughput(Mbps) for 2 Frame(s) = 13.6080
Throughput(%) for 2 Frame(s) = 58.3333

RV Sequence Pointer Plots

The code above also generates plots with the value of the pointers to the elements in the RV sequence for the simulated subframes. This provides an idea of the retransmissions required. We plot the pointers and note the RV values used in case these are not organized in ascending order. For example, in some cases the RV sequence can be [0, 2, 3, 1]. Plotting these values as they are used will not provide a clear idea of the number of retransmissions needed.

When transmitting a new transport block, the first element of the RV sequence is used. In the plots above a value of 1 is shown for that subframe. This is the case at the beginning of the simulation. If a retransmission is required, the next element in the RV sequence is selected and the pointer is increased. A value of 2 will be plotted for the subframe where the retransmission takes place. If further retransmissions are required the pointer value will increase further. Note that the plots do not show any value in subframe 5 of consecutive frames. This is because no data is transmitted in those subframes.

The figure shown below was obtained simulating 10 frames. Note how in some cases up to 3 retransmissions are required.

Throughput Results

The throughput results for the simulation are displayed in the MATLAB® command window after each SNR point is completed. They are also captured in simThroughput and maxThroughput. simThroughput is an array with the measured throughput in number of bits for all simulated SNR points. maxThroughput stores the maximum possible throughput in number of bits for each simulated SNR point.

% Plot throughput
figure
plot(SNRIn, simThroughput*100./maxThroughput,'*-.');
xlabel('SNR (dB)');
ylabel('Throughput (%)');
legend(legendString,'Location','NorthWest');
grid on;

The generated plot has been obtained with a low number of frames, therefore the results shown are not representative. A longer simulation obtained with 1000 frames produced the results shown below.

Appendix

This example uses the helper functions:

Selected Bibliography

  1. 3GPP TS 36.101 "User Equipment (UE) radio transmission and reception"

Was this topic helpful?