comm.DifferentialEncoder System object

Package: comm

Encode binary signal using differential coding

Description

The DifferentialEncoder object encodes the binary input signal within a channel. The output is the logical difference between the current input element and the previous output element.

To encode a binary signal using differential coding:

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

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

Construction

H = comm.DifferentialEncoder creates a differential encoder System object™, H. This object encodes a binary input signal by calculating its logical difference with the previously encoded data.

H = comm.DifferentialEncoder(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).

Properties

InitialCondition

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 (embedded.fi object) data type. The default is 0. The object treats nonbinary values as binary signals.

Methods

cloneCreate differential encoder 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 encoder object
stepEncode binary signal using differential coding

Examples

Encode binary signal using differential coding.

% Create Differential Encoder System object
    hdiffenc = comm.DifferentialEncoder;
% Generate random binary data
    data = randi([0 1], 11, 1);
% Encode data
    encdata = step(hdiffenc,data);

Algorithms

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

The object only supports single channel, column vector inputs.
Was this topic helpful?