|Gaussian White Noise|
References : Posted by remage[AT]netposta.hu
Steven W. Smith:
The Scientist and Engineer's Guide to Digital Signal Processing
#define PI 3.1415926536f
float R1 = (float) rand() / (float) RAND_MAX;
float R2 = (float) rand() / (float) RAND_MAX;
float X = (float) sqrt( -2.0f * log( R1 )) * cos( 2.0f * PI * R2 );
Added on : 27/08/02 by pan[at]spinningkids[ DOT ]org
The previous one seems better for me, since it requires only a rand, half log and half sqrt per sample.
Actually, I used that one, but I can't remember where I found it, too. Maybe on Knuth's book.
|Add your own comment|
Comments are displayed in fixed width, no HTML code allowed!