classdef HDLRSDecoder< matlab.System
% HDLRSDecoder Decode data using a Reed-Solomon decoder
%   DEC = comm.HDLRSDecoder returns a block decoder System object, DEC,
%   that performs Reed-Solomon (RS) decoding.
%
%   DEC = comm.HDLRSDecoder(Name,Value) creates an RS decoder object,
%   DEC, with the specified property Name set to the specified
%   Value. You can specify additional name-value pair arguments in
%   any order as (Name1,Value1,...,NameN,ValueN).
%
%   DEC = comm.HDLRSDecoder(N,K,Name,Value) creates an RS decoder
%   object, DEC, with the CodewordLength property set to N, the
%   MessageLength property set to K, and other specified property
%   Names set to the specified Values.
%
%   Step method syntax:
%
%   [Y,startOut,endOut,validOut,errOut] = step(DEC,X,STARTIN,ENDIN,VALIDIN)
%   decodes the input data, X, and returns the encoded data, Y.
%
%   System objects may be called directly like a function instead of using
%   the step method. For example, y = step(obj, x) and y = obj(x) are
%   equivalent.
%
%   HDLRSDecoder methods:
%
%   step     - Perform RS decoding (see above)
%   release  - Allow property value and input characteristics changes
%   clone    - Create RS decoder object with same property values
%   isLocked - Locked status (logical)
%
%   HDLRSDecoder properties:
%
%   CodewordLength            - Codeword length
%   MessageLength             - Message length
%   PrimitivePolynomialSource - Source of primitive polynomial
%   PrimitivePolynomial       - Primitive polynomial
%   BSource                   - Source of B value
%   B                         - B value for polynomial generation
%   NumErrorsOutputPort       - Enable number of corrected errors output
%
%   % Example:
%   %   RS-encoded and decode a DVD-II standard packet of random data
%
%   enc = comm.HDLRSEncoder(204,188,'BSource','Property','B',0);
%   dec = 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)] = ...
%           enc(dataIn(ii), ii==1, ii==188, ii<=188);
%     [decOut(ii), decStartOut(ii), decEndOut(ii), decValidOut(ii),...
%      decErrOut(ii)] = dec(encOut(ii), startOut(ii), endOut(ii), ...
%      validOut(ii));
%   end
%   % Check the result:
%   assert(all(dataIn(1:188) == decOut(decValidOut)'))
%
%   See also comm.HDLRSEncoder, comm.RSDecoder.

 
    %   Copyright 2012-2023 The MathWorks, Inc.

    methods
        function out=HDLRSDecoder
        end

        function out=GFInverse(~) %#ok<STOUT>
        end

        function out=GFMultiply(~) %#ok<STOUT>
        end

        function out=chien(~) %#ok<STOUT>
        end

        function out=getExecutionSemanticsImpl(~) %#ok<STOUT>
            % works in both classic and synchronous subsystems
        end

        function out=getHeaderImpl(~) %#ok<STOUT>
            %getHeaderImpl   Return header for object display
        end

        function out=getIconImpl(~) %#ok<STOUT>
        end

        function out=getInputNamesImpl(~) %#ok<STOUT>
        end

        function out=getNumInputsImpl(~) %#ok<STOUT>
        end

        function out=getNumOutputsImpl(~) %#ok<STOUT>
        end

        function out=getOutputNamesImpl(~) %#ok<STOUT>
        end

        function out=isInactivePropertyImpl(~) %#ok<STOUT>
        end

        function out=loadObjectImpl(~) %#ok<STOUT>
            % loadObjectImpl
        end

        function out=massey(~) %#ok<STOUT>
        end

        function out=outputImpl(~) %#ok<STOUT>
            % Default assignments
        end

        function out=resetImpl(~) %#ok<STOUT>
        end

        function out=resetStates(~) %#ok<STOUT>
        end

        function out=saveObjectImpl(~) %#ok<STOUT>
            % saveObjectImpl
        end

        function out=setupImpl(~) %#ok<STOUT>
            % Setup GF tables
        end

        function out=showSimulateUsingImpl(~) %#ok<STOUT>
            % do not show simulate using option on mask
        end

        function out=supportsMultipleInstanceImpl(~) %#ok<STOUT>
            % Support in For Each Subsystem
        end

        function out=updateImpl(~) %#ok<STOUT>
        end

        function out=validateInputsImpl(~) %#ok<STOUT>
        end

    end
    properties
        %B B value
        %   Specify the starting power for roots of the primitive polynomial.
        %   The default is 1. The primitive polynomial used is
        %   (X-alpha^B)*(X-alpha^(B+1))*...*(X-alpha^(B+N-K-1)), where B is an
        %   integer and alpha is a root of the primitive polynomial.
        B;

        %BSource Source of B, the starting power for roots of the primitive polynomial
        %   Specify the source of the B value as one of 'Auto' | 'Property'. The
        %   default is 'Auto'.
        BSource;

        %CodewordLength Codeword length
        %   Specify the codeword length of the RS code as a double precision,
        %   positive, integer scalar. If you set the PrimitivePolynomialSource
        %   property to 'Auto', CodewordLength must be in the range 3 <
        %   CodewordLength <= 2^16-1. If you set the PrimitivePolynomialSource
        %   property to 'Property', CodewordLength must be in the range 3 <=
        %   CodewordLength <= 2^M-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 (CodewordLength - MessageLength) must be an even
        %   integer.
        %
        %   For a full-length RS code the value of the CodewordLength property
        %   must be of the form 2^M-1. If CodewordLength is less than 2^M-1, the
        %   object assumes a shortened RS code.
        %
        %   The default is 7.
        CodewordLength;

        %MessageLength Message length
        %   Specify the message length as a double precision, positive integer
        %   scalar. The difference (CodewordLength - MessageLength) must be an
        %   even integer. The default is 3.
        MessageLength;

        %NumErrorsOutputPort Output number of corrected symbol errors
        %   When you set this property to true, the object 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.
        NumErrorsOutputPort;

        %PrimitivePolynomial Primitive polynomial
        %   Specify the primitive polynomial that defines the finite field GF(2^M)
        %   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. If CodewordLength is less than 2^M-1, the object uses
        %   a shortened RS code. The default is the result of
        %   int2bit(primpoly(3),4)', which is [1 0 1 1] or the polynomial
        %   x^3+x+1. This property applies when you set the
        %   PrimitivePolynomialSource property to 'Property'.
        PrimitivePolynomial;

        %PrimitivePolynomialSource Source of primitive polynomial
        %   Specify the source of the primitive polynomial as one of '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
        %   int2bit(primpoly(M),M+1)'. When you set this property to 'Property',
        %   you can specify a polynomial using the PrimitivePolynomial property.
        PrimitivePolynomialSource;

    end
end
