Main Content


Encode binary data using convolutional encoder and map result to M-PSK constellation


The comm.PSKTCMModulator System object™ implements trellis-coded modulation (TCM) by encoding the binary input signal using a convolutional code and by mapping the result to an M-ary phase shift keying (PSK) signal constellation. For more information about TCM, see the Algorithms section.

To encode binary data using a convolutional code and map the result to an M-PSK constellation:

  1. Create the comm.PSKTCMModulator object and set its properties.

  2. Call the object with arguments, as if it were a function.

To learn more about how System objects work, see What Are System Objects?



psktcmMod = comm.PSKTCMModulator creates a PSK TCM modulator System object, psktcmMod. This object employs a convolutional encoder to encode a binary input signal and maps the result to an M-PSK constellation.

psktcmMod = comm.PSKTCMModulator(trellis) additionally sets the TrellisStructure property to trellis.


psktcmMod = comm.PSKTCMModulator(___,Name=Value) creates a PSK TCM modulator System object using any of the previous syntaxes and sets properties using one or more name-value arguments. For example, comm.PSKTCMDemodulator(ModulationOrder=4) sets the number of points in the signal constellation to 4.


expand all

Unless otherwise indicated, properties are nontunable, which means you cannot change their values after calling the object. Objects lock when you call them, and the release function unlocks them.

If a property is tunable, you can change its value at any time.

For more information on changing property values, see System Design in MATLAB Using System Objects.

Trellis structure of the convolutional code, specified as a MATLAB® structure that contains the trellis description of the convolutional code. Use the istrellis function to check whether a trellis structure is valid.

The trellis structure contains these fields.

Number of symbols input to the encoder, specified as an integer equal to 2K, where K is the number of input bit streams.

Number of symbols output from the encoder, specified as an integer equal to 2N, where N is the number of output bit streams.

Number of states in the encoder, specified as a power of 2.

Next states for all combinations of current states and current inputs, specified as a matrix of integers. The matrix size must be numStates by 2K.

Outputs for all combinations of current states and current inputs, specified as a matrix of octal numbers. The matrix size must be numStates by 2K.

Data Types: struct

Termination method of the encoded frame, specified as one of these options.

  • "Continuous" — The object retains the encoder states at the end of each input vector for use with the next input vector.

  • "Truncated" — The object treats each input vector independently. The encoder is reset to the all-zeros state at the start of each input vector.

  • "Terminated" — The object treats each input vector independently. However, for each input vector, the object uses extra bits to set the encoder to the all-zeros state at the end of the vector. For a rate K/N code, the convolutional encoder outputs the vector with a length given by N×(L+S)K, where S = constraintLength–1 (or, in the case of multiple constraint lengths, S = sum(constraintLength(i)–1)). L indicates the length of the input.

Modulator reset input, specified as a logical 0 (false) or 1 (true). Set this property to true to call the object with an additional input. For nonzero reset input values, the internal states of the encoder reset to initial conditions.


To enable this property, set the TerminationMethod property to "Continuous".

Number of points in the signal constellation, specified as 4, 8, or 16. The value of the ModulationOrder property must equal the number of possible output symbols from the convolutional encoder of the PSK TCM modulator. Therefore, the value for the ModulationOrder property must equal 2N for a rate K/N convolutional code.

Data Types: single | double

Data type of the output, specified as "double" or "single".




Y = psktcmMod(X) applies PSK TCM to the input data, X, and returns the trellis-coded M-PSK modulated data, Y.

Y = psktcmMod(X,R) resets the encoder of the PSK TCM modulator object to the all-zeros state when you input a reset signal, R, that is nonzero. This syntax applies when you set the value of the ResetInputPort property to true.

Input Arguments

expand all

Input binary data, specified as a column vector. X must be of data type numeric, logical, or unsigned fixed point of word length 1 (fi object). For a rate K/N code, the length of the input vector, X, must be K×Q (which equals L), for some positive integer Q.

Data Types: single | double | int8 | int16 | int32 | int64 | uint8 | uint16 | uint32 | uint64 | logical | fi

Reset signal, specified as a logical 0 (false), 1 (true), or numeric scalar.


To use this argument, set the ResetInputPort property to true.

Data Types: double | logical

Output Arguments

expand all

Output data, returned as a column vector. The length of Y is Q. The data type of the output data depends on the OutputDataType property.

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:


expand all

stepRun System object algorithm
releaseRelease resources and allow changes to System object property values and input characteristics
resetReset internal states of System object


collapse all

Modulate random data using 8-PSK TCM modulation and display the constellation diagram.

Create binary data.

data = randi([0 1],1000,1);

Define a trellis structure with four input symbols and eight output symbols.

trellis =  poly2trellis([5 4],[23 35 0; 0 5 13]);

Create an 8-PSK TCM modulator object using the trellis structure variable, t.

psktcmMod = comm.PSKTCMModulator(trellis,ModulationOrder=8);

Modulate and plot the data.

modData = psktcmMod(data);

Figure Scatter Plot contains an axes object. The axes object with title Scatter plot, xlabel In-Phase, ylabel Quadrature contains a line object which displays its values using only markers. This object represents Channel 1.


The trellis-coded M-PSK modulation uses a set partitioning technique to map the result of the convolutional encoder to a PSK signal constellation. The trellis-coded modulation technique partitions the constellation into subsets called cosets to maximize the minimum distance between pairs of points in each coset.

This figure shows the labeled set-partitioned signal constellation that the object uses when the M-ary number is 8.

Set-partitioned signal in 8-PSK constellation


[1] Biglieri, E., D. Divsalar, P.J. McLane, and M.K. Simon, Introduction to Trellis-Coded Modulation with Applications, New York, Macmillan, 1991.

[2] Proakis, John G. Digital Communications. 4th ed. New York: McGraw Hill, 2001.

[3] Ungerboeck, G. “Channel Coding with Multilevel/Phase Signals,” IEEE Transactions on Information Theory, Vol. IT28, Jan. 1982, pp. 55–67.

Extended Capabilities

Version History

Introduced in R2012a