comm.gpu.PSKDemodulator

Demodulate using M-ary PSK method with GPU

Description

The GPU PSKDemodulator object demodulates an input signal using the M-ary phase shift keying (M-PSK) method.

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 (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 demodulate a signal that was modulated using phase shift keying:

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

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

Note

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.

Construction

H = comm.gpu.PSKDemodulator returns a GPU-based demodulator System object, H. This object demodulates the input signal using the M-ary phase shift keying (M-PSK) method.

H = comm.gpu.PSKDemodulator(Name,Value) creates a GPU-based M-PSK demodulator object, H, with the specified property set to the specified value. You can specify additional name-value pair arguments in any order as (Name1,Value1,...,NameN,ValueN)

H = comm.gpu.PSKDemodulator(M,PHASE,Name,Value) creates a GPU-based M-PSK demodulator 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.

Properties

ModulationOrder

Number of points in signal constellation

Specify the number of points in the signal constellation as a positive, integer scalar. The default is 8.

PhaseOffset

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.

BitOutput

Output data as bits

Specify whether the output consists of groups of bits or integer symbol values. When you set this property to true, the step method outputs a column vector of bit values with length equal to log2(ModulationOrder) times the number of demodulated symbols. When you set this property to false, the step method outputs a column vector, with a length equal to the input data vector that contains integer symbol values between 0 and ModulationOrder-1. The default is false.

SymbolMapping

Constellation encoding

Specify how the object maps an integer or group of log2(ModulationOrder) bits to the corresponding symbol as 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. This value is represented as 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.

CustomSymbolMapping

Custom constellation encoding

Specify a custom constellation symbol mapping vector. The default is 0:7. 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.

DecisionMethod

Demodulation decision method

Specify the decision method that the object uses as one of Hard decision | Log-likelihood ratio | Approximate log-likelihood ratio. The default is Hard decision. When you set DecisionMethod to false, the object always performs hard decision demodulation. This property applies when you set the BitOutput property to true.

VarianceSource

Source of noise variance

Specify the source of the noise variance as one of Property | Input port. The default is Property. This property applies when you set the BitOutput property to true and the DecisionMethod property to Log-likelihood ratio or Approximate log-likelihood ratio.

Variance

Specify the variance of the noise as a positive, real scalar. The default is 1. If this value is very small (i.e., SNR is very high), then log-likelihood ratio (LLR) computations may yield Inf or -Inf. This occurs because the LLR algorithm computes the exponential value of very large or very small numbers using finite precision arithmetic. In such cases, use approximate LLR is recommended because its algorithm does not compute exponentials. This property applies when you set the BitOutput property to true, the DecisionMethod property to Log-likelihood ratio or Approximate log-likelihood ratio, and the VarianceSource property to Property. This property is tunable.

OutputDataType

Data type of output

When you set this property to Full precision, the output signal inherits its data type from the input signal.

Methods

constellationCalculate or plot ideal signal constellation
stepDemodulate using M-ary PSK method
Common to All System Objects
release

Allow System object property value changes

Algorithm

The GPU PSK Demodulator System object uses the same algorithm as the comm.PSKDemodulator System object. See Decoding Algorithm for details.

Examples

Transmit an LDPC-encoded, QPSK-modulated bit stream through an AWGN channel. Then demodulate, decode, and count errors.

16-PSK Modulation and Demodulation

Transmit an LDPC-encoded, QPSK-modulated bit stream through an AWGN channel.

Create a GPU-based PSK Modulator System object.

hMod = comm.gpu.PSKModulator(16, 'PhaseOffset',pi/16);

Create a GPU-based AWGN Channel System object with a signal-to-noise ratio of 15.

hAWGN = comm.gpu.AWGNChannel('NoiseMethod', ...
    'Signal to noise ratio (SNR)','SNR',15);

Create a GPU-based PSK Demodulator System object.

 hDemod = comm.gpu.PSKDemodulator(16, 'PhaseOffset',pi/16);

Create an error rate calculator System object.

hError = comm.ErrorRate;

Transmit a frame of data containing 50 symbols.

for counter = 1:100
data = gpuArray.randi([0 hMod.ModulationOrder-1], 50, 1);

Run the simulation by using the step method to process data.

modSignal = step(hMod, data);
noisySignal = step(hAWGN, modSignal);
receivedData = step(hDemod, noisySignal);
errorStats = step(hError, gather(data), gather(receivedData));
end

Compute the error rate results.

fprintf('Error rate = %f\nNumber of errors = %d\n',...
    errorStats(1), errorStats(2))

GPU PSK Demodulator

Create GPU PSK modulator and demodulator pair.

gpuMod = comm.gpu.PSKModulator;
gpuDemod = comm.gpu.PSKDemodulator;

Generate random data symbols. Modulate the data.

txData = randi([0 7],1000,1);
txSig = gpuMod(txData);

Pass the signal through an AWGN channel.

rxSig = awgn(txSig,20);

Demodulate the received signal.

rxData = gpuDemod(rxSig);

Determine the number of symbol errors.

numSymErrors = symerr(txData,rxData)
numSymErrors =

   736

Extended Capabilities

Introduced in R2012a