Decode convolutionally encoded data using Viterbi algorithm with GPU
The GPU ViterbiDecoder
System object™ decodes
input symbols to produce binary output symbols using a graphics processing
unit (GPU). This object processes variable-size signals; however,
variable-size signals cannot be applied for erasure inputs.
Note
To use this object, you must install a Parallel Computing Toolbox™ license and have access to an appropriate GPU. For more about GPUs, see GPU Computing (Parallel Computing Toolbox).
A GPU-based System object accepts typical MATLAB® arrays or objects created using the gpuArray
class. A GPU-based
System object supports input signals with double- or single-precision data types. The output
signal inherits its data type from the input signal.
If the input signal is a MATLAB array, the System object handles data transfer between the CPU and the GPU. The output signal is a MATLAB array.
If the input signal is a gpuArray
, the data remains on the GPU.
The output signal is a gpuArray
. When the object is given a
gpuArray
, calculations take place entirely on the GPU, and no
data transfer occurs. Passing gpuArray
arguments provides
increased performance by reducing simulation time. For more information, see Establish Arrays on a GPU (Parallel Computing Toolbox).
To decode input symbols and produce binary output symbols:
Define and set up your Viterbi decoder object. See Construction.
Call step
to decode input symbols
according to the properties of comm.gpu.ViterbiDecoder
.
The behavior of step
is specific to each object in
the toolbox.
Note
Starting in R2016b, instead of using the step
method
to perform the operation defined by the System object, you can
call the object with arguments, as if it were a function. For example, y
= step(obj,x)
and y = obj(x)
perform
equivalent operations.
H = comm.gpu.ViterbiDecoder
creates a Viterbi
decoder System object, H
. This object uses
the Viterbi algorithm to decode convolutionally encoded input data.
H = comm.gpu.ViterbiDecoder(
creates
a Viterbi decoder object, Name
,Value
)H
, with the specified
property Name set to the specified Value. You can specify additional
name-value pair arguments in any order as (Name1
,Value1
,...,NameN
,ValueN
.
H = comm.gpu.ViterbiDecoder(TRELLIS,Name,Value)
creates
a Viterbi decoder object, H
, with the TrellisStructure
property
set to TRELLIS, and other specified property Names set to the specified
Values.
|
Trellis structure of convolutional code Specify the trellis as a MATLAB structure that contains the
trellis description of the convolutional code. Use the |
|
Input format Specify the format of the input to the decoder as one of When you set this property to |
|
Soft input word length Specify the number of bits used to represent each quantized soft input value as a positive,
integer scalar. This property applies when you set the InputFormat property to
|
|
Action when input values are out of range The only valid setting is |
|
Traceback depth Specify the number of trellis branches used to construct each traceback path as a positive,
integer scalar less than or equal to 256. The traceback depth influences the decoding
accuracy and delay. The number of zero symbols that precede the first decoded symbol in
the output represent a decoding delay. When you set the TerminationMethod
property to |
|
Termination method of encoded frame Specify |
|
Enable decoder reset input Set this property to true to enable an additional step method input. When the reset input is a
non-zero value, the object resets the internal states of the decoder to initial
conditions. This property applies when you set the TerminationMethod
property to |
|
Delay output reset Delaying the output reset is not supported. The only valid setting is false. |
|
Source of puncture pattern Specify the source of the puncture pattern as one of |
|
Puncture pattern vector Specify puncture pattern used to puncture the encoded data. The default is |
|
Enable erasures input Erasures are not supported. The only valid setting is false. |
|
Data type of output The only valid setting is |
|
Number of independent frames present in the input and output data vectors. Specify the number of independent frames contained in a single data input/output vector. The
input vector will be segmented into |
info | Display information about GPU-based Viterbi Decoder object |
reset | Reset states of the GPU-based Viterbi Decoder modulator object |
step | Decode convolutionally encoded data using Viterbi algorithm |
Common to All System Objects | |
---|---|
release | Allow System object property value changes |
Transmit a convolutionally encoded 8-DPSK-modulated bit stream through an AWGN channel. Then, demodulate, decode using a Viterbi decoder, and count errors.
hConEnc = comm.ConvolutionalEncoder; hMod = comm.DPSKModulator('BitInput',true); hChan = comm.gpu.AWGNChannel('NoiseMethod', ... 'Signal to noise ratio (SNR)', 'SNR',10); hDemod = comm.DPSKDemodulator('BitOutput',true); hDec = comm.gpu.ViterbiDecoder('InputFormat','Hard'); % Delay in bits is TracebackDepth times the number of % bits per symbol delay = hDec.TracebackDepth* ... log2(hDec.TrellisStructure.numInputSymbols); hError = comm.ErrorRate( ... 'ComputationDelay',3,'ReceiveDelay',delay); for counter = 1:20 data = randi([0 1],30,1); encodedData = step(hConEnc, data); modSignal = step(hMod, encodedData); receivedSignal = step(hChan, modSignal); demodSignal = step(hDemod, receivedSignal); receivedBits = step(hDec, demodSignal); errorStats = step(hError, data, receivedBits); end fprintf('Error rate = %f\nNumber of errors = %d\n', ... errorStats(1), errorStats(2))
[1] Fettweis, G., H. Meyr. "Feedforward Architecture for Parallel Viterbi Decoding,” Journal of VLSI Signal Processing, Vol. 3, June 1991.