Products & Services Solutions Academia Support User Community Company

Learn more about Communications Toolbox   

awgn - Add white Gaussian noise to signal

Syntax

y = awgn(x,snr)
y = awgn(x,snr,sigpower)
y = awgn(x,snr,'measured')
y = awgn(x,snr,sigpower,s)
y = awgn(x,snr,'measured',state)
y = awgn(...,powertype)

Description

y = awgn(x,snr) adds white Gaussian noise to the vector signal x. The scalar snr specifies the signal-to-noise ratio per sample, in dB. If x is complex, awgn adds complex noise. This syntax assumes that the power of x is 0 dBW.

y = awgn(x,snr,sigpower) is the same as the syntax above, except that sigpower is the power of x in dBW.

y = awgn(x,snr,'measured') is the same as y = awgn(x,snr), except that awgn measures the power of x before adding noise.

y = awgn(x,snr,sigpower,s) uses s, which is a random stream handle, to generate random noise samples with randn. If s is an integer, then resets the state of randn to s. The latter usage is obsolete and may be removed in a future release. If you want to generate repeateable noise samples, then provide the handle of a random stream or use reset method on the default random stream.

y = awgn(x,snr,'measured',state) is the same as y = awgn(x,snr,'measured'), except that awgn first resets the state of normal random number generator randn to the integer state.

y = awgn(...,powertype) is the same as the previous syntaxes, except that the string powertype specifies the units of snr and sigpower. Choices for powertype are 'db' and 'linear'. If powertype is 'db', then snr is measured in dB and sigpower is measured in dBW. If powertype is 'linear', snr is measured as a ratio and sigpower is measured in watts.

Relationship Among SNR, Es/N0, and Eb/N0

For the relationships between SNR and other measures of the relative power of the noise, see Describing the Noise Level of an AWGN Channel.

Examples

The commands below add white Gaussian noise to a sawtooth signal. It then plots the original and noisy signals.

t = 0:.1:10;
x = sawtooth(t); % Create sawtooth signal.
y = awgn(x,10,'measured'); % Add white Gaussian noise.
plot(t,x,t,y) % Plot both signals.
legend('Original signal','Signal with AWGN');

Several other examples that illustrate the use of awgn are in Getting Started. The following demos also use awgn: basicsimdemo, vitsimdemo, and scattereyedemo.

See Also

wgn, randn, bsc, AWGN Channel

  


Free Early Verification Kit

Learn how to apply early verification to your development process through these technical resources.

How much time do you spend on testing to ensure implementation meets system-level requirements?

 © 1984-2009- The MathWorks, Inc.    -   Site Help   -   Patents   -   Trademarks   -   Privacy Policy   -   Preventing Piracy   -   RSS