Modulate using M-ary PSK method with GPU
GPU PSKModulator object modulates a signal
using the M-ary phase shift keying method implemented on a graphics
processing unit (GPU). The input is a baseband representation of the
modulated signal. The input and output for this object are discrete-time
signals. This object accepts a scalar-valued or column vector input
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 (Parallel Computing Toolbox).
A GPU-based System
object™ accepts typical MATLAB® arrays or objects created using the
gpuArray class. A GPU-based
object supports input signals with double- or single-precision data types. 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 modulate a signal using phase shift keying:
Starting in R2016b, instead of using the
to perform the operation defined by the System
object, you can
call the object with arguments, as if it were a function. For example,
= step(obj,x) and
y = obj(x) perform
H = comm.gpu.PSKModulator returns a GPU-based
H. This object
modulates the input signal using the M-ary phase shift keying (M-PSK)
method with soft decision using the approximate log-likelihood ratio
H = comm.gpu.PSKModulator(Name,Value) creates
a GPU-based M-PSK modulator object,
H, with the
specified property Name set to the specified Value. You can specify
additional name-value pair arguments in any order as (Name1,Value1,...,NameN,ValueN)
H = comm.gpu.PSKModulator(M,PHASE,Name,Value) creates a GPU-based M-PSK
H, with the ModulationOrder property set to
PhaseOffset property set to PHASE and other
specified property Names set to the specified Values.
M and PHASE are
value-only arguments. To specify a value-only argument, you must also specify all preceding
value-only arguments. You can specify name-value pair arguments in any order.
Number of points in signal constellation
Specify the number of points in the signal constellation as
a positive, integer scalar. The default is
Phase of zeroth point of constellation
Specify the phase offset of the zeroth point of the constellation, in radians, as a real scalar. The default is π/8.
Assume bit inputs
Specify whether the input is bits or integers. The default is false. When you set this property to true, the step method input must be a column vector of bit values whose length is an integer multiple of log2(ModulationOrder). This vector contains bit representations of integers between 0 and ModulationOrder-1. The input data type can be numeric or logical. When you set the BitInput property to false, the step method input must be a column vector of integer symbol values between 0 and ModulationOrder-1. The data type of the input must be numeric.
Specify how the object maps an integer or group of log2(ModulationOrder) bits to
the corresponding symbol as one of
Custom constellation encoding
Specify a custom constellation symbol mapping vector. This property must be a row or column
vector of size
Data type of output
Specify the output data type as one of
|constellation||Calculate or plot ideal signal constellation|
|step||Modulate using M-ary PSK method with GPU|
|Common to All System Objects|
Allow System object property value changes
GPU PSK Modulator System
floating-point and integer input data types. This object uses the
same algorithm as the
the Algorithms section of the
comm.PSKModulator help page for details.
Create binary data for 100, 4-bit symbols
data = randi([0 1],400,1);
Create a 16-PSK modulator System object with bits as inputs and Gray-coded signal constellation. Change the phase offset to .
gpuMod = comm.gpu.PSKModulator(16,'BitInput',true); gpuMod.PhaseOffset = pi/16;
Modulate and plot the data
modData = gpuMod(data); scatterplot(modData)
This System object runs on a GPU, and also supports GPU array inputs. For more information, see Simulation Acceleration Using GPUs.