本文档介绍了如何在C语言编程环境中生成高斯白噪声,包括相关的理论知识和具体的代码实现方法。
Routine mrandom is designed to generate random numbers (pseudo-white noise). The input parameters are as follows:
- n: the number of requested random data points; an integer.
- iseed: the seed for generating pseudo-random data. It must be initialized by the main program, with a suggested value of ISEED=12357. The cycle length of this sequence is 1,048,576.
- itype: specifies the distribution type of random data:
- itype=1: uniformly distributed from 0.0 to 1.0
- itype=2: uniformly distributed with a mean of 0.0 and variance (power) p=1.0
- itype=3: uniformly distributed with a mean of 0.0 and variance (power) p=p.
- itype=4: Gaussian distribution with a mean of 0.0 and variance (power) p=1.0
- itype=5: Gaussian distribution with a mean of 0.0 and variance (power) p=p.
- p: the variance (power) of random data, used only when itype is either 3 or 5.
The output parameter:
- u: an n-dimensional real array where the generated data will be stored from u(0) to u(n-1).