Documentation Center

  • Trial Software
  • Product Updates

Contents

comm.gpu.AWGNChannel System object

Package: comm

Add white Gaussian noise to input signal with GPU

Description

The GPU AWGNChannel object adds white Gaussian noise to an 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.

To add white Gaussian noise to an input signal:

  1. Define and set up your additive white Gaussian noise channel object. See Construction.

  2. Call step to add white Gaussian noise to the input signal according to the properties of comm.gpu.AWGNChannel. The behavior of step is specific to each object in the toolbox.

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.

Construction

H = comm.gpu.AWGNChannel creates a GPU-based additive white Gaussian noise (AWGN) channel System object, H. This object adds white Gaussian noise to a real or complex input signal.

H = comm.gpu.AWGNChannel(Name,Value) creates a GPU-based AWGN channel 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).

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.

Properties

NoiseMethod

Method to specify noise level

Select the method to specify the noise level as one of Signal to noise ratio (Eb/No) | Signal to noise ratio (Es/No) | Signal to noise ratio (SNR) | Variance. The default is Signal to noise ratio (Eb/No).

EbNo

Energy per bit to noise power spectral density ratio (Eb/No)

Specify the Eb/No ratio in decibels. Set this property to a numeric, real scalar or row vector with a length equal to the number of channels. This property applies when you set the NoiseMethod property to Signal to noise ratio (Eb/No). The default is 10. This property is tunable.

EsNo

Energy per symbol to noise power spectral density ratio (Es/No)

Specify the Es/No ratio in decibels. Set this property to a numeric, real scalar or row vector with a length equal to the number of channels. This property applies when you set the NoiseMethod property to Signal to noise ratio (Es/No). The default is 10. This property is tunable.

SNR

Signal to noise ratio (SNR)

Specify the SNR value in decibels. Set this property to a numeric, real scalar or row vector with a length equal to the number of channels. This property applies when you set the NoiseMethod property to Signal to noise ratio (SNR). The default is 10. This property is tunable.

BitsPerSymbol

Number of bits in one symbol

Specify the number of bits in each input symbol. You can set this property to a numeric, positive, integer scalar or row vector with a length equal to the number of channels. This property applies when you set the NoiseMethod property to Signal to noise ratio (Eb/No). The default is 1 bit.

SignalPower

Input signal power in Watts

Specify the mean square power of the input signal in Watts. Set this property to a numeric, positive, real scalar or row vector with a length equal to the number of channels. This property applies when you set the NoiseMethod property to Signal to noise ratio (Eb/No), Signal to noise ratio (Es/No) or Signal to noise ratio (SNR). The default is 1 Watt. The object assumes a nominal impedance of 1 Ohm. This property is tunable.

SamplesPerSymbol

Number of samples per symbol

Specify the number of samples per symbol. Set this property to a numeric, positive, integer scalar or row vector with a length equal to the number of channels. This property applies when you set the NoiseMethod property to Signal to noise ratio (Eb/No) or Signal to noise ratio (Es/No). The default is 1 sample.

VarianceSource

Source of noise variance

Specify the source of the noise variance as one of Property | Input port. The default is Property. Set VarianceSource to Input port to specify the noise variance value via an input to the step method. Set VarianceSource to Property to specify the noise variance value using the Variance property. This property applies when you set the NoiseMethod property to Variance.

Variance

Noise variance

Specify the variance of the white Gaussian noise. You can set this property to a numeric, positive, real scalar or row vector with a length equal to the number of channels. This property applies when you set the NoiseMethod property to Variance and the VarianceSource property to Property. The default is 1. This property is tunable.

RandomStream

Source of random number stream

Specify the source of random number stream. The only valid setting for this property is Global stream. The object generates the normally distributed random numbers from the current global random number stream.

Seed

Initial seed of mt19937ar random number stream

The GPU version of the AWGN Channel System object does not use this property.

Methods

cloneCreate AWGN Channel object with same property values
isLockedLocked status for input attributes and nontunable properties
releaseAllow property value and input characteristics changes
step Add white Gaussian noise to input signal

Algorithm

This object uses the same algorithm as the comm.AWGNChannel System object. See the Algorithms section of the comm.AWGNChannel help page for more details. The object properties correspond to the related block parameters, except that:

  • This object uses parallel.gpu.RandStream to provide an interface for controlling the properties of one or more random number streams that the GPU uses. Usage is the same as RandStream with the following restrictions:

    • Only the combRecursive (MRG32K3A) generator is supported.

    • Only the Inversion normal transform is supported.

    • Setting the substream property is not allowed.

Enter help parallel.gpu.RandStream at the MATLAB command line for more information.

Examples

Add AWGN to an 8-PSK signal.

hMod = comm.PSKModulator; 
modData = step(hMod,randi([0 hMod.ModulationOrder-1],1000,1));
hAWGN = comm.gpu.AWGNChannel('EbNo',15, 'BitsPerSymbol', ...
                log2(hMod.ModulationOrder));
channelOutput = step(hAWGN, modData);
% Visualize the noiseless and noisy data in scatter plots
scatterplot(modData)
scatterplot(channelOutput)

See Also

Was this topic helpful?