Main Content

ccsdsSCPPMEncode

Encode CCSDS-compliant SCPPM codes

    Description

    example

    sym = ccsdsSCPPMEncode(msg,m) encodes the message in msg by using a serially concatenated pulse position modulation (SCPPM) encoder, as defined by the Consultative Committee for Space Data Systems (CCSDS) 142.0-B-1 section 3.8 [1]. m is the modulation order.

    example

    [sym,info] = ccsdsSCPPMEncode(msg,m) also returns the outer convolutional encoder information info.

    Examples

    collapse all

    Encode a message for a single frame using a CCSDS SCPPM encoder.

    Use a comm.CRCGenerator System object™ to generate CRC code bits and append these bits to the input data.

    Note: As specified in CCSDS 142.0-B-1 section 3.6:

    • Fix the generator polynomial for the CRC algorithm to "x^32+x^29+x^18+x^14+x^3+1".

    • Set the initial states of the internal shift register to 1.

    infoSize = 7526;                                     % Information block size without CRC                                
    crc32Generator = comm.CRCGenerator(...
                        Polynomial = "x^32+x^29+x^18+x^14+x^3+1", ...
                        InitialConditions = 1);
    crcIn = randi([0 1],infoSize,1);
    crcOut = crc32Generator(crcIn);                      % Codeword frame with CRC bits appended

    Add termination bits to terminate the outer convolutional encoder, as specified in CCSDS 142.0-B-1 section 3.7.

    msg = [crcOut; 0; 0];

    Specify the modulation order, and then encode the message using the CCSDS SCPPM encoder.

    m = 6;                     
    [sym,info] = ccsdsSCPPMEncode(msg,m);

    Display the outer convolutional encoder information info.

    info
    info = struct with fields:
               OuterEncoderCodeRate: "1/2"
        OuterEncoderPuncturePattern: [1 1 0 1 1 0]
    
    

    Encode a message for multiple frames with constant frame length and modulation order using a CCSDS SCPPM encoder.

    Use a comm.CRCGenerator System object™ to generate CRC code bits and append these bits to the input data.

    Note: As specified in CCSDS 142.0-B-1 section 3.6:

    • Fix the generator polynomial for the CRC algorithm to "x^32+x^29+x^18+x^14+x^3+1".

    • Set the initial states of the internal shift register to 1.

    infoSize = 10046;                       % Information block size without CRC
    numFrames = 10;
    m =  8;                                 % Modulation order
    data = randi([0 1],infoSize,numFrames);
    crc32Generator = comm.CRCGenerator(... 
               Polynomial = "x^32+x^29+x^18+x^14+x^3+1", ...
               InitialConditions = 1);
    sym = zeros(15120/m,numFrames);

    Generate CRC and add termination bits to encode the message using the CCSDS SCPPM encoder.

    for frmIdx = 1:numFrames
        crcData = crc32Generator(data(:,frmIdx));   % Generate CRC
        msgIn = [crcData; 0; 0];                    % Add termination bits
        sym(:,frmIdx) = ccsdsSCPPMEncode(msgIn,m);
    end

    Input Arguments

    collapse all

    Input message, specified as a binary column vector of length 5040, 7560, or 10080 bits. The input message includes both cyclic redundancy check (CRC) and termination bits, as described in CCSDS 142.0-B-1 sections 3.6 and 3.7 [1].

    Data Types: double | int8 | logical

    Modulation order, specified as an integer in the range [2, 8]. This value specifies the number of bits mapped to one constellation symbol.

    Data Types: double | uint8

    Output Arguments

    collapse all

    CCSDS SCPPM encoded message, returned as a column vector. The data type of the encoded message depends on the input message data type.

    • If msg is of data type double, sym is of data type double.

    • If msg is of data type logical or int8, sym is of data type uint8.

    The length of this column vector is fixed to 15120 / m.

    Data Types: double | uint8

    Outer convolutional encoder information, returned as a structure with these fields.

    Structure FieldDescription
    OuterEncoderCodeRate

    Outer convolutional encoder code rate, returned as a string scalar.

    OuterEncoderPuncturePattern

    Outer convolutional encoder puncture pattern, returned as a logical vector of these six elements in order: [P0 P1 P2 P3 P4 P5], as described in CCSDS 142.0-B-1 section 3.8.2.3.1 [1].

    Data Types: struct

    References

    [1] The Consultative Committee for Space Data Systems. Optical Communications Coding and Synchronization, Recommended Standard, Issue 1. CCSDS 142.0-B-1. Washington, D.C.: CCSDS, August 2019. https://public.ccsds.org/Pubs/142x0b1.pdf.

    Extended Capabilities

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

    Version History

    Introduced in R2022b