Documentation

This is machine translation

Translated by Microsoft
Mouseover text to see original. Click the button below to return to the English verison of the page.

Note: This page has been translated by MathWorks. Please click here
To view all translated materals including this page, select Japan from the country navigator on the bottom of this page.

wgn

Generate white Gaussian noise

Syntax

y = wgn(m,n,power)
y = wgn(m,n,power,imp)
y = wgn(m,n,power,imp,streamhandle)
y = wgn(m,n,power,imp,seed)
y = wgn(___,powertype)
y = wgn(___,outputtype)

Description

y = wgn(m,n,power) generates an m-by-n matrix of white Gaussian noise. power specifies the power of y in decibels relative to a watt. The default load impedance is 1 ohm.

y = wgn(m,n,power,imp) accepts an additional input, imp, that specifies the load impedance in ohms.

y = wgn(m,n,power,imp,streamhandle) accepts a random stream handle to generate the normal random samples by using randn, before generating the matrix of white Gaussian noise. For more information, see RandStream.

y = wgn(m,n,power,imp,seed) accepts a seed value for initializing the normal random number generator, randn, before generating the matrix of white Gaussian noise. If you want to generate repeatable noise samples, then either reset the random stream input before calling wgn or use the same seed input.

y = wgn(___,powertype) accepts an additional input, powertype, that specifies the units of power. Choices for powertype are 'dBW', 'dBm', and 'linear'.

y = wgn(___,outputtype) accepts an additional input, outputtype, specified as 'real' or 'complex'. If outputtype is 'complex', then the real and imaginary parts of y each have a noise power of power/2.

Note

The output of the wgn function is expressed in volts. For power calculations, a load of 1 ohm is assumed.

Examples

collapse all

Generate a 1000-element column vector containing real white Gaussian noise of power 0 dBW.

y1 = wgn(1000,1,0);

Confirm that the power is approximately 0 dBW, that is, 1 W.

var(y1)
ans = 0.9979

Generate a vector of complex white Gaussian noise having power -6 dBW.

y2 = wgn(1000,1,-6,'complex');

Confirm that the power is 0.25 W (-6 dBW).

var(y2)
ans = 0.2522

See Also

Functions

Introduced before R2006a

Was this topic helpful?