Documentation

comm.TurboDecoder System object

Decode input signal using parallel concatenated decoding scheme

Description

TheTurbo DecoderSystem object™ decodes the input signal using a parallel concatenated decoding scheme that employs thea-posteriori概率(APP)译码器组成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. SeeConstruction.

  2. Callstepto decode a binary signal according to the properties ofcomm.TurboDecoder. The behavior ofstepis specific to each object in the toolbox.

Note

Starting in R2016b, instead of using thestep方法进行加工ation defined by the System object, you can call the object with arguments, as if it were a function. For example,y = step(obj,x)andy = obj(x)perform equivalent operations.

Construction

H= comm.TurboDecodercreates a System object,H. This object uses thea-posterioriprobability (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.Namemust appear inside single quotes (''). You can specify several name-value pair arguments in any order asName1,Value1,…,NameN,ValueN.

H= comm.TurboDecoder(TRELLIS, INTERLVRINDICES, NUMITER)creates a turbo decoder object,H, with theTrellisStructureproperty set toTRELLIS,InterleaverIndicesproperty set toINTERLVRINDICES, and theNumIterationsproperty set toNUMITER.

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 theistrellisfunction to check if a structure is a valid trellis structure. The default is the result ofpoly2trellis(4, [13 15], 13).

InterleaverIndicesSource

Source of interleaver indices

Specify the source of the interleaver indices as one ofProperty|Input port. When you set this property toInput port,对象使用衬垫specifie指数d as an input to the step method. When you set this property toProperty,object uses the interleaver indices that you specify in theInterleaverIndicesproperty. When you set this property toInput port,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 andL, with no repeated values.

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

Algorithm

Decoding algorithm

Specify the decoding algorithm that the object uses for decoding as one ofTrue APP|Max*|Max. When you set this property toTrue APP,object implements truea-posterioriprobability 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 2NumScalingBitsand divide the pre-output by the same factor. TheNumScalingBitsproperty must be a scalar integer between0and8. This property applies when you set theAlgorithmproperty toMax*.

Default:3

NumIterations

Number of decoding iterations

Specify the number of decoding iterations used for each call to thestepmethod. 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

step Decode input signal using parallel concatenated decoding scheme
Common to All System Objects
release

Allow System object property value changes

Examples

expand all

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; rngdefault

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 bypoly2trellis(4,[13 15 17],13)andintrlvrIndices.

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 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

forfrmIdx = 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

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 associatedstepfunctions.

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; rngdefault

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 thestepfunction.

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

Create a 16-QAM 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

forfrmIdx = 1:100% Randomly select one of three possible frame sizesfrmLen = 500*randi([1 3],1,1);% Determine the interleaver indices given the frame lengthintrlvrIndices = randperm(frmLen);% Generate random binary datadata = randi([0 1],frmLen,1);% Turbo encode the dataencodedData = step(hTEnc,data,intrlvrIndices);% Modulate the encoded datamodSignal = step(hMod,encodedData);% Pass the signal through the AWGN channelreceivedSignal = step(hChan,modSignal);% Demodulate the received signaldemodSignal = 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 statisticserrorStats = 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 theTurbo Decoderblock reference page. The object properties correspond to the block parameters.

Extended Capabilities

Introduced in R2012a

Was this topic helpful?