Documentation Center

  • Trial Software
  • Product Updates

comm.HDLRSDecoder System object

Package: comm

Decode data using a Reed-Solomon decoder

Description

The HDL-optimized HDLRSDecoder System object™ recovers a message vector from a Reed-Solomon codeword vector. For proper decoding, the property values for this object should match those in the corresponding HDLRSEncoder System object.

To recover a message vector from a Reed-Solomon codeword vector optimized for HDL code generation:

  1. Define and set up your HDL RS decoder object. See Construction.

  2. Call step to recover a message vector from a Reed-Solomon codeword vector according to the properties of comm.HDLRSDecoder. The behavior of step is specific to each object in the toolbox.

Construction

H = comm.HDLRSDecoder creates an HDL-optimized RS decoder System object, H, that performs Reed-Solomon (RS) decoding.

H = comm.HDLRSDecoder(Name,Value) creates an HDL-optimized RS decoder System object, H, with additional options specified by one or more Name,Value pair arguments, where Name is a property name and Value is the corresponding value. Name must appear inside single quotes (''). You can specify several name-value pair arguments in any order as Name1,Value1,...,NameN,ValueN.

H = comm.HDLRSDecoder(N,K,Name,Value) creates an HDL-optimized RS decoder System object, H, with the CodewordLength property set to N, the MessageLength property set to K, and other specified property Names set to the specified Values.

Properties

B

B value for polynomial generation

BSource

Source of B, the starting power for roots of the primitive polynomial

Specify the source of the B value as one of these values:

  • Auto: B=0

  • Property

Default: Auto

CodewordLength

Codeword length

Specify the codeword length of the RS code as a double-precision, positive, integer scalar value. The default is 7.

If you set the PrimitivePolynomialSource property to Auto, CodewordLength must be in the range 3 < CodewordLength 216–1.

When you set the PrimitivePolynomialSource property to Property, CodewordLength must be in the range 3 CodewordLength 2M–1. M is the degree of the primitive polynomial that you specify with the PrimitivePolynomialSource and PrimitivePolynomial properties. M must be in the range 3 M 16. The difference (CodewordLengthMessageLength) must be an even integer. The value of this property is rounded up to 2M–1.

If the value of this property is less than 2M–1, the object assumes a shortened RS code.

MessageLength

Message length

Specify the message length as a double-precision, positive integer scalar value. The default is 3. The difference (CodewordLengthMessageLength) must be an even integer.

NumErrorsOutputPort

Enable number of errors output

When you set this property to true, the step method outputs number of corrected errors. The number of corrected errors is not valid when errOut is asserted, since there were more errors than could be corrected. The default is false.

PrimitivePolynomialSource

Source of primitive polynomial

Specify the source of the primitive polynomial as Auto | Property. The default is Auto.

When you set this property to Auto, the object uses a primitive polynomial of degree M = ceil(log2(CodewordLength+1)), which is the result of fliplr(de2bi(primpoly(M))).

When you set this property to Property, you can specify a polynomial using the PrimitivePolynomial property.

PrimitivePolynomial

Primitive polynomial

Specify the primitive polynomial that defines the finite field GF(2M) corresponding to the integers that form messages and codewords. You must set this property to a double-precision, binary row vector that represents a primitive polynomial over GF(2) of degree M in descending order of powers.

This property applies when you set the PrimitivePolynomialSource property to Property.

Methods

clone Create HDLRSDecoder System object with same property values
isLockedLocked status for input attributes and nontunable properties
releaseAllow property value and input characteristics change
stepPerform Reed-Solomon decoding

Examples

RS-encode and decode a DVD-II standard packet of random data.

  1. Assign data and create System objects.

    hHDLEnc = comm.HDLRSEncoder(204,188,'BSource','Property','B',0);
    hHDLDec = comm.HDLRSDecoder(204,188,'BSource','Property','B',0);
    dataIn = [randi([0,255],188,1,'uint8') ; zeros(1024-188,1)];
    for ii = 1:1024
      [encOut(ii), startOut(ii), endOut(ii), validOut(ii)] = step(hHDLEnc, dataIn(ii), ii==1, ii==188, ii<=188);
      [decOut(ii), decStartOut(ii), decEndOut(ii), decValidOut(ii), decErrOut(ii)] = step(hHDLDec, encOut(ii), startOut(ii), endOut(ii), validOut(i  i));
    end
  2. Check results.

    assert(all(dataIn(1:188) == decOut(decValidOut)'))

See Also

|

Was this topic helpful?