Main Content

comm.gpu.BlockInterleaver

Create block interleaved sequence 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).

Description

The comm.gpu.BlockInterleaver System object™ permutes the input signal using a graphics processing unit (GPU).

To interleave the input signal:

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

example

gpublockinterleaver = comm.gpu.BlockInterleaver creates a GPU-based block interleaver System object that permutes the input signal based on a permutation vector.

gpublockinterleaver = comm.gpu.BlockInterleaver(Name=Value) creates a GPU-based block interleaver object and sets properties using one or more name-value arguments. For example, gpublockinterleaver = comm.gpu.BlockInterleaver(PermutationVector=[2;1;4;3]) specifies the permutation vector for a four-element input signal.

gpublockinterleaver = comm.gpu.BlockInterleaver(permvec) creates a GPU-based block interleaver object and sets the PermutationVector property to permvec.

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.

This property is read-only.

Permutation vector source, specified as 'Property'.

Permutation vector, specified as a column vector of integers. This input vector specifies the mapping used to permute the input signal. The permutation vector length must equal the input signal length and contain each integer in the range [1 length(x)].

Data Types: double

Usage

Description

example

y = gpublockinterleaver(x) permutes the input signal as specified by the PermutationVector property.

Input Arguments

expand all

Input signal, specified as column vector.

To decrease data transfer latency, format the input signal as a gpuArray (Parallel Computing Toolbox) object. For more information, see Array Processing with GPU-Based System Objects.

Data Types: single | double | int8 | int16 | int32 | uint8 | uint16 | uint32 | logical | fi
Complex Number Support: Yes

Output Arguments

expand all

Output signal, returned as a column vector with the same length and data type as the input signal, x. The output contains elements from the input signal mapped as y(k) = x(PermutationVector(k)) for each integer k in the range [1 length(x)].

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

Examples

collapse all

Create GPU-based interleaver and deinterleaver objects.

Set Specific Permutation Vector

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

Pass random data through the interleaver and deinterleaver. The length of the input data vector must equal the length of the PermutationVector property. Generate a 4-by-1 column vector of input data filled with integer values in the range [1, 7] by using the randi function.

data = randi(7,length(interleaver.PermutationVector),1);
intData = interleaver(data);
deintData = deinterleaver(intData);

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

[data intData deintData]
ans = 4×3

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

Confirm that the original and deinterleaved data are identical.

isequal(data,deintData)
ans = logical
   1

Set Random Permutation Vector

Generate a random 8-by-1 vector of unique integers to use as the permutation vector by using the randperm function.

permVec = randperm(8)';

Specify permVec as the permutation vector for GPU-based 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,length(interleaver.PermutationVector),1);
intData = interleaver(data);
deintData = deinterleaver(intData);

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

[data intData deintData]
ans = 8×3

    10     5    10
     5     8     5
     9     9     9
     2     2     2
     5    10     5
    10     5    10
     8    10     8
    10    10    10

Confirm that the original and deinterleaved data are identical.

isequal(data,deintData)
ans = logical
   1

More About

expand all

Extended Capabilities

Version History

Introduced in R2012a