主要内容

WGN Generator

Generate white Gaussian noise samples

Since R2026a

  • WGN Generator block

Libraries:
Wireless HDL Toolbox / Utilities

Description

The WGN Generator block generates white Gaussian noise (WGN) samples. The block accepts a control to generate WGN samples, and outputs WGN samples and a control signal to indicate a valid noise output. The WGN samples are a sequence of random samples that have a Gaussian distribution with zero mean and specified noise variance. These samples are called white noise because they have the same amount of power at all frequencies. In simple terms, each sample is completely random and does not depend on any other sample.

You can use this block in the design, testing, and validation of communication systems and signal processing applications. The block interface and architecture are suitable for HDL code generation and hardware deployment.

Examples

Ports

Input

expand all

Signal to enable WGN generation, specified as a Boolean scalar. When you set this port to 1 (true), the block generates WGN samples. When you specify 1 (true), the block generates WGN samples.

Data Types: Boolean

Signal to clear internal states, specified as a Boolean scalar. When this value is 1 (true), the block stops the current calculation and clears all internal states.

Dependencies

To enable this port, select the Enable reset input port parameter.

Data Types: Boolean

Output

expand all

WGN samples, returned as a real or complex scalar. The type of output signal returned at this port depends on the value of the Output signal type parameter.

You can specify the data type for the noise output by using the Output parameter under the Data Types tab.

Data Types: fixed point

This port outputs a control signal, returned as a Boolean scalar, to indicate if the output noise is valid.

Data Types: Boolean

Parameters

expand all

Main

Specify the noise variance as a nonnegative scalar.

Specify the initial seed value for generating the random number. This value must be a positive scalar up to (232 – 1).

Set the type of the output noise signal as Complex or Real.

Select this parameter to enable the reset input port.

Data Types

Use this parameter to set the data type of the output.

Algorithms

expand all

The WGN Generator block uses the Box–Muller method to produce Gaussian noise with unit variance. It generates pairs of independent, standard normally distributed random numbers (mean 0, variance 1) from uniformly distributed inputs. To efficiently create these uniform random variables, the block uses the Tausworthe algorithm, which offers both speed and low memory usage. The block then applies logarithmic, square‑root, sine, and cosine operations to transform the uniform values into Gaussian samples. Finally, the block scales the unit‑variance outputs to achieve the desired noise variance. For more information on the Box–Muller method, see [1]

References

[1] "J.D. Lee, J.D. Villasenor, W. Luk, and P.H.W. Leong. “A Hardware Gaussian Noise Generator Using the Box-Muller Method and Its Error Analysis,” 659–71. IEEE, 2006. https://doi.org/10.1109/TC.2006.81.

Extended Capabilities

expand all

Version History

Introduced in R2026a