Main Content

comm.GeneralQAMTCMDemodulator

Demodulate and decode trellis-coded general quadrature amplitude modulated signal

Description

The comm.GeneralQAMTCMDemodulator System object™ object uses the Viterbi algorithm to decode a signal modulated by the trellis-coded modulation (TCM) technique with a general quadrature amplitude modulation (QAM) signal constellation.

To demodulate and decode the trellis-coded general quadrature amplitude modulated signal:

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

Creation

Description

gqamtcmDemod = comm.GeneralQAMTCMDemodulator creates a general QAM TCM demodulator System object, gqamtcmDemod. This object demodulates and decodes a trellis-coded general quadrature amplitude modulated signal.

gqamtcmDemod = comm.GeneralQAMTCMDemodulator(trellis) additionally sets the TrellisStructure property to trellis.

example

gqamtcmDemod = comm.GeneralQAMTCMDemodulator(___,Name=Value) creates a general QAM TCM demodulator System object using any of the previous syntaxes and sets properties using one or more name-value arguments. For example, comm.GeneralQAMTCMDemodulator(TerminationMethod="Continuous") sets the termination method of the encoded frame to "Continuous".

Properties

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 saves the internal state metric at the end of each frame. The next frame uses the same state metric. The object treats each traceback path independently. If the input signal contains only one symbol, use "Continuous" mode.

  • "Truncated" — The object treats each input vector independently. The traceback path starts at the state with the best metric and always ends in the all-zeros state.

  • "Terminated" — The object treats each input vector independently, and the traceback path always starts and ends in the all-zeros state.

Traceback depth for the Viterbi decoder, specified as a positive integer. The traceback depth influences the decoding accuracy and delay. The decoding delay is the number of zero symbols that precede the first decoded symbol in the output.

When you set the TerminationMethod property to "Continuous", the decoding delay consists of TracebackDepth zero symbols or (TracebackDepth×K) zero bits for a rate K/N convolutional code.

When you set the TerminationMethod property to "Truncated" or "Terminated", no output delay occurs and the traceback depth must be less than or equal to the number of symbols in each input vector.

Data Types: double

Demodulator 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 object resets the state metrics and traceback memory of the demodulator to zero.

Dependencies

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

Signal constellation, specified as a complex vector. This vector lists the points in the signal constellation used to map the result of the convolutional encoder. The constellation must be specified in set-partitioned order. The length of the constellation vector must equal the number of possible input symbols to the convolutional encoder of the general QAM TCM modulator object. This value corresponds to 2N for a rate K/N convolutional code. The default corresponds to a set-partitioned order for the points of an 8-PSK signal constellation.

Data Types: single | double
Complex Number Support: Yes

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

Usage

Description

Y = gqamtcmDemod(X) demodulates the general quadrature amplitude modulated data, X, and uses the Viterbi algorithm to decode the resulting demodulated bitstream encoded with a convolutional code.

example

Y = gqamtcmDemod(X,R) resets the decoder 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 data, specified as a column vector.

Data Types: double | logical
Complex Number Support: Yes

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

Dependencies

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

Data Types: double | logical

Output Arguments

expand all

Output data, specified as a column vector. When the convolutional encoder represents a rate K/N code, the length of the output vector is K×L, where L is the length of the input vector, X. 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:

release(obj)

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

Examples

collapse all

Modulate and demodulate noisy data using QAM TCM modulation with an arbitrary four point constellation. Estimate the resultant BER.

Define a trellis structure with two input symbols and four output symbols using a [171 133] generator polynomial. Define an arbitrary four-point constellation.

qamTrellis = poly2trellis(7,[171 133]);
refConst = exp(pi*1i*[1 2 3 6]/4);

Create a QAM TCM modulator and demodulator System object™ pair using qamTrellis and refConst.

qamtcmod = comm.GeneralQAMTCMModulator( ...
    qamTrellis, ...
    Constellation=refConst);
qamtcdemod = comm.GeneralQAMTCMDemodulator( ...
    qamTrellis, ...
    Constellation=refConst);

Create an error rate calculator with delay (in bits) equal to the product of TracebackDepth and the number of bits per symbol.

errorrate = comm.ErrorRate( ...
    ReceiveDelay=qamtcdemod.TracebackDepth * ...
    log2(qamTrellis.numInputSymbols));

Generate random binary data and apply QAM TCM modulation. Pass the signal through an AWGN channel and demodulate the signal. Collect the error statistics.

for counter = 1:10
    % Generate binary data
    data = randi([0 1],500,1);
    % Modulate
    modSignal = qamtcmod(data);
    % Pass through an AWGN channel
    noisySignal = awgn(modSignal,4);
    % Demodulate
    receivedData = qamtcdemod(noisySignal);
    % Calculate the error statistics
    errorStats = errorrate(data,receivedData);
end

Display the BER and the number of bit errors.

fprintf("Error rate = %5.2e\nNumber of errors = %d\n", ...
    errorStats(1), errorStats(2))
Error rate = 9.84e-03
Number of errors = 49

Extended Capabilities

Version History

Introduced in R2012a