In this series:

- How to implement a Rayleigh fading channel in an FPGA – Part 1: Generation of correlated Rayleigh random variables
- How to implement a Rayleigh fading channel in an FPGA – Part 3: The hardware architecture of a Rayleigh random variable generator
- How to implement a Rayleigh fading channel in an FPGA – Part 4: A model-based implementation of a Rayleigh random variable generator
- How to implement a Rayleigh fading channel in an FPGA – Part 5: Targeting a Rayleigh random variables generator for Nutaq’s Perseus 601x platform

My previous blog post mentioned an efficient approach for generating correlated Rayleigh random variables by using the method proposed in

**Figure 1: A discrete-time correlated Rayleigh sample generation algorithm**

It turns out that identically distributed (i.i.d) Gaussian random variables are required to generate data for the frequency-domain Doppler filter. The generation of Gaussian random variables, based on the transformation of uniform random variables, is mostly used for the hardware implementations described in the Ziggurat method [2], the Wallace method [3], Box-Muller and its variations [4,5,6,7]. In this blog post, a combination of Box-Muller and the central limit theorem method is used to generate the i.i.d Gaussian random variables. A summary of the Box-Muller algorithm is described below:

*u*_{0} and *u*_{1} are two independent uniform random variables, U(0,1). The resulting *x*_{0} and *x*_{1} are two independent Gaussian random variables N(0,1). A 32-bit uniform number generator uses the Tausworthe algorithm to provide fast, superior randomness that occupy less area in the FPGA than the traditional linear feedback shift registers (LFSR) approach [8]. The hardware architecture of a 32-bit uniform random variables generator using the Tausworthe algorithm is shown in Figure 2.

**Figure 2: Uniform random variables generator**

**Figure 3: Gaussian random variables generator**

A quantization of the function f, g0, and g1 are pre-computed and stored in the FPGA’s internal memory. The hardware architecture of the Gaussian random variable generator is showed in Figure 3. A simple recursive non-uniform quantization approach of f=√e function is derived from [5]. An accumulation of the results is also performed in order to realize the central limit theorem to overcome quantization and approximation errors. It clearly shown that the maximum value of random variables, *x _{0}* and

*x*, is determined by the smallest value of the f=√e function. This lets us determine the smallest value of u

_{1}_{0}. Therefore, the number of recursions and steps per recursion during the quantization of f=√e determines the maximum value.

a) Normalized generated probablility density function (PDF) versus theoretical N(0,1) Gaussian PDF

b) Maximum normalized output of the generator

**Figure 4: Normalized PDF of the Gaussian random variable generator**

The results of the Gaussian random variable generator and its maximum normalized value over 224 generated samples is shown in Figure 4. It can be seen that the generated random variable PDF closely follows the theoretical Gaussian PDF and it is also able to generate maximum samples around 5.5σ. The results of the two independent Gaussian random variables *x _{0}* and

*x*will be used as input to the frequency-domain Doppler filters in the Rayleigh fading generator.

_{1}## Conclusion

This blog post showed a simple and efficient implementation architecture of the Gaussian random variable based on a combination of the Box-Muller and central limit theorem approaches. This will be an important core element for the realization of a baseband correlated Rayleigh channel emulator in an upcoming blog post.

## References

[1] | D. J. Young and N. C. Beaulieu, “The generation of correlated Rayleigh random variates by inverse discrete Fourier transform,” IEEE Transactions on Communications, vol. 48, no. 7, pp. 1114-1127, 2000. |

[2] | George Marsaglia and Wai Wan Tsang, “The ziggurat method for generating random variables,” Journal of Statistical Software, vol. 5, no. 8, 2000. |

[3] | C. Wallace, “Fast pseudorandom generators for normal and exponential variates,” ACM Trans. Math. Software, vol. 22, no. 1, pp. 119-127, 1996. |

[4] | G. Box and M. Muller, “A Note on the Generation of Random Normal Deviates,” The Annals of mathematical statistics, vol. 29, pp. 610-611, 1958. |

[5] | E. Boutillon and J. Danger and A. Gazel, “Design of high speed AWGN communication channel emulator,” Analog integrated circuits amd signal processing, vol. 34, no. 2, pp. 133-142, 2003. |

[6] | Dong-U Lee and Wayne Luk and John D. Villasenor and Peter Y.K. Cheung, “A Gaussian noise generator for hardware-based simulators,” IEEE Trans. Computers, vol. 53, no. 12, pp. 1523-1534, 2004. |

[7] | Dong-U Lee and John D. Villasenor and Wayne Luk and Philip H.W Leong Cheung, “A hardware Gaussian noise generator using the Box-Muller method and its error analysis,” IEEE Trans. Computers, vol. 55, no. 6, pp. 659-671, 2006. |

[8] | R. C. Tausworthe, “Random number generated by Linear Recurrent Modulo Two,” Math and Computation, vol. 19, pp. 201-209, 1965. |