Main Content


Modulate using M-ary PSK method with GPU


The 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 signal.


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 System 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:

  1. Define and set up your PSK modulator object. See Construction.

  2. Call step to modulate the signal according to the properties of comm.gpu.PSKModulator. The behavior of step is specific to each object in the toolbox.


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.


H = comm.gpu.PSKModulator returns a GPU-based demodulator System object, 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 algorithm.

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 modulator object, H, with the ModulationOrder property set to M, the 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 8.


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.


Constellation encoding

Specify how the object maps an integer or group of log2(ModulationOrder) bits to the corresponding symbol as one of Binary | Gray | Custom. The default is Gray. When you set this property to Gray, the object uses a Gray-encoded signal constellation. When you set this property to Binary, the integer m (0 ≤ m ≤ ModulationOrder-1) maps to the complex value exp(j*PhaseOffset + j*2*pi*m/ModulationOrder). When you set this property to Custom, the object uses the signal constellation defined in the CustomSymbolMapping property.


Custom constellation encoding

Specify a custom constellation symbol mapping vector. This property must be a row or column vector of size ModulationOrder with unique integer values in the range [0, ModulationOrder-1]. The values must be of data type double. The first element of this vector corresponds to the constellation point at an angle of 0 + PhaseOffset, with subsequent elements running counterclockwise. The last element corresponds to the constellation point at an angle of –2π/ModulationOrder + PhaseOffset. This property applies when you set the SymbolMapping property to Custom. The default is 0:7.


Data type of output

Specify the output data type as one of double | single. The default is double.


constellationCalculate or plot ideal signal constellation
stepModulate using M-ary PSK method with GPU
Common to All System Objects

Allow System object property value changes


The GPU PSK Modulator System object supports floating-point and integer input data types. This object uses the same algorithm as the comm.PSKModulator System object. See the Algorithms section of the comm.PSKModulator help page for details.


collapse all

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 $\pi/16$.

gpuMod = comm.gpu.PSKModulator(16,'BitInput',true);
gpuMod.PhaseOffset = pi/16;

Modulate and plot the data

modData = gpuMod(data);


[1] Proakis, John G. Digital Communications. 4th ed. New York: McGraw Hill, 2001.

Extended Capabilities

Version History

Introduced in R2012a