Main Content

dvbsPLHeaderRecover

Recover physical layer information from DVB-S2 or DVB-S2X header

Since R2024a

    Description

    phyparams = dvbsPLHeaderRecover(rxplheader,Mode=mode) recovers the physical layer (PL) signaling information from the PL header rxplheader of the Digital Video Broadcasting Satellite Second Generation (DVB-S2) or Digital Video Broadcasting Satellite Second Generation extended (DVB-S2X) frame. The function uses the specified mode of operation Mode for PL header recovery and outputs the decoded parameters phyparams.

    example

    Examples

    collapse all

    Recover physical layer (PL) signaling information for a given DVB-S2 frame.

    Load a MAT file containing DVB-S2 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('s2xLDPCParityMatrices.zip','file')
            url = 'https://ssd.mathworks.com/supportfiles/spc/satcom/DVB/s2xLDPCParityMatrices.zip';
            websave('s2xLDPCParityMatrices.zip',url);
            unzip('s2xLDPCParityMatrices.zip');
        end
        addpath('s2xLDPCParityMatrices');
    end

    Specify the number of PL frames per stream.

    nFrames = 2;

    Create bit vector of information bits, data, of concatenated TS UPs.

    s2WaveGen = dvbs2WaveformGenerator;
    syncBits = [0 1 0 0 0 1 1 1]';                   % Sync byte for TS packet is 47 Hex
    pktLen = 1496;                                   % UP length without sync bits is 1496
    numPkts = s2WaveGen.MinNumPackets*nFrames;
    txRawPkts = randi([0 1],pktLen,numPkts);
    txPkts = [repmat(syncBits,1,numPkts); txRawPkts];
    data = txPkts(:);

    Generate the DVB-S2 time-domain waveform using the input information bits. Flush the transmit filter to handle the filter delay and recover the complete last frame.

    txWaveform = [s2WaveGen(data); flushFilter(s2WaveGen)];

    Add additive white Gaussian noise (AWGN) to the generated waveform.

    sps = s2WaveGen.SamplesPerSymbol; 
    EsNodB = 1;
    snrdB = EsNodB - 10*log10(sps);
    rxIn = awgn(txWaveform,snrdB,"measured");

    Create a raised cosine receiver filter.

    rxFilter = comm.RaisedCosineReceiveFilter( ...
        RolloffFactor=s2WaveGen.RolloffFactor, ...
        InputSamplesPerSymbol=sps, ...
        DecimationFactor=sps);
    s = coeffs(rxFilter);
    rxFilter.Gain = sum(s.Numerator);

    Apply matched filtering and remove the filter delay.

    filtOut = rxFilter(rxIn);
    rxFrame = filtOut(rxFilter.FilterSpanInSymbols+1:end);

    Recover the PL information using the PL header of length 90 symbols.

    headerStartIndex = 1;
    headerEndIndex = 90;
    rxPLHeader = rxFrame(headerStartIndex:headerEndIndex);
    phyParams = dvbsPLHeaderRecover(rxPLHeader(:), ...
              Mode="DVB-S2/S2X regular")
    phyParams = struct with fields:
            ModulationOrder: 4
             FECFrameLength: 64800
         LDPCCodeIdentifier: "1/4"
             PLSDecimalCode: 4
          TimeSlicingNumber: -1
        CanonicalMODCODName: ""
                  HasPilots: 0
               IsDummyFrame: 0
    
    

    Recover PL signaling information for a given DVB-S2X wideband frame.

    Load a MAT file containing 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('s2xLDPCParityMatrices.zip','file')
            url = 'https://ssd.mathworks.com/supportfiles/spc/satcom/DVB/s2xLDPCParityMatrices.zip';
            websave('s2xLDPCParityMatrices.zip',url);
            unzip('s2xLDPCParityMatrices.zip');
        end
        addpath('s2xLDPCParityMatrices');
    end

    Specify the number of PL frames per stream. Create a DVB-S2X System object™ and set its properties.

    nFramesPerStream = 1;
    s2xWaveGen = dvbs2xWaveformGenerator(NumInputStreams=5, ...
                   PLSDecimalCode=[140 132 133 141 132], ...
                   DFL=[37168 18448 18448 37168 18448], ...
                   StreamFormat="GS",HasTimeSlicing=true);   

    Create a bit vector of information bits for each stream.

    data =  cell(s2xWaveGen.NumInputStreams,1);
    for i = 1:s2xWaveGen.NumInputStreams
       data{i} = randi([0 1],s2xWaveGen.DFL(i)*nFramesPerStream,1);
    end  

    Generate DVB-S2X waveform. Flush the transmit filter to handle the filter delay and recover the complete last frame.

    txWaveform = [s2xWaveGen(data); flushFilter(s2xWaveGen)];

    Add AWGN noise to the generated waveform.

    sps = 4;                                      % Samples per symbol
    EsNodB = 4;
    snrdB = EsNodB - 10*log10(sps);
    rxWaveform = awgn(txWaveform,snrdB,"measured");

    Create a raised cosine receiver filter. Apply matched filtering and remove the filter delay.

    rxFilter = comm.RaisedCosineReceiveFilter( ...
           RolloffFactor=s2xWaveGen.RolloffFactor, ...
           InputSamplesPerSymbol=sps,DecimationFactor=sps);
    s = coeffs(rxFilter);
    rxFilter.Gain = sum(s.Numerator);
      
    % Matched filtering and filter delay removal
    filtOut = rxFilter(rxWaveform);
    rxSymb = filtOut(rxFilter.FilterSpanInSymbols+1:end);

    Recover the MODCOD and other PL signaling information for the first DVB-S2X wideband stream. Length of PL header is 180 symbols.

    headerStartIndex = 1;
    headerEndIndex = 180;
    rxPLHeader = rxSymb(headerStartIndex:headerEndIndex);
    phyParams = dvbsPLHeaderRecover(rxPLHeader(:), ...
                Mode="DVB-S2X wideband")
    phyParams = struct with fields:
            ModulationOrder: 8
             FECFrameLength: 64800
         LDPCCodeIdentifier: "104/180"
             PLSDecimalCode: 140
          TimeSlicingNumber: 1
        CanonicalMODCODName: ""
                  HasPilots: 0
               IsDummyFrame: 0
    
    

    Recover PL signaling information for a given DVB-S2X VL-SNR frame.

    Load a MAT file containing 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('s2xLDPCParityMatrices.zip','file')
            url = 'https://ssd.mathworks.com/supportfiles/spc/satcom/DVB/s2xLDPCParityMatrices.zip';
            websave('s2xLDPCParityMatrices.zip',url);
            unzip('s2xLDPCParityMatrices.zip');
        end
        addpath('s2xLDPCParityMatrices');
    end

    Specify the number of PL frames per stream. Create DVB-S2X System object™ and set its properties.

    nFrames = 1;
    s2xWaveGen = dvbs2xWaveformGenerator(PLSDecimalCode=129, ...
                 CanonicalMODCODName="QPSK 2/9",DFL=14128, ...
                 PLScramblingIndex=4);

    Create a bit vector with concatenated transport streams user packets.

    syncBits = [0 1 0 0 0 1 1 1]';               % Sync byte for TS packet is 47 Hex
    pktLen = 1496;                               % UP length without sync bits is 1496
    numPkts = s2xWaveGen.MinNumPackets*nFrames;
    txRawPkts = randi([0 1],pktLen,numPkts(1));
    txPkts = [repmat(syncBits,1,numPkts(1)); txRawPkts];
    data = txPkts(:);

    Generate a DVB-S2X VL-SNR transmit waveform. Flush the transmit filter to handle the filter delay and recover the complete last frame.

    txWaveform = [s2xWaveGen(data); flushFilter(s2xWaveGen)];

    Add AWGN noise to the generated waveform.

    sps = 4;                                      % Samples per symbol
    EsNodB = -6;
    snrdB = EsNodB - 10*log10(sps);
    rxWaveform = awgn(txWaveform,snrdB,"measured");

    Create a raised cosine receiver filter. Apply matched filtering and remove the filter delay.

    rxFilter = comm.RaisedCosineReceiveFilter( ...
           RolloffFactor=s2xWaveGen.RolloffFactor, ...
           InputSamplesPerSymbol=sps,DecimationFactor=sps);
    s = coeffs(rxFilter);
    rxFilter.Gain = sum(s.Numerator);
      
    % Matched filtering and filter delay removal
    filtOut = rxFilter(rxWaveform);
    rxSymb = filtOut(rxFilter.FilterSpanInSymbols+1:end);

    Recover the MODCOD and other PL signaling information for the first DVB-S2X VL-SNR stream. The length of the PL header is 990 symbols.

    headerStartIndex = 1;
    headerEndIndex = 990;
    rxPLHeader = rxSymb(headerStartIndex:headerEndIndex);
    phyParams = dvbsPLHeaderRecover(rxPLHeader(:), ...
                      Mode="DVB-S2X vl-snr")
    phyParams = struct with fields:
            ModulationOrder: 4
             FECFrameLength: 64800
         LDPCCodeIdentifier: "2/9"
             PLSDecimalCode: 129
          TimeSlicingNumber: -1
        CanonicalMODCODName: "QPSK 2/9"
                  HasPilots: 1
               IsDummyFrame: 0
    
    

    Input Arguments

    collapse all

    PL header to decode, specified as a column vector. The specified PL header must come from a DVB-S2 or DVB-S2X frame.

    • When you set rxplheader to a length of 90 symbols and Mode to "DVB-S2/S2X regular", dvbsPLHeaderRecover function assesses the header as a DVB-S2 or DVB-S2X regular mode header, or as a PL header of a noise-affected very low signal-to-noise ratio (VL-SNR) frame.

    • When you set rxplheader to a length of 900 or 990 symbols and Mode to "DVB-S2X vl-snr", dvbsPLHeaderRecover function assesses the header as a DVB-S2X VL-SNR frame header.

    • When you set rxplheader to a length of 180 symbols and Mode to "DVB-S2X wideband", dvbsPLHeaderRecover function assesses the header as a DVB-S2X wideband frame header.

    Data Types: double

    Mode of operation for PL header decoding, specified as "DVB-S2/S2X regular", "DVB-S2X vl-snr", or "DVB-S2X wideband".

    Data Types: char | string

    Output Arguments

    collapse all

    PL signaling information, returned as a structure with these fields.

    Structure FieldDescription
    ModulationOrder

    Modulation order of the forward error correction (FEC) symbols, returned as a value from the set {2, 4, 8, 16, 32, 64, 128, 256}.

    A value of 0 indicates a dummy frame.

    FECFrameLength

    Output length of the FEC encoder and input length to the low density parity-check (LDPC) decoder, in bits, returned as a value from the set {16200, 32400, 64800}.

    A value of 0 indicates a dummy frame.

    LDPCCodeIdentifier

    Output code rate of the LDPC encoder, returned as a string scalar or character array.

    PLSDecimalCode

    Physical layer signaling decimal code encapsulated in the header, returned as an integer in the range [0, 255].

    TimeSlicingNumber

    Time slicing number of the wideband PL frame, returned as an integer in the range [0, 255]. This value denotes the service that the current PL frame belongs to, and identifies whether to further process the current PL frame.

    This field applies when you set Mode to "DVB-S2X wideband". If the frame is not a DVB-S2X wideband frame, the output returned is -1.

    CanonicalMODCODName

    Canonical modulation scheme and code rate name, returned as a string scalar or character array.

    Valid CanonicalMODCODName values include these options.

    • "QPSK 2/9", "BPSK 1/5", "BPSK 11/45", "BPSK-S 1/5", "BPSK-S 11/45", and "BPSK 1/3" — Applicable for VL-SNR set 1

    • "BPSK 1/5", "BPSK 4/15", and "BPSK 1/3" — Applicable for VL-SNR set 2

    If the frame is not a VL-SNR frame, the output of this field is empty.

    This field applies when you set Mode to "DVB-S2X vl-snr".

    HasPilots

    Pilot block indication, returned as "true" or "false".

    • For VL-SNR frame, this field is returned as "true".

    • For dummy frame, this field is returned as "false".

    IsDummyFrame

    Dummy frame indicator, returned as "true" or "false". This field indicates if the decoder header is from a dummy frame.

    Extended Capabilities

    C/C++ Code Generation
    Generate C and C++ code using MATLAB® Coder™.

    Version History

    Introduced in R2024a