Documentation

This is machine translation

Translated by Microsoft
Mouse over text to see original. Click the button below to return to the English verison of the page.

comm.gpu.BlockInterleaver System object

Package: comm

Create block interleaved sequence with GPU

Description

The GPU BlockInterleaver object permutes the symbols in the input signal using a graphics processing unit (GPU).

    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 in the Parallel Computing Toolbox documentation.

A GPU-based System object™ accepts typical MATLAB® arrays or objects that you create using the gpuArray class as an input. GPU-based System objects support input signals with double- or single-precision data types. The output signal inherits its datatype from the input signal.

  • If the input signal is a MATLAB array, then the output signal is also a MATLAB array. In this case, the System object handles data transfer between the CPU and GPU.

  • If the input signal is a gpuArray, then the output signal is also a gpuArray. In this case, the data remains on the GPU. Therefore, 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 in the Parallel Computing Toolbox documentation.

To interleave the input signal:

  1. Define and set up your block interleaver object. See Construction.

  2. Call step to reorder the input symbols according to the properties of comm.gpu.BlockInterleaver. 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.

Construction

H = comm.gpu.BlockInterleaver creates a GPU-based block interleaver System object, H. This object permutes the symbols in the input signal based on a permutation vector.

H = comm.gpu.BlockInterleaver(Name,Value) creates a GPU-based block interleaver object, H, with the specified property Name set to the specified Value.

H = comm.gpu.BlockInterleaver(PERMVEC) creates a GPU-based block deinterleaver object, H, with the PermutationVector property set to PERMVEC.

Properties

PermutationVector

Permutation vector

Specify the mapping used to permute the input symbols as a column vector of integers. The default is [5;4;3;2;1]. The mapping is a vector where the number of elements is equal to the length, N, of the input to the step method. Each element must be an integer between 1 and N, with no repeated values.

Methods

cloneBlock Interleaver object with same property values
isLockedLocked status for input attributes and nontunable properties
releaseAllow property value and input characteristics changes
stepPermute input symbols using a permutation vector

Algorithm

The GPU Block Interleaver System object uses the same algorithm as the comm.BlockInterleaver System object. See Algorithms on the comm.BlockInterleaver help page for details.

Examples

expand all

Create interleaver and deinterleaver objects.

interleaver = comm.gpu.BlockInterleaver([3 4 1 2]');
deinterleaver = comm.gpu.BlockDeinterleaver([3 4 1 2]');

Pass random data through the interleaver and deinterleaver.

data = randi(7,4,1);
intData = interleaver(data);
deIntData = deinterleaver(intData);

Display the original sequence, interleaved sequence, and restored sequence.

[data intData deIntData]
ans =

     6     1     6
     7     7     7
     1     6     1
     7     7     7

Confirm the original and deinterleaved data are identical.

isequal(data,deIntData)
ans =

     1

Generate a random vector of unique integers as a permutation vector.

permVec = randperm(7)';

Specify permVec as the permutation vector for the interleaver and deinterleaver objects.

interleaver = comm.gpu.BlockInterleaver(permVec);
deinterleaver = comm.gpu.BlockDeinterleaver(permVec);

Pass random data through the interleaver and deinterleaver.

data = randi(10,7,1);
intData = interleaver(data);
deIntData = deinterleaver(intData);

Confirm the original and deinterleaved data are identical.

isequal(data,deIntData)
ans =

     1

Introduced in R2012a

Was this topic helpful?