Main Content

comm.gpu.AWGNChannel

Add white Gaussian noise to input signal with GPU

To use this object, you must install Parallel Computing Toolbox™ and have access to a supported GPU. If the host computer has a GPU configured, processing uses the GPU. Otherwise, processing uses the CPU. For more information about GPUs, see GPU Computing (Parallel Computing Toolbox).

Description

The comm.gpu.AWGNChannel System object™ adds white Gaussian noise to an input signal using a graphics processing unit (GPU).

To add white Gaussian noise to an input signal:

  1. Create the comm.gpu.AWGNChannel object and set its properties.

  2. Call the object with arguments, as if it were a function.

To learn more about how System objects work, see What Are System Objects?

Creation

Description

example

gpuawgnchan = comm.gpu.AWGNChannel creates a GPU-based channel System object that adds white Gaussian noise to the input signal.

gpuawgnchan = comm.gpu.AWGNChannel(Name=Value) sets properties using one or more name-value arguments. For example, SamplesPerSymbol=4 specifies the samples per symbol value as 4.

Properties

expand all

Unless otherwise indicated, properties are nontunable, which means you cannot change their values after calling the object. Objects lock when you call them, and the release function unlocks them.

If a property is tunable, you can change its value at any time.

For more information on changing property values, see System Design in MATLAB Using System Objects.

Noise level method, specified as "Signal to noise ratio (Eb/No)", "Signal to noise ratio (Es/No)", "Signal to noise ratio (SNR)", or "Variance". For more information, see Relationship Between Eb/No, Es/No, and SNR Modes and Specifying Variance Directly or Indirectly.

Ratio of energy per bit to noise power spectral density (Eb/No) in decibels, specified as a scalar or 1-by-NC vector. NC is the number of channels.

Tunable: Yes

Dependencies

To enable this property, set NoiseMethod to "Signal to noise ratio (Eb/No)".

Data Types: double

Ratio of energy per symbol to noise power spectral density (Es/No) in decibels, specified as a scalar or 1-by-NC vector. NC is the number of channels.

Tunable: Yes

Dependencies

To enable this property, set NoiseMethod to "Signal to noise ratio (Es/No)".

Data Types: double

Ratio of signal power to noise power in decibels, specified as a scalar or 1-by-NC vector. NC is the number of channels.

Tunable: Yes

Dependencies

To enable this property, set NoiseMethod to "Signal to noise ratio (SNR)".

Data Types: double

Number of bits per symbol, specified as a positive integer.

Dependencies

To enable this property, set NoiseMethod to "Signal to noise ratio (Eb/No)".

Data Types: double

Input signal power in watts, specified as a positive scalar or 1-by-NC vector. NC is the number of channels. The object assumes a nominal impedance of 1 ohms.

Tunable: Yes

Dependencies

To enable this property, set NoiseMethod to "Signal to noise ratio (Eb/No)", "Signal to noise ratio (Es/No)", or "Signal to noise ratio (SNR)".

Data Types: double

Number of samples per symbol, specified as a positive integer or 1-by-NC vector. NC is the number of channels.

Dependencies

To enable this property, set NoiseMethod to "Signal to noise ratio (Eb/No)" or "Signal to noise ratio (Es/No)".

Data Types: double

Source of noise variance, specified as "Property" or "Input port".

  • To specify the noise variance value using the Variance property, set VarianceSource to "Property".

  • To specify the noise variance value using an input to the object, when you call it as a function, set VarianceSource to "Input port".

For more information, see Specifying Variance Directly or Indirectly.

Dependencies

To enable this property, set NoiseMethod to "Variance".

White Gaussian noise variance, specified as a positive scalar or 1-by-NC vector. NC is the number of channels.

Tunable: Yes

Dependencies

To enable this property, set NoiseMethod to "Variance" and set VarianceSource to "Property".

Data Types: double

Source of random number stream, specified as "Global stream". When you set RandomStream to "Global stream", the object uses the MATLAB® default random stream to generate random numbers. To generate reproducible numbers using this object, use the rng function.

For a complex input signal, the object creates the random data as follows:

noise = randn(NS,NC)+1i(randn(NS,NC))
NS is the number of samples and NC is the number of channels.

Dependencies

To enable this property, set NoiseMethod to "Variance".

Initial seed of the mt19937ar random number stream, specified as a nonnegative integer. For each call to the reset function, the object reinitializes the mt19937ar random number stream to the Seed value.

Dependencies

To enable this property, set RandomStream to "mt19937ar with seed".

Data Types: double

Usage

Description

y = gpuawgnchan(x) adds white Gaussian noise, as specified by gpuawgnchan, to the input signal. The result is returned in y.

y = gpuawgnchan(x,var) specifies the variance of the white Gaussian noise. This syntax applies when you set NoiseMethod to "Variance" and VarianceSource to "Input port".

For example:

gpuawgnchan = comm.AWGNChannel('NoiseMethod','Variance', ...
     'VarianceSource','Input port');
var = 12;
...
y = gpuawgnchan(x,var);

Input Arguments

expand all

Input signal, specified as a scalar, an NS-element vector, or an NS-by-NC matrix. NS is the number of samples and NC is the number of channels.

To decrease data transfer latency, format the input signal as a gpuArray (Parallel Computing Toolbox) object. For more information, see Array Processing with GPU-Based System Objects.

Data Types: double | single
Complex Number Support: Yes

Variance of additive white Gaussian noise, specified as a positive scalar or 1-by-NC vector. NC is the number of channels, as determined by the number of columns in the input signal matrix.

Data Types: double | single

Output Arguments

expand all

Output signal, returned with the same dimensions as x.

Data Types: double | single
Complex Number Support: Yes

Object Functions

To use an object function, specify the System object as the first input argument. For example, to release system resources of a System object named obj, use this syntax:

release(obj)

expand all

stepRun System object algorithm
releaseRelease resources and allow changes to System object property values and input characteristics
resetReset internal states of System object

Examples

collapse all

Specify the modulation order and generate PSK-modulated random data.

M = 8;
modData = pskmod(randi([0 M-1],1000,1),M,pi/M);

Create an AWGN channel object that uses a GPU. Pass the modulated data through the channel.

gpuChannel = comm.gpu.AWGNChannel('EbNo',15,'BitsPerSymbol', ...
                log2(M));
channelOutput = gpuChannel(modData);

Visualize the noiseless and noisy data in scatter plots.

scatterplot(modData)
scatterplot(channelOutput)

More About

expand all

Algorithms

expand all

References

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

Extended Capabilities

Version History

Introduced in R2012a