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.
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 modulate a signal using phase shift keying:
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.
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 -π/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.
|clone||Create PSK Modulator object with same property values|
|constellation||Calculate or plot ideal signal constellation|
|isLocked||Locked status for input attributes and nontunable properties|
|release||Allow property value and input characteristics changes|
|step||Modulate using M-ary PSK method with GPU|
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.
Modulate data using 16-PSK modulation and then visualize the data using a scatter plot.
% Create binary data for 24, 4-bit symbols data = randi([0 1],96,1); % Create a 16-PSK modulator System object with bits as inputs % and Gray-coded signal constellation hModulator = comm.gpu.PSKModulator(16,'BitInput',true); % Change the phase offset to pi/16 hModulator.PhaseOffset = pi/16; % Modulate and plot the data modData = step(hModulator, data); scatterplot(modData)