Main Content

dvbrcs2TurboDecode

Decode DVB-RCS2-compliant turbo codes

    Description

    example

    decoded = dvbrcs2TurboDecode(code,r,permparams) decodes the soft bits in code by using a Digital Video Broadcasting Second Generation Return Channel over Satellite (DVB-RCS2) standard-compliant duo-binary turbo decoder, as defined in ETSI EN 301 545-2 V1.2.1 Section 7.3.5.1 [1]. r is the code rate, and permparams are the permutation control parameters that the function uses to interleave the input soft bits data.

    decoded = dvbrcs2TurboDecode(code,r,permparams,numiter) specifies the number of decoding iterations.

    Examples

    collapse all

    Transmit a Digital Video Broadcasting Second Generation Return Channel over Satellite (DVB-RCS2) encoded signal through an additive white Gaussian noise (AWGN) channel, and then decode it using a DVB-RCS2 duo-binary turbo decoder.

    Specify the frame length, code rate, and permutation control parameters.

    frameLen = 100*8;         % Payload length in bits
    r = "2/3";
    permParams = [37 0 2 0 2];

    Generate a column vector of random binary data, and then encode the message by using a DVB-RCS2 turbo encoder.

    msg = randi([0 1],frameLen,1);
    code = dvbrcs2TurboEncode(msg,r,permParams);

    Modulate the encoded message, and then pass it through an AWGN channel.

    modCode = qammod(code,16,'gray', ...
                 'InputType','bit', ...
                 'UnitAveragePower',true);  % 16QAM Modulation
    snrdB = 10;                             % SNR
    receivedCode = awgn(modCode,snrdB);

    Demodulated the received signal.

    noiseVar = 10.^(-snrdB/10);                   % Noise variance
    demodLLR = qamdemod(receivedCode,16,'gray', ...
                  'OutputType','llr', ...
                  'UnitAveragePower',true, ...
                  'NoiseVariance',noiseVar);      % 16QAM Demodulation

    Decode the demodulated soft bits by using a DVB-RCS2 turbo decoder.

    decoded = dvbrcs2TurboDecode(-1*demodLLR,r, ...
                                 permParams);

    Display the erroneous bits.

    fprintf('Number of bit errors = %f\n',sum(msg~=decoded))
    Number of bit errors = 0.000000
    

    Calculate bit error rate (BER) for a Digital Video Broadcasting Second Generation Return Channel over Satellite (DVB-RCS2) encode-decode chain.

    Specify the frame length, code rate, and permutation control parameters.

    frameLen = 25*8;            % Payload length in bits
    r = "3/4";
    permParams = [19 13 2 9 15];

    Define the simulation parameters.

    snrdB = 6;                  % SNR
    nVar = 10.^(-snrdB/10);     % Noise variance
    errorRate = comm.ErrorRate; % Calculates BER

    Run the encode-decode chain simulation for 10 frames and calculate the BER.

    for frmIdx = 1:10 
        msg = randi([0 1],frameLen,1);
        code = dvbrcs2TurboEncode(msg,r,permParams);
        modCode = qammod(code,4,[0 2 3 1], ...
                     'InputType','bit', ...
                     'UnitAveragePower',true);         % QPSK Modulation
        receivedOut = awgn(modCode, snrdB);
        demodOut = qamdemod(receivedOut,4,[0 2 3 1], ...
                     'OutputType','llr', ...
                     'UnitAveragePower',true, ...
                     'NoiseVariance',nVar);            % QPSK Demodulation
        decoded = dvbrcs2TurboDecode(-1*demodOut,r, ...
                                    permParams);
        errorStats = errorRate(int8(msg),decoded);
    end

    Display the bit error rate.

    fprintf('Error rate = %f\n',errorStats(1));
    Error rate = 0.003500
    
    fprintf('Number of errors detected = %f\n',errorStats(2));
    Number of errors detected = 7.000000
    
    fprintf('Total bits compared = %f\n',errorStats(3));
    Total bits compared = 2000.000000
    

    Input Arguments

    collapse all

    Encoded soft bits, specified as a column vector.

    Data Types: double

    Code rate, specified as one of these values.

    • "1/3"

    • "1/2"

    • "2/3"

    • "3/4"

    • "4/5"

    • "5/6"

    • "6/7"

    • "7/8"

    Data Types: char | string

    Permutation control parameters that the function uses to interleave the input soft bits data, specified as a vector of these five elements in order: P, Q0, Q1, Q2, and Q3. P must be in the range [9, 255], and Q0, Q1, Q2, and Q3 must be in the range [0, 15].

    To generate unique interleaver indices, the value of P must be co-prime to floor((inputmsglen x r)/2). inputmsglen is the length of the input message, before encoding.

    Data Types: double | uint8

    Number of decoding iterations, specified as a positive integer.

    Data Types: double | uint8

    Output Arguments

    collapse all

    Decoded message, returned as a binary-valued column vector.

    Data Types: int8

    References

    [1] EN 301 545-2 - V1.2.1. Digital Video Broadcasting (DVB); Second Generation DVB Interactive Satellite System (DVB-RCS2); Part 2: Lower Layers for Satellite standard (etsi.org).

    Extended Capabilities

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

    Version History

    Introduced in R2021b