Main Content

comm.gpu.ConvolutionalInterleaver

Permute input symbols using shift registers with GPU

To use this object, you must install Parallel Computing Toolbox™ and have access to an appropriate GPU. For more about GPUs, see GPU Computing (Parallel Computing Toolbox).

Description

The comm.gpu.ConvolutionalInterleaver System object™ permutes the symbols in the input sequence with a graphics processing unit (GPU).

A GPU-based System object accepts typical MATLAB® arrays or objects created using the gpuArray class. 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 permute the symbols in the input sequence with GPU:

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

intrlvr = comm.gpu.ConvolutionalInterleaver creates a GPU-based convolutional interleaver System object.

example

intrlvr = comm.gpu.ConvolutionalInterleaver(Name=Value) sets Properties using one or more name-value arguments. For example, NumRegisters=10 specifies the number of internal shift registers.

intrlvr = comm.gpu.ConvolutionalInterleaver(m,b,ic) sets the NumRegisters property to m, the RegisterLengthStep property to b, and the InitialConditions property to ic.

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.

Number of internal shift registers, specified as a positive integer.

Data Types: double

Number of additional symbols that fit in each successive shift register, specified as a positive integer. The first register holds zero symbols.

Data Types: double

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 NumRegisters property, then the ith shift register stores the ith 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.

Data Types: double

Usage

Description

intrlvseq = intrlvr(inputseq) permutes the input sequence of symbols 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.

The object consists of N registers, each with a specified delay. N is the total number of shift registers. The object sets the delay value of the kth shift register to ((k-1) ✕ RegisterLengthStep). With each new input symbol, the System object switches the commutator 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.

Input Arguments

expand all

Sequence of symbols, specified as a column vector.

Data Types: double | single | uint32 | int32 | logical

Output Arguments

expand all

Interleaved sequence of symbols, returned as a column vector with the same data type and size as the inputseq input.

Data Types: double | single | uint32 | int32 | logical

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

Create a GPU-based convolutional interleaver System object™.

intrlvr = comm.gpu.ConvolutionalInterleaver('NumRegisters',2, ...
                                            'RegisterLengthStep',3);

Create a GPU-based convolutional deinterleaver System object™.

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 NumRegisters and RegisterLengthStep properties.

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

Extended Capabilities

Version History

Introduced in R2012a