%% PDSCH Bit Error Rate Curve Generation
% This example shows how the LTE Toolbox(TM) can be used to create Physical
% Downlink Shared Channel (PDSCH) Bit Error Rate (BER) curves under
% Additive White Gaussian Noise (AWGN) in a simple Graphical User Interface
% (GUI).

% Copyright 2009-2018 The MathWorks, Inc.

%% Introduction
% <matlab:hPDSCHBER hPDSCHBER.m> provides a simple GUI to draw different
% BER curves for given SNR values and modulation schemes.
%
% A random stream of bits the size of the desired transport block undergoes
% Downlink Shared Channel (DL-SCH) coding to rate match the transport block
% to the available PDSCH bits. Scrambling, modulation, precoding and layer
% mapping are then applied to form the complex PDSCH symbols. AWGN is added
% to these symbols after which channel decoding and demodulation are
% performed to recover the transport block. Using the recovered transport
% block a BER curve is plotted for a given range of SNR values.

hPDSCHBER; % Launch GUI

%% Parameters
% The following GUI parameters are available:
%
% * |TransportBlockSize| - Size of transport block
% * |AvailablePDSCHBits| - Size of coded transport block after rate
% matching (codeword size)
% * |Modulation| - Modulation scheme, one of {'QPSK', '16QAM', '64QAM', 
% '256QAM'}
% * |SNRRange| - Eb/No range in dB
% * |RVSeq| - Redundancy version indicators sequence
% * |NTurboDecIts| - Number of turbo decoder iteration cycles
% * |OverlayGraphs| - Holds the previous graphs when checked, thus overlays
% new curve on previously drawn curves
%
% Altering the various input parameters will affect the shape of the BER
% curve in different ways. The ratio of values assigned to the transport
% block size and available PDSCH bits should fit the range of target turbo
% code rates defined by LTE (1/3, 1/2, 3/4). Furthermore the value assigned
% to the available PDSCH bits are governed by the modulation scheme
% selected, e.g. for 16QAM a value which is a multiple of 4 must be 
% chosen. Higher symbol modulation orders are more sensitive to noise
% interference and thus will suffer degradation in performance when
% compared to lower symbol modulation orders schemes at similar SNR 
% values. The redundancy version must come from the range {0,1,2,3}. It can
% be a single value or a vector of values from the defined set.
%
% The GUI also provides control over the configuration of the number of
% turbo decoder iteration cycles to be used in the decoder algorithm. This
% helps to perform an extended performance analysis of turbo decoder
% algorithm under AWGN. To compare the effect of altering the various
% parameters, all the curves can be plotted onto the same graph by checking
% the |OverlayGraphs| check box.

%% Appendix
% This example uses the following helper functions:
%
% * <matlab:edit('hPDSCHBER.m') hPDSCHBER.m>
