Main Content

End-to-End DVB-S2X Simulation with RF Impairments and Corrections for Regular Frames

This example shows how to measure the bit error rate (BER) and packet error rate (PER) of a single stream Digital Video Broadcasting Satellite Second Generation extended (DVB-S2X) link that has constant coding and modulation for regular frames. The example describes the symbol timing and carrier synchronization strategies in detail emphasizing on how to estimate the RF front-end impairments under heavy noise conditions. The single stream signal adds RF front-end impairments and then passes the waveform through an additive white Gaussian noise (AWGN) channel.


The DVB-S2X standard, an extension of the DVB-S2 specification, enhances the support provided for core DVB-S2 applications and improves overall efficiency over satellite links. The DVB-S2X standard supports these additional features:

  • More granularity of modulation and code rates

  • Smaller filter roll-off options for better utilization of bandwidth

  • Constellations optimized for linear and nonlinear channels

  • More scrambling options for critical co-channel interference scenarios

DVB-S2X caters to a variety of different target applications, and the receivers are subjected to different types and levels of RF impairments based on the application used. This example designs the synchronization aspects of a DVB-S2X receiver used for core DVB-S2 applications. The example supports the newer code rates, higher modulation schemes such as 64, 128 and 256 APSK, and smaller filter roll-off options.

ETSI EN 302 307-2 Section 6 Table 20a and Table 20c [1] summarizes the Quasi-Error-Free (QEF) performance requirement over an AWGN channel for different modulation schemes and code rates. The operating Es/No range for different transmission modes can be considered as +3 or -2 dB from the Es/No point where QEF performance is observed. Because the operating Es/No range is low, carrier and symbol timing synchronization strategies are challenging design problems.

This diagram summarizes the example workflow.

Main Processing Loop

The example processes 30 physical layer (PL) frames of data with the Es/No set to 25 dB, and then computes the BER and PER. Carrier frequency offset, sampling clock offset, and phase noise impairments are applied to the modulated signal, and AWGN is added to the signal.

At the receiver, after matched filtering, timing and carrier recovery operations are run to recover the transmitted data. To extract PL frames, the distorted waveform is processed through various timing and carrier recovery strategies The carrier recovery algorithms are pilot-aided. To decode the data frames, the physical layer transmission parameters, such as modulation scheme, code rate, and FEC frame type, are recovered from the PL header. To regenerate the input bit stream, the baseband (BB) header is decoded.

Because the DVB-S2X standard supports packetized and continuous modes of transmission, the BB frame can be either a concatenation of user packets or a stream of bits. The BB header is recovered to determine the mode of transmission. If the BB frame is a concatenation of user packets, the packet cyclic redundancy check (CRC) status of each packet is returned along with the decoded bits, and then the PER and BER are measured.

These block diagrams show the synchronization and input bit recovery workflows.

Download DVB-S2X LDPC Parity Matrices Data Set

This example loads a MAT-file with DVB-S2X LDPC parity matrices. If the MAT-file is not available on the MATLAB® path, use these commands to download and unzip the MAT-file.

if ~exist('dvbs2xLDPCParityMatrices.mat','file')
    if ~exist('','file')
        url = '';

DVB-S2X Configuration in Pilot-Aided Mode

Specify the cfgDVBS2X structure to define DVB-S2X transmission configuration parameters. PLSDecimalCode 129 and 131 are not supported because they are used for generating VL-SNR frames. Only the regular frames are supported.

cfgDVBS2X.StreamFormat = "TS";
cfgDVBS2X.PLSDecimalCode = 191;                   % 64APSK 7/9 with pilots
cfgDVBS2X.DFL = 50128;
cfgDVBS2X.ScalingMethod = "Unit average power";
cfgDVBS2X.RolloffFactor = 0.35;
cfgDVBS2X.SamplesPerSymbol = 2
cfgDVBS2X = struct with fields:
        StreamFormat: "TS"
      PLSDecimalCode: 191
                 DFL: 50128
       ScalingMethod: "Unit average power"
       RolloffFactor: 0.3500
    SamplesPerSymbol: 2

Simulation Parameters

The DVB-S2X standard supports flexible channel bandwidths. Use a typical channel bandwidth such as 36 MHz. The channel bandwidth can be varied. The coarse frequency synchronization algorithm implemented in this example can track carrier frequency offsets up to 11% of the input symbol rate. The symbol rate is calculated as B/(1+R), where B is the channel bandwidth, and R is the transmit filter roll-off factor. The algorithms implemented in this example can correct the sampling clock offset up to 10 ppm.

simParams.sps = cfgDVBS2X.SamplesPerSymbol;              % Samples per symbol
simParams.numFrames = 30;                                % Number of frames to be processed
simParams.chanBW = 36e6;                                 % Channel bandwidth in Hertz
simParams.cfo = 2e6;                                     % Carrier frequency offset in Hertz
simParams.sco = 2;                                       % Sampling clock offset in parts per million
simParams.phNoiseLevel = "Low";           % Phase noise level provided as 'Low', 'Medium', or 'High'
simParams.EsNodB = 25;                                   % Energy per symbol to noise ratio in decibels

This table defines the phase noise mask (dBc/Hz) used to generate the phase noise applied to the transmitted signal. These noise masks are taken from ETSI TR 102 376-1 Section Figure 12 [2].

Generate DVB-S2X Waveform Distorted with RF Impairments

To create a DVB-S2X waveform, use the HelperDVBS2XRxInputGenerate helper function with the simParams and cfgDVBS2X structures as inputs. The function returns the data signal, transmitted and received waveforms, physical layer configuration parameters as a structure, and a receiver processing structure. The received waveform is impaired with carrier frequency, timing phase offsets, and phase noise and then passed through an AWGN channel. The receiver processing parameters structure, rxParams, includes the reference pilot fields, pilot indices, counters, and buffers. Plot the constellation of the received symbols and the spectrum of the transmitted and received waveforms.

[data,txOut,rxIn,phyConfig,rxParams] = HelperDVBS2XRxInputGenerate(cfgDVBS2X,simParams);
              FECFrame: "normal"
      ModulationScheme: "64APSK"
    LDPCCodeIdentifier: "7/9"
% Received signal constellation plot
rxConst = comm.ConstellationDiagram('Title','Received data', ...
    'XLimits',[-1 1],'YLimits',[-1 1], ...
    'ShowReferenceConstellation',false, ...

% Transmitted and received signal spectrum visualization
Rsymb = simParams.chanBW/(1 + cfgDVBS2X.RolloffFactor);
Fsamp = Rsymb*simParams.sps;
specAn = dsp.SpectrumAnalyzer('SampleRate',Fsamp, ...
    'ChannelNames',{'Transmitted waveform','Received waveform'}, ...

Configure Receiver Parameters

At the receiver, symbol timing synchronization is performed on the received data and is then followed by frame synchronization. The receiver algorithms include coarse and fine frequency impairment correction algorithms. The carrier frequency estimation algorithm can track carrier frequency offsets up to 20% of the input symbol rate. The coarse frequency estimation, implemented as a frequency locked loop (FLL), reduces the frequency offset to a level that the fine frequency estimator can track. The preferred loop bandwidth for symbol timing and coarse frequency compensation depends on the Es/No setting.

A block of 36 pilots is repeated every 1476 symbols. The coarse frequency error estimation uses 34 of the 36 pilot symbols. The ratio of used pilots per block (34) and pilot periodicity(1476) is 0.023. Using the 0.023 value as a scaling factor for the coarse frequency synchronizer loop bandwidth is preferred.

When you decrease the Es/No, reduce the loop bandwidth to filter out more noise during acquisition. The number of frames required for the symbol synchronizer and coarse FLL to converge depends on the loop bandwidth setting.

The frame synchronization uses the PL header. Because the carrier synchronization is data-aided, the frame synchronization must detect the start of frame accurately. Es/No plays a crucial role in determining the accuracy of the frame synchronization. When QPSK modulated frames are being recovered at Es/No values below 3 dB, the frame synchronization must be performed on multiple frames for accurate detection.

The fine frequency estimation can track carrier frequency offsets up to 4% of the input symbol rate. The fine frequency estimation must process multiple pilot blocks for the residual carrier frequency offset to be reduced to levels acceptable for the phase estimation algorithm. The phase estimation algorithm can handle residual carrier frequency error less than 0.02% of the input symbol rate.

These settings are assigned in the rxParams structure for synchronization processing. For details on how to set these parameters for low Es/No values, see the Further Exploration section.

rxParams.carrSyncLoopBW = 1e-2*0.023;        % Coarse frequency estimator loop bandwidth normalized by symbol rate
rxParams.symbSyncLoopBW = 8e-3;              % Symbol timing synchronizer loop bandwidth normalized by symbol rate
rxParams.symbSyncLock  = 8;                  % Number of frames required for symbol timing error convergence
rxParams.frameSyncLock = 1;                  % Number of frames required for frame synchronization
rxParams.coarseFreqLock = 5;                 % Number of frames required for coarse frequency acquisition
rxParams.fineFreqLock = 4;                   % Number of frames required for fine frequency estimation

% Total frames taken for symbol timing and coarse frequency lock to happen
rxParams.initialTimeFreqSync = rxParams.symbSyncLock + rxParams.frameSyncLock + rxParams.coarseFreqLock;
% Total frames used for overall synchronization
rxParams.totalSyncFrames = rxParams.initialTimeFreqSync + rxParams.fineFreqLock;

% Create time frequency synchronization System object by using
% HelperDVBS2TimeFreqSynchronizer helper object
timeFreqSync = HelperDVBS2TimeFreqSynchronizer( ...
    'CarrSyncLoopBW',rxParams.carrSyncLoopBW, ...
    'SymbSyncLoopBW',rxParams.symbSyncLoopBW, ...
    'SamplesPerSymbol',simParams.sps, ...
    'DataFrameSize',rxParams.xFecFrameSize, ...
    'SymbSyncTransitFrames',rxParams.symbSyncLock, ...

% Initialize error computing parameters
[numFramesLost,pktsErr,bitsErr,pktsRec] = deal(0);

% Initialize data indexing variables
stIdx = 0;
dataSize = rxParams.inputFrameSize;
plFrameSize = rxParams.plFrameSize;
dataStInd = rxParams.totalSyncFrames + 1;
isLastFrame = false;
symSyncOutLen = zeros(rxParams.initialTimeFreqSync,1);

Timing and Carrier Synchronization and Data Recovery

To synchronize the received data and recover the input bit stream, the distorted DVB-S2X waveform samples are processed one frame at a time by following these steps.

  1. Apply matched filtering, outputting at the rate of two samples per symbol.

  2. Apply symbol timing synchronization using the Gardner timing error detector with an output generated at the symbol rate. The Gardner TED is not data-aided, so it is performed before carrier synchronization.

  3. Apply frame synchronization to detect the start of frame and to identify the pilot positions.

  4. Estimate and apply coarse frequency offset correction.

  5. Estimate and apply fine frequency offset correction.

  6. Estimate and compensate for residual carrier frequency and phase noise.

  7. Decode the PL header and compute the transmission parameters.

  8. Demodulate and decode the PL frames.

  9. Perform CRC check on the BB header, if the check passes, recover the header parameters.

  10. Regenerate the input stream of data or packets from BB frames.

while stIdx < length(rxIn)

    % Use one DVB-S2X PL frame for each iteration.
    endIdx = stIdx + rxParams.plFrameSize*simParams.sps;

    % In the last iteration, all the remaining samples in the received
    % waveform are considered.
    isLastFrame = endIdx > length(rxIn);
    endIdx(isLastFrame) = length(rxIn);
    rxData = rxIn(stIdx+1:endIdx);

    % After coarse frequency offset loop is converged, the FLL works with a reduced loop bandwidth.
    if rxParams.frameCount < rxParams.initialTimeFreqSync
        coarseFreqLock = false;
        coarseFreqLock = true;

    % Retrieve the last frame samples.
    if isLastFrame
        resSymb = plFrameSize - length(rxParams.cfBuffer);
        resSampCnt = resSymb*rxParams.sps - length(rxData);
        if resSampCnt >= 0                           % Inadequate number of samples to fill last frame
            syncIn = [rxData; zeros(resSampCnt, 1)];
        else                                         % Excess samples are available to fill last frame
            syncIn = rxData(1:resSymb*rxParams.sps);
        syncIn = rxData;

    % Apply matched filtering, symbol timing synchronization, frame
    % synchronization, and coarse frequency offset compensation.
    [coarseFreqSyncOut,syncIndex,phEst] = timeFreqSync(syncIn,coarseFreqLock);
    if rxParams.frameCount <= rxParams.initialTimeFreqSync
        symSyncOutLen(rxParams.frameCount) = length(coarseFreqSyncOut);
        if any(abs(diff(symSyncOutLen(1:rxParams.frameCount))) > 5)
            error('Symbol timing synchronization failed. The loop will not converge. No frame will be recovered. Update the symbSyncLoopBW parameter according to the EsNo setting for proper loop convergence.');

    rxParams.syncIndex = syncIndex;

    % The PL frame start index lies somewhere in the middle of the chunk being processed.
    % From fine frequency estimation onwards, the processing happens as a PL frame.
    % A buffer is used to store symbols required to fill one PL frame.
    if isLastFrame
        fineFreqIn = [rxParams.cfBuffer; coarseFreqSyncOut];
        fineFreqIn = [rxParams.cfBuffer; coarseFreqSyncOut(1:rxParams.syncIndex-1)];

    % Estimate the fine frequency error by using the HelperDVBS2FineFreqEst
    % helper function.
    % Add 1 to the conditional check because the buffer used to get one PL frame introduces a delay of one to the loop
    % count.
    if (rxParams.frameCount > rxParams.initialTimeFreqSync + 1) && ...
            (rxParams.frameCount <= rxParams.totalSyncFrames + 1)
        rxParams.fineFreqCorrVal = HelperDVBS2FineFreqEst( ...
            fineFreqIn(rxParams.pilotInd),rxParams.numPilotBlks, ...
    if rxParams.frameCount >= rxParams.totalSyncFrames + 1
        fineFreqLock = true;
        fineFreqLock = false;

    if fineFreqLock
        % Normalize the frequency estimate by the input symbol rate
        % freqEst = angle(R)/(pi*(N+1)) where N (18) is the number of elements
        % used to compute the mean of auto correlation (R) in
        % HelperDVBS2FineFreqEst.
        freqEst = angle(rxParams.fineFreqCorrVal)/(pi*(19));

        % Generate the symbol indices using frameCount and plFrameSize.
        % Subtract 2 from the rxParams.frameCount because the buffer used to get one
        % PL frame introduces a delay of one to the count.
        phErr = exp(-1j*2*pi*freqEst*((rxParams.frameCount-2)*plFrameSize:(rxParams.frameCount-1)*plFrameSize-1));
        fineFreqOut = fineFreqIn.*phErr(:);

        % Estimate the phase error estimation by using the HelperDVBS2PhaseEst
        % helper function.
        [phEstRes,rxParams.prevPhaseEst] = HelperDVBS2PhaseEst( ...

        % Compensate for the residual frequency and phase offset by using
        % the
        % HelperDVBS2PhaseCompensate helper function.
        % Use two frames for initial phase error estimation. Starting with the
        % second frame, use the phase error estimates from the previous frame and
        % the current frame in compensation.
        % Add 3 to the frame count comparison to account for delays: One
        % frame due to rxParams.cfBuffer delay and two frames used for phase
        % error estimate.
        if rxParams.frameCount >= rxParams.totalSyncFrames + 3
            phaseCompOut = HelperDVBS2PhaseCompensate(rxParams.ffBuffer, ...

        rxParams.ffBuffer = fineFreqOut;
        rxParams.pilotEst = phEstRes;

        % The phase compensation on the data portion is performed by
        % interpolating the phase estimates computed on consecutive pilot
        % blocks. The second phase estimate is not available for the data
        % portion after the last pilot block in the last frame. Therefore,
        % the slope of phase estimates computed on all pilot blocks in the
        % last frame is extrapolated and used to compensate for the phase
        % error on the final data portion.
        if isLastFrame
            pilotBlkLen = 36;    % Symbols
            pilotBlkFreq = 1476; % Symbols
            avgSlope = mean(diff(phEstRes(2:end)));
            chunkLen = rxParams.plFrameSize - rxParams.pilotInd(end) + ...
            estEndPh = phEstRes(end) + avgSlope*chunkLen/pilotBlkFreq;
            phaseCompOut1 = HelperDVBS2PhaseCompensate(rxParams.ffBuffer, ...

    % Recover the input bit stream.
    if rxParams.frameCount >= rxParams.totalSyncFrames + 3
        isValid = true;
        if isLastFrame
            syncOut = [phaseCompOut;phaseCompOut1];
            syncOut = phaseCompOut;
        isValid = false;
        syncOut = [];

    % Update the buffers and counters.
    rxParams.cfBuffer = coarseFreqSyncOut(rxParams.syncIndex:end);
    rxParams.syncIndex = syncIndex;
    rxParams.frameCount = rxParams.frameCount + 1;

    if isValid  % Data valid signal

        % Decode the PL header by using the HelperDVBS2XPLHeaderRecover helper
        % function. Start of frame (SOF) is 26 symbols which are discarded
        % before header decoding. They are only required for frame
        % synchronization.
        rxPLSCode = syncOut(1:90); % First 90 symbols of frame is PL header
        [plsDecCode, phyParams] = HelperDVBS2XPLHeaderRecover(rxPLSCode,rxParams.s2xStatus);
        % Validate the decoded PL header.
        if plsDecCode ~= cfgDVBS2X.PLSDecimalCode
            fprintf('%s\n','PL header decoding failed')
        else % Demodulation and decoding
            for frameCnt = 1:length(syncOut)/rxParams.plFrameSize
                rxFrame = syncOut((frameCnt-1)*rxParams.plFrameSize+1:frameCnt*rxParams.plFrameSize);
                % Estimate noise variance by using
                % HelperDVBS2NoiseVarEstimate helper function.
                nVar = HelperDVBS2NoiseVarEstimate(rxFrame,rxParams.pilotInd,rxParams.refPilots,rxParams.normFlag);
                % The data begins at symbol 91 (after the header symbols).
                rxDataFrame = rxFrame(91:end);
                % Recover the BB frame by using HelperDVBS2XBBFrameRecover
                % helper function.
                rxBBFrame = HelperDVBS2XBBFrameRecover(rxDataFrame,phyParams,rxParams.plScramblingIndex, ...
                % Recover the input bit stream by using
                % HelperDVBS2StreamRecover helper function.
                if strcmpi(cfgDVBS2X.StreamFormat,'GS') && ~rxParams.UPL
                    [decBits,isFrameLost] = HelperDVBS2StreamRecover(rxBBFrame);
                    if ~isFrameLost && length(decBits) ~= dataSize
                        isFrameLost = true;
                    [decBits,isFrameLost,pktCRC] = HelperDVBS2StreamRecover(rxBBFrame);
                    if ~isFrameLost && length(decBits) ~= dataSize
                        isFrameLost = true;
                        pktCRC = zeros(0,1,'logical');
                    % Compute the packet error rate for TS or GS packetized
                    % mode.
                    pktsErr = pktsErr + numel(pktCRC) - sum(pktCRC);
                    pktsRec = pktsRec + numel(pktCRC);
                if ~isFrameLost
                    ts = sprintf('%s','BB header decoding passed.');
                    ts = sprintf('%s','BB header decoding failed.');
                % Compute the number of frames lost. CRC failure of
                % baseband header is considered a frame loss.
                numFramesLost = isFrameLost + numFramesLost;
                fprintf('%s(Number of frames lost = %1d)\n',ts,numFramesLost)
                % Compute the bits in error.
                if isLastFrame && ~isFrameLost
                    bitsErr = bitsErr + sum(data((dataStInd-1)*dataSize+1:dataStInd*dataSize) ~= decBits);
                    if ~isFrameLost
                        bitsErr = bitsErr + sum(data((dataStInd-1)*dataSize+1:dataStInd*dataSize) ~= decBits);
                dataStInd = dataStInd + 1;
    stIdx = endIdx;
BB header decoding passed.(Number of frames lost = 0)
BB header decoding passed.(Number of frames lost = 0)
BB header decoding passed.(Number of frames lost = 0)
BB header decoding passed.(Number of frames lost = 0)
BB header decoding passed.(Number of frames lost = 0)
BB header decoding passed.(Number of frames lost = 0)
BB header decoding passed.(Number of frames lost = 0)
BB header decoding passed.(Number of frames lost = 0)
BB header decoding passed.(Number of frames lost = 0)
BB header decoding passed.(Number of frames lost = 0)
BB header decoding passed.(Number of frames lost = 0)
BB header decoding passed.(Number of frames lost = 0)

Visualization and Error Logs

Plot the constellation of the synchronized data and compute the BER and PER.

% Synchronized data constellation plot
syncConst = comm.ConstellationDiagram('Title','Synchronized data', ...
    'XLimits',[-1.7 1.7],'YLimits',[-1.7 1.7], ...

% Error metrics display
% For GS continuous streams
if strcmpi(cfgDVBS2X.StreamFormat,'GS') && ~rxParams.UPL
    if (simParams.numFrames-rxParams.totalSyncFrames == numFramesLost)
        fprintf("All frames are lost. No bits are retrieved from BB frames.")
        ber = bitsErr/((dataStInd-rxParams.totalSyncFrames)*dataSize);
        fprintf('BER           : %1.2e\n',ber)
    % For GS and TS packetized streams
    if pktsRec == 0
        fprintf("All frames are lost. No packets are retrieved from BB frames.")
        if strcmpi(cfgDVBS2X.StreamFormat,'TS')
            pktLen = 1504;
            pktLen = cfgDVBS2X.UPL;      % UP length including sync byte
        ber = bitsErr/(pktsRec*pktLen);
        per = pktsErr/pktsRec;
        fprintf('PER: %1.2e\n',per)
        fprintf('BER: %1.2e\n',ber)
PER: 0.00e+00
BER: 0.00e+00

Further Exploration

For BER simulations in AWGN assuming perfect synchronization, use the HelperDVBS2XBitRecover helper function to evaluate the receiver performance. See the examples provided in the M-help section of the HelperDVBS2XBitRecover helper function. For details on how to configure the synchronization parameters of the rxParams for other cfgDVBS2X and simParams settings, see the 'Further Exploration section' of End-to-End DVB-S2 Simulation with RF Impairments and Corrections on how to configure the synchronization parameters of rxParams for other cfgDVBS2X and simParams settings. For higher modulation schemes like 64 APSK and above, this table shows the typical number of frames required for convergence of the symbol timing loop.


The example uses these helper functions:


  1. ETSI Standard EN 302 307-2 V1.1.1(2015-11). Digital Video Broadcasting (DVB); Second Generation Framing Structure, Channel Coding and Modulation Systems for Broadcasting, Interactive Services, News Gathering and other Broadband Satellite Applications; Part 2: DVB-S2 extensions (DVB-S2X).

  2. ETSI Standard TR 102 376-2 V1.2.1(2015-11). Digital Video Broadcasting (DVB); Implementation Guidelines for the Second Generation System for Broadcasting, Interactive Services, News Gathering and other Broadband Satellite Applications; Part 2: S2 extensions (DVB-S2X).

  3. ETSI Standard TR 102 376-1 V1.2.1(2015-11). Digital Video Broadcasting (DVB); Implementation Guidelines for the Second Generation System for Broadcasting, Interactive Services, News Gathering and other Broadband Satellite Applications (DVB-S2).

  4. Mengali, Umberto, and Aldo N.D'Andrea. Synchronization Techniques for Digital Receivers. New York: Plenum Press,1997.

  5. E. Casini, R. De Gaudenzi, and Alberto Ginesi. "DVB‐S2 modem algorithms design and performance over typical satellite channels." International Journal of Satellite Communications and Networking 22, no. 3 (2004): 281-318.

  6. Michael Rice, Digital Communications: A Discrete-Time Approach. New York: Prentice Hall, 2008.

See Also


Related Topics