comm.TurboDecoder System object

Package: comm

Decode input signal using parallel concatenated decoding scheme

Description

The Turbo Decoder System object™ decodes the input signal using a parallel concatenated decoding scheme that employs the a-posteriori probability (APP) decoder as the constituent decoder. Both constituent decoders use the same trellis structure and algorithm.

To decode an input signal using a turbo decoding scheme:

  1. Define and set up your turbo decoder object. See Construction.

  2. Call step to decode a binary signal according to the properties of comm.TurboDecoder. The behavior of step is specific to each object in the toolbox.

Construction

H = comm.TurboDecoder creates a System object, H. This object uses the a-posteriori probability (APP) constituent decoder to iteratively decode the parallel-concatenated convolutionally encoded input data.

H = comm.TurboDecoder(Name, Value) creates a turbo decoder object, H, with the specified property name set to the specified value. Name must appear inside single quotes (''). You can specify several name-value pair arguments in any order as Name1,Value1,…,NameN,ValueN.

H = comm.TurboDecoder(TRELLIS, INTERLVRINDICES, NUMITER) creates a turbo decoder object, H, with the TrellisStructure property set to TRELLIS, the InterleaverIndices property set to INTERLVRINDICES, and the NumIterations property set to NUMITER.

Properties

TrellisStructure

Trellis structure of constituent convolutional code

Specify the trellis as a MATLAB structure that contains the trellis description of the constituent convolutional code. Use the istrellis function to check if a structure is a valid trellis structure. The default is the result of poly2trellis(4, [13 15], 13).

InterleaverIndicesSource

Source of interleaver indices

Specify the source of the interleaver indices as one of Property | Input port. When you set this property to Input port, the object uses the interleaver indices specified as an input to the step method. When you set this property to Property, the object uses the interleaver indices that you specify in the InterleaverIndices property. When you set this property to Input port, the object processes variable-size signals.

Default: Property

InterleaverIndices

Interleaver indices

Specify the mapping used to permute the input bits at the encoder as a column vector of integers. This mapping is a vector with the number of elements equal to length, L, of the output of the step method. Each element must be an integer between 1 and L, with no repeated values.

Default: (64:-1:1).'.

Algorithm

Decoding algorithm

Specify the decoding algorithm that the object uses for decoding as one of True APP | Max* | Max. When you set this property to True APP, the object implements true a-posteriori probability decoding. When you set this property to any other value, the object uses approximations to increase the speed of the computations.

Default: True APP

NumScalingBits

Number of scaling bits

Specify the number of bits the constituent decoders use to scale the input data to avoid losing precision during the computations. The constituent decoders multiply the input by 2 NumScalingBits and divide the pre-output by the same factor. The NumScalingBits property must be a scalar integer between 0 and 8. This property applies when you set the Algorithm property to Max*.

Default: 3

NumIterations

Number of decoding iterations

Specify the number of decoding iterations used for each call to the step method. The object iterates and provide updates to the log-likelihood ratios (LLR) of the uncoded output bits. The output of the step method is the hard-decision output of the final LLR update.

Default: 6

Methods

cloneCreate Turbo Decoder object with same property values
isLockedLocked status (logical)
releaseAllow property value and input characteristics changes
stepDecode input signal using parallel concatenated decoding scheme

Examples

expand all

Transmit and Receive Turbo-Encoded Data over a BPSK-Modulated AWGN Channel

Simulate the transmission and reception of BPSK data over an AWGN channel using turbo encoding and decoding.

Set the Eb/No (dB) and frame length parameters. Set the random number generator to its default state to ensure that the results are repeatable.

EbNo= -6;
frmLen = 256;
rng default

Calculate the noise variance from the Eb/No ratio. Generate random interleaver indices.

noiseVar = 10^(-EbNo/10);
intrlvrIndices = randperm(frmLen);

Create a turbo encoder and decoder pair using the trellis structure given by poly2trellis(4,[13 15 17],13) and intrlvrIndices.

hTEnc = comm.TurboEncoder('TrellisStructure',poly2trellis(4, ...
    [13 15 17],13),'InterleaverIndices',intrlvrIndices);

hTDec = comm.TurboDecoder('TrellisStructure',poly2trellis(4, ...
    [13 15 17],13),'InterleaverIndices',intrlvrIndices, ...
    'NumIterations',4);

Create a BPSK modulator and demodulator pair, where the demodulator outputs soft bits determined by using a log-likelihood ratio method.

hMod = comm.BPSKModulator;
hDemod = comm.BPSKDemodulator('DecisionMethod','Log-likelihood ratio', ...
    'Variance',noiseVar);

Create an AWGN channel object and an error rate object.

hChan = comm.AWGNChannel('EbNo',EbNo);
hError = comm.ErrorRate;

The main processing loop performs the following steps:

  • Generate binary data

  • Turbo encode the data

  • Modulate the encoded data

  • Pass the modulated signal through an AWGN channel

  • Demodulate the noisy signal using LLR to output soft bits

  • Turbo decode the demodulated data. Because the the bit mapping from the demodulator is opposite that expected by the turbo decoder, the decoder input must use the inverse of demodulated signal.

  • Calculate the error statistics

for frmIdx = 1:100
    data = randi([0 1],frmLen,1);
    encodedData = step(hTEnc,data);
    modSignal = step(hMod,encodedData);
    receivedSignal = step(hChan,modSignal);
    demodSignal = step(hDemod,receivedSignal);
    receivedBits = step(hTDec,-demodSignal);
    errorStats = step(hError,data,receivedBits);
end

Display the error data.

fprintf('Bit error rate = %5.2e\nNumber of errors = %d\nTotal bits = %d\n', ...
    errorStats)
Bit error rate = 2.34e-04
Number of errors = 6
Total bits = 25600

Turbo Coding with 16-QAM Modulation in an AWGN Channel

Simulate an end-to-end communication link employing 16-QAM using turbo codes in an AWGN channel. The frame sizes are randomly selected from a set of {500, 1000, 1500}. Because the frame size varies, provide the interleaver indices to the turbo encoder and decoder objects as an input to their associated step functions.

Set the modulation order and Eb/No (dB) parameters. Set the random number generator to its default state to be able to repeat the results.

M = 16;
EbNo= -2;
rng default

Calculate the noise variance from the Eb/No ratio and the modulation order.

noiseVar = 10^(-EbNo/10)*(1/log2(M));

Create a turbo encoder and decoder pair, where the interleaver indices are supplied by an input argument to the step function.

hTEnc = comm.TurboEncoder('InterleaverIndicesSource','Input port');

hTDec = comm.TurboDecoder('InterleaverIndicesSource','Input port', ...
    'NumIterations',4);

Create a QPSK modulator and demodulator pair, where the demodulator outputs soft bits determined by using a log-likelihood ratio method. The modulator and demodulator objects are normalized to use an average power of 1 W.

hMod = comm.RectangularQAMModulator('ModulationOrder',M, ...
    'BitInput',true, ...
    'NormalizationMethod','Average power');
hDemod = comm.RectangularQAMDemodulator('ModulationOrder',M, ...
    'BitOutput',true, ...
    'NormalizationMethod','Average power', ...
    'DecisionMethod','Log-likelihood ratio', ...
    'Variance',noiseVar);

Create an AWGN channel object and an error rate object.

hChan = comm.AWGNChannel('EbNo',EbNo,'BitsPerSymbol',log2(M));
hError = comm.ErrorRate;

The processing loop performs the following steps:

  • Select a random frame size and generate interleaver indices

  • Generate random binary data

  • Turbo encode the data

  • Apply 16-QAM modulation

  • Pass the modulated signal through an AWGN channel

  • Demodulate the noisy signal using an LLR algorithm

  • Turbo decode the data

  • Calculate the error statistics

for frmIdx = 1:100

    % Randomly select one of three possible frame sizes
    frmLen = 500*randi([1 3],1,1);

    % Determine the interleaver indices given the frame length
    intrlvrIndices = randperm(frmLen);

    % Generate random binary data
    data = randi([0 1],frmLen,1);

    % Turbo encode the data
    encodedData = step(hTEnc,data,intrlvrIndices);

    % Modulate the encoded data
    modSignal = step(hMod,encodedData);

    % Pass the signal through the AWGN channel
    receivedSignal = step(hChan,modSignal);

    % Demodulate the received signal
    demodSignal = step(hDemod,receivedSignal);

    % Turbo decode the demodulated signal. Because the bit mapping from the
    % demodulator is opposite that expected by the turbo decoder, the
    % decoder input must use the inverse of demodulated signal.
    receivedBits = step(hTDec,-demodSignal,intrlvrIndices);

    % Calculate the error statistics
    errorStats = step(hError,data,receivedBits);
end

Display the error statistics.

fprintf('Bit error rate = %5.2e\nNumber of errors = %d\nTotal bits = %d\n', ...
    errorStats)
Bit error rate = 3.51e-04
Number of errors = 33
Total bits = 94000

Algorithms

This object implements the algorithm, inputs, and outputs described on the Turbo Decoder block reference page. The object properties correspond to the block parameters.

Was this topic helpful?