comm.DifferentialEncoder
Encode binary signal using differential coding
Description
The comm.DifferentialEncoder
System 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. For more
information, see Algorithms.
To encode a binary signal using differential coding:
Create the
comm.DifferentialEncoder
object and set its properties.Call the object with arguments, as if it were a function.
To learn more about how System objects work, see What Are System Objects?
Creation
Syntax
Description
creates a
default differential encoder System object. This object encodes a binary input signal by calculating its logical
difference with the previously encoded output signal.diffenc
= comm.DifferentialEncoder
sets properties using one or more name-value arguments. For example,
diffenc
= comm.DifferentialEncoder(Name=Value
)comm.DifferentialEncoder(InitialCondition=5)
sets the initial
condition of the differential encoder to 5
.
creates a differential encoder object with InitialCondition set to
diffenc
= comm.DifferentialEncoder(initcond
)initcond
. For example, when initcond
is set to
1
, this syntax creates the differential encoder object and sets the
initial value used to generate initial output to 1.
Properties
Usage
Syntax
Description
encodes
the input message using the differential encoding scheme and returns the binary encoded
message, Y
= diffenc(X
)Y
. For more information, see Algorithms.
Input Arguments
Output Arguments
Object Functions
To use an object function, specify the
System object as the first input argument. For
example, to release system resources of a System object named obj
, use
this syntax:
release(obj)
Examples
Algorithms
The comm.DifferentialEncoder
output is the logical difference between the current
input element and the previous output element. More specifically, the input and output are
related by:
d(i1) = m(i1) XOR lastOutput (==InitialCondition property value for first input element)
d(ik) = m(ik) XOR d(ik-1), for k = 2:inputLen
lastOutput = d(ik)
where:
m is the input message.
d is the differentially encoded output.
ik is the kth element.
inputLen is the length of m.
lastOutput is the last element of d.
XOR is the logical exclusive-or operator.
Extended Capabilities
Version History
Introduced in R2012a