Package: comm
Add white Gaussian noise to input signal
The AWGNChannel
object adds white Gaussian
noise to a real or complex input signal. When the input uses a realvalued
signal, this object adds real Gaussian noise and produces a real output
signal. When the input uses a complex signal, this object adds complex
Gaussian noise and produces a complex output signal.
When the inputs to the object have a variable number of channels,
the EbNo
, EsNo
, SNR
, BitsPerSymbol
, SignalPower
, SamplesPerSymbol
,
and Variance
properties
must be scalars, when applicable.
To add white Gaussian noise to an input signal:
Define and set up your additive white Gaussian noise channel object. See Construction.
Call step
to add white Gaussian
noise to the input signal according to the properties of comm.AWGNChannel
.
The behavior of step
is specific to each object
in the toolbox.
H = comm.AWGNChannel
creates an additive
white Gaussian noise (AWGN) channel System object™, H
.
This object then adds white Gaussian noise to a real or complex input
signal.
H = comm.AWGNChannel(
creates
an AWGN channel object, Name
,Value
)H
, with each specified
property set to the specified value. You can specify additional namevalue
pair arguments in any order as (Name1
,Value1
,...,NameN
,ValueN
).

Method to specify noise level Select the method to specify the noise level as one of 

Energy per bit to noise power spectral density ratio (Eb/No) Specify the Eb/No ratio in decibels. You can 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 

Energy per symbol to noise power spectral density ratio (Es/No) Specify the Es/No ratio in decibels. You can 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 

Signal to noise ratio (SNR) Specify the SNR value in decibels. You can 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 

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 

Input signal power in Watts Specify the mean square power of the input signal in Watts.
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 

Number of samples per symbol Specify the number of samples per 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 

Source of noise variance Specify the source of the noise variance as one of 

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 

Source of random number stream Specify the source of random number stream as one of When you set this property to When you set this property to 

Initial seed of Specify the initial seed of a This property applies when you set the 
clone  Create AWGN channel object with same property values 
getNumInputs  Number of expected inputs to step method 
getNumOutputs  Number of outputs from step method 
isLocked  Locked status for input attributes and nontunable properties 
release  Allow property value and input characteristics changes 
reset  Reset states of the AWGNChannel System object 
step  Add white Gaussian noise to input signal 
This object implements the algorithm, inputs, and outputs described on the AWGN Channel block reference page. The object properties correspond to the block parameters, except for:
The block uses a random number generator based on
the V5 RANDN (Ziggurat) algorithm and an initial seed, set with the Initial
seed parameter to initialize the random number generator.
Every time the system that contains the block is run, the block generates
the same sequence of random numbers. Similarly, on the object, when
you set the RandomStream
property to mt19937ar
with seed
, you can generate reproducible numbers by resetting
the object.
When you set the RandomStream
property
to Global stream
, this object uses the MATLAB^{®} default
random stream to generate random numbers. To generate reproducible
numbers using this object, you can reset the MATLAB default random
stream using the following code.
reset(RandStream.getGlobalStream)
RandStream
.Sometimes, the input to the step
method
is complex. In such cases, if you try to match the block and object's
random generator and seed by setting the random stream of MATLAB,
the random numbers do not appear in the same order.
The object creates the random data as follows:
noise = randn (lengthInput,1)
+ 1i$$\times $$randn (lengthInput,1) 
The block creates random data as follows:
randData = randn (2$$\times $$lengthInput,1) 
noise = randData(1:2:end) + 1i$$\times $$randData(2:2:end) 
The Symbol period block parameter
corresponds to the SamplesPerSymbol
property.
The Variance from mask and Variance
from port block parameter options of the Mode parameter
correspond to the VarianceSource
property.