Main Content


Encode binary data using convolutional encoder and map result to rectangular QAM constellation


The comm.RectangularQAMTCMModulator System object™ implements trellis-coded modulation (TCM) by encoding the binary input signal using a convolutional code and by mapping the result to a rectangular quadrature amplitude modulation (QAM) signal constellation. For more information about TCM, see the Algorithms section.

To encode binary data using a convolutional code and map the result to a rectangular QAM constellation:

  1. Create the comm.RectangularQAMTCMModulator 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?




qamtcmMod = comm.RectangularQAMTCMModulator creates a rectangular QAM TCM modulator System object, qamtcmMod. This object employs a convolutional encoder to encode a binary input signal and maps the result to a rectangular QAM constellation.

qamtcmMod = comm.RectangularQAMTCMModulator(trellis) additionally sets the TrellisStructure property to trellis.

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


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, 16, 32, or 64. The value of the ModulationOrder property must equal the number of possible output symbols from the convolutional encoder of the QAM 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 = qamtcmMod(X) applies rectangular QAM TCM to the input data, X, and returns the trellis-coded rectangular quadrature amplitude modulated data, Y.

Y = qamtcmMod(X,R) resets the encoder of the rectangular QAM 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×L (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 data using rectangular 16-QAM TCM modulation and display the scatter plot.

Generate random binary data. The length of the data vector must be an integer multiple of the number of input streams into the encoder, log2(8) = 3.

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

Create a rectangular 16-QAM TCM modulator System object™.

qamtcmMod = comm.RectangularQAMTCMModulator;

Modulate the data.

modData = qamtcmMod(data);

Plot the modulated data.



The trellis-coded rectangular QAM modulation uses a set partitioning technique to map the result of the convolutional encoder to a rectangular QAM 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.

These figures show the labeled set-partitioned signal constellation that the object uses when the M-ary number is 16, 32, or 64.

Signal Constellation for 16-QAM

Signal Constellation for 32-QAM

Signal Constellation for 64-QAM


[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