Generate white Gaussian noise samples
Generate real and complex white Gaussian noise (WGN) samples. Check the power of output WGN matrices.
Generate a 1000-element column vector of real WGN samples and confirm that the power is approximately 1 watt, which is 0 dBW.
y1 = wgn(1000,1,0); var(y1)
ans = 0.9979
Generate a 1000-element column vector of complex WGN samples and confirm that the power is approximately 0.25 watts, which is –6 dBW.
y2 = wgn(1000,1,-6,'complex'); var(y2)
ans = 0.2522
m— Number of white Gaussian noise samples
Number of white Gaussian noise samples desired per channel, specified as a positive integer.
n— Number of channels
Number of channels of white Gaussian noise samples desired, specified as a positive integer.
power— Power of noise samples
Power of noise samples, specified as a scalar. The default units for power
is dBW. Use
powertype to change the units of
imp— Load impedance
Load impedance in ohms, specified as a scalar.
randobject— Random number stream object
Random number stream object, specified as a
RandStream object. The state
of the random stream object determines the sequence of numbers produced by
randn function. Configure the
random stream object using the
reset (RandStream) function
and its properties.
For information about producing repeatable noise samples, see Tips.
seed— Random number generator seed
Random number generator seed, specified as a nonnegative integer. For more
information on the random number generator, see
powertype— Signal power unit
Signal power unit, specified as
'linear'. Linear power
is in watts.
To generate repeatable white Gaussian noise samples, use one of these tips:
Usage notes and limitations:
Code generation supported, except for syntaxes that include a