Products & Services Solutions Academia Support User Community Company

Learn more about Communications Toolbox   

wgn - Generate white Gaussian noise

Syntax

y = wgn(m,n,p)
y = wgn(m,n,p,imp)
y = wgn(m,n,p,imp,state)
y = wgn(...,powertype)
y = wgn(...,outputtype)

Description

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

y = wgn(m,n,p,imp) is the same as the previous syntax, except that imp specifies the load impedance in ohms.

y = wgn(m,n,p,imp,s) uses s, which is a random stream handle, to generate random noise samples with randn. This syntax is useful to generate repeatable outputs. Type help RandStream for more information.

y = wgn(m,n,p,imp,state) is the same as the previous syntax, except that wgn first resets the state of the normal random number generator randn to the integer state.

y = wgn(...,powertype) is the same as the previous syntaxes, except that the string powertype specifies the units of p. Choices for powertype are 'dBW', 'dBm', and 'linear'.

y = wgn(...,outputtype) is the same as the previous syntaxes, except that the string outputtype specifies whether the noise is real or complex. Choices for outputtype are 'real' and 'complex'. If outputtype is 'complex', then the real and imaginary parts of y each have a noise power of p/2.

Examples

To generate a column vector of length 100 containing real white Gaussian noise of power 0 dBW, use this command:

y1 = wgn(100,1,0);

To generate a column vector of length 100 containing complex white Gaussian noise, each component of which has a noise power of 0 dBW, use this command:

y2 = wgn(100,1,0,'complex');

See Also

randn, awgn, Signal Sources

  


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