This is machine translation

Translated by Microsoft
Mouse over text to see original. Click the button below to return to the English verison of the page.

comm.DifferentialDecoder System object

Package: comm

Decode binary signal using differential decoding


The DifferentialDecoder object decodes the binary input signal. The output is the logical difference between the consecutive input element within a channel.

To decode a binary signal using differential decoding:

  1. Define and set up your differential decoder object. See Construction.

  2. Call step to decode a binary signal according to the properties of comm.DifferentialDecoder. The behavior of step is specific to each object in the toolbox.

    Note:   Starting in R2016b, instead of using the step method to perform the operation defined by the System object™, you can call the object with arguments, as if it were a function. For example, y = step(obj,x) and y = obj(x) perform equivalent operations.


H = comm.DifferentialDecoder creates a differential decoder System object, H. This object decodes a binary input signal that was previously encoded using a differential encoder.

H = comm.DifferentialDecoder(Name,Value) creates object, H, with each specified property set to the specified value. You can specify additional name-value pair arguments in any order as (Name1,Value1,...,NameN,ValueN).



Initial value used to generate initial output

Specify the initial condition as a real scalar. This property can have a logical, numeric, or fixed-point ( object) data type. The default is 0. The object treats nonbinary values as binary signals.


cloneCreate differential decoder object with same property values
getNumInputsNumber of expected inputs to step method
getNumOutputsNumber of outputs from step method
isLockedLocked status for input attributes and nontunable properties
releaseAllow property value and input characteristics changes
resetReset states of differential decoder object
stepDecode binary signal using differential decoding


expand all

Create a differential encoder and decoder pair.

diffEnc = comm.DifferentialEncoder;
diffDec = comm.DifferentialDecoder;

Generate random binary data. Differentially encode and decode the data.

data = randi([0 1],100,1);
encData = diffEnc(data);
decData = diffDec(encData);

Determine the number of errors between the original data and the decoded data.

numErrors = biterr(data,decData)
numErrors =



This object implements the algorithm, inputs, and outputs described on the Differential Decoder block reference page. The object properties correspond to the block parameters, except:

The object only supports single channel, column vector inputs.

Introduced in R2012a

Was this topic helpful?