C/C++ create random noise (gaussian noise/white noise)

I was amazed when use randn command at Matlab. randn command will generate random data every we call that command. After I search at google, I found how to make this happen. I get this code at seismic unix source code. This code will generate random noise or white noise with Gaussian method. Code for main.c is :

This is code for frannor.h :

This is code for frannor.c :

To compile this source code, use command :

gcc main.c frannor.c -lm -o random

This is output from program :

Source : http://www.cwp.mines.edu/cwpcodes/index.html


Hi, This is my notes when I try something. Maybe, this is NOT THE BEST SOLUTION for your problems. If you have other method or idea that better with my post, please share in this blog. Thank for visiting my site.

More Posts - Website

One thought on “C/C++ create random noise (gaussian noise/white noise)

Leave a Reply

Your email address will not be published. Required fields are marked *