Permute input symbols using shift registers with GPU
To use this object, you must install Parallel Computing Toolbox™ and have access to a supported GPU. If the host computer has a GPU configured, processing uses the GPU. Otherwise, processing uses the CPU. For more information about GPUs, see GPU Computing (Parallel Computing Toolbox).
System object™ permutes the symbols in the input sequence with a graphics processing unit
To permute the symbols in the input sequence:
comm.gpu.ConvolutionalInterleaverobject and set its properties.
Call the object with arguments, as if it were a function.
To learn more about how System objects work, see What Are System Objects?
creates a GPU-based convolutional interleaver System object.
intrlvr = comm.gpu.ConvolutionalInterleaver
sets properties using one or more name-value arguments. For example,
intrlvr = comm.gpu.ConvolutionalInterleaver(
NumRegisters=10 specifies the number of internal shift
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.
NumRegisters — Number of internal shift registers
6 (default) | positive integer
Number of internal shift registers, specified as a positive integer.
RegisterLengthStep — Number of additional symbols that fit in each successive shift register
2 (default) | positive integer
Number of additional symbols that fit in each successive shift register, specified as a positive integer. The first register holds zero symbols.
InitialConditions — Initial conditions of shift registers
0 (default) | numeric scalar | column vector
Initial conditions of the shift registers, specified as one of these values.
Scalar — All shift registers, except the first one, store the same specified value.
Column vector — If the length of the column vector equals the value of the
NumRegistersproperty, then the kth shift register stores the kth element of the specified vector.
You do not need to specify a value for the first shift register, which has zero delay. Because the first shift register has zero delay, the object ignores the first element of this property.
permutes the input sequence of symbols
intrlvseq = intrlvr(
inputseq by using a set of
shift registers. If the host computer has a GPU configured, processing uses the GPU.
Otherwise, processing uses the CPU. The output is the interleaved sequence.
For information about delays, see Delays of Convolutional Interleaving and Deinterleaving.
inputseq — Sequence of symbols
Sequence of symbols, specified as a column vector.
intrlvseq — Interleaved sequence of symbols
Interleaved sequence of symbols, returned as a column vector with the same data
type and size as the
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
GPU-Based Convolutionally Interleave and Deinterleave Sequence
Create GPU-based convolutional interleaver and deinterleaver System objects.
intrlvr = comm.gpu.ConvolutionalInterleaver('NumRegisters',2, ... 'RegisterLengthStep',3); deintrlvr = comm.gpu.ConvolutionalDeinterleaver('NumRegisters',2, ... 'RegisterLengthStep',3);
Generate a random data sequence. Pass the data sequence through the interleaver and then the deinterleaver.
data = (0:20)'; intrlvData = intrlvr(data); deintrlvData = deintrlvr(intrlvData);
Display the original sequence, interleaved sequence, and restored sequence.
[data intrlvData deintrlvData]
ans = 21×3 0 0 0 1 0 0 2 2 0 3 0 0 4 4 0 5 0 0 6 6 0 7 1 1 8 8 2 9 3 3 ⋮
The delay through the interleaver and deinterleaver pair is equal to the product of the
intrlvDelay = intrlvr.NumRegisters * intrlvr.RegisterLengthStep
intrlvDelay = 6
After accounting for this delay, verify that the original and deinterleaved data are identical.
numSymErrors = symerr(data(1:end-intrlvDelay), ... deintrlvData(1+intrlvDelay:end))
numSymErrors = 0
Delays of Convolutional Interleaving and Deinterleaving
The total delay due to a convolutional interleaver and deinterleaver pair is N × slope × (N – 1).
This diagram shows the structure of a general convolutional interleaver comprised of a set of shift registers, each having a specified delay shown as D(1), D(2),..., D(N), and a commutator to switch input and output symbols through registers. The kth shift register holds D(k) symbols, where k = 1, 2, 3, … N. The kth shift register has a delay value of ((k–1) × slope). With each new input symbol, the commutator switches to a new register and shifts in the new symbol while shifting out the oldest symbol in that register. When the commutator reaches the Nth register, upon the next new input, the commutator returns to the first register.
Array Processing with GPU-based System Objects
A GPU-based System object accepts typical MATLAB® arrays or
gpuArray (Parallel Computing Toolbox) objects. The output signal data
type matches the input signal data type.
When the input signal to the GPU-based System object is a
gpuArrayobject, calculations take place entirely on the GPU, the data remains on the GPU, and the output signal is a
gpuArrayarguments minimizes data transfer latency by limiting the number of data transfers between the CPU and the GPU when your simulation runs. For more information, see Establish Arrays on a GPU (Parallel Computing Toolbox).
When the input signal is a MATLAB array, the GPU-based System object transfers the data between the CPU and the GPU for each object call. The output signal is a MATLAB array and data transfer latency occurs.
Accelerate code by running on a graphics processing unit (GPU) using Parallel Computing Toolbox™.
This System object runs on a GPU, and also supports GPU array inputs. For more information, see Accelerate Simulation Using GPUs.
Introduced in R2012a
gpuArray(Parallel Computing Toolbox)