Main Content

comm.PSKTCMDemodulator

Demodulate and decode trellis-coded M-PSK modulated signal

Description

The comm.PSKTCMDemodulator System object™ uses the Viterbi algorithm to decode a signal modulated by the trellis-coded modulation (TCM) technique with an M-ary phase shift keying (PSK) signal constellation.

To demodulate and decode the trellis-coded M-PSK modulated signal:

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

psktcmDemod = comm.PSKTCMDemodulator creates a PSK TCM demodulator System object. This object demodulates and decodes a trellis-coded M-PSK modulated signal.

psktcmDemod = comm.PSKTCMDemodulator(trellis) additionally sets the TrellisStructure property to trellis.

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

example

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: single | 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".

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 decoder of the PSK TCM demodulator object. Therefore, the value for the ModulationOrder property must equal 2N for a rate K/N convolutional code.

Data Types: double

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

Usage

Description

Y = psktcmDemod(X) demodulates the M-PSK modulated data, X, and uses the Viterbi algorithm to decode the resulting demodulated bitstream encoded with a convolutional code.

example

Y = psktcmDemod(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 data using 8-PSK TCM modulation in an AWGN channel. Estimate the resulting error rate.

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

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

Create 8-PSK TCM modulator and demodulator System objects using trellis, t.

M = 8;
psktcmod = comm.PSKTCMModulator(trellis,ModulationOrder=M);
psktcdemod = comm.PSKTCMDemodulator(trellis, ...
    ModulationOrder=M, ...
    TracebackDepth=16);

Create an error rate calculator with delay in bits equal to TracebackDepth times the number of bits per symbol.

errRate = comm.ErrorRate( ...
    ReceiveDelay=psktcdemod.TracebackDepth*log2(trellis.numInputSymbols));

Generate random binary data and modulate it with 8-PSK TCM. Pass the modulated signal through the AWGN channel and demodulate the signal. Calculate the error statistics.

for counter = 1:10
    % Transmit frames of 250 2-bit symbols
    data = randi([0 1],500,1);
    % Modulate
    modSignal = psktcmod(data);
    % Pass through AWGN channel
    noisySignal = awgn(modSignal,7);
    % Demodulate
    receivedData = psktcdemod(noisySignal);
    % Calculate error statistics
    errorStats = errRate(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 = 2.44e-02
Number of errors = 121

Extended Capabilities

Version History

Introduced in R2012a