Create block interleaved sequence with GPU
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 to the step method. 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. Invoking the step method with 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:
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.
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.
|clone||Block Interleaver object with same property values|
|isLocked||Locked status for input attributes and nontunable properties|
|release||Allow property value and input characteristics changes|
|step||Permute input symbols using a permutation vector|
Interleave and deinterleave data.
%Example 1: Interleave and deinterleave data hInt = comm.gpu.BlockInterleaver([3 4 1 2]'); hDeInt = comm.gpu.BlockDeinterleaver([3 4 1 2]'); data = randi(7, 4, 1); intData = step(hInt, data); deIntData = step(hDeInt, intData); % compare the original sequence, interleaved sequence, % and restored sequence [data, intData, deIntData] %Example 2: Interleave and deinterleave data with random interleaver permVec = randperm(7)'; % Random permutation vector hInt = comm.gpu.BlockInterleaver(permVec); hDeInt = comm.gpu.BlockDeinterleaver(permVec); data = randi(9, 7, 1); intData = step(hInt, data); deIntData = step(hDeInt, intData); % compare the original sequence, interleaved sequence, % and restored sequence [data, intData, deIntData]