What you need to search for is the Box-Muller algorithm. So simpe that even
the meanest programmer should be able to implement it in C.
Nick Felgate
"Jess" <jessex@kmfms.com> wrote in message
news:63bbea8b.0312070148.4a07e00@posting.google.com...
> Hello all,
>
> I'm in need of a C program which implements the Gaussian white noise
> algorithm in C. The program is to accept a binary file as input and
> alter it according to the algorithm.
> I'm affraid this project must run on Windoze :(
> Thank you in advance
>
> Jess
Reply by Jerry Avins●December 8, 20032003-12-08
Robin48gx wrote:
> On Sun, 07 Dec 2003 09:48:52 +0000, Jess wrote:
>
>
>>Hello all,
>>
>>I'm in need of a C program which implements the Gaussian white noise
>>algorithm in C. The program is to accept a binary file as input and
>>alter it according to the algorithm.
>>I'm affraid this project must run on Windoze :( Thank you in advance
>>
>
>
>
> Although I have not tried it, white noise should have a flat spectrum.
> You could try setting all values to 1 in a complex array and performing
> an inverse FFT on it.
>
> Possibly a tweak or two is in order.
>
> This should be guaranteed white noise !
Don't offer guarantees too freely. With one set of phases, it could be
the spectrum of an impulse. With another, of a chirp. Anyhow, summing 12
to 20 random numbers is easier than a broadband IFFT.
Jerry
--
Engineering is the art of making what you want from things you can get.
�����������������������������������������������������������������������
Reply by Carlos Moreno●December 8, 20032003-12-08
Robin48gx wrote:
> Although I have not tried it, white noise should have a flat spectrum.
> You could try setting all values to 1 in a complex array and performing
> an inverse FFT on it.
>
> Possibly a tweak or two is in order.
>
> This should be guaranteed white noise !
This can not be less white noise!! This is not even noise!!
This is a deterministic signal!!
Maybe (and only *maybe* -- as in, I'm almost sure that it
won't work, but there's a slight chance that it might) if
you set the magnitudes of the FFT to 1, and set the phase
to uniformly distributed random values between -pi and pi...
Maybe you'll get something similar to white noise...
And BTW, how do you expect this to produce *Gaussian* white
noise? How do you know that it's not going to be uniformly
distributed white noise?
Carlos
--
Reply by Kiran.T●December 8, 20032003-12-08
Robin48gx <robin48gx@hotmail.com> wrote in message >
> Although I have not tried it, white noise should have a flat spectrum.
> You could try setting all values to 1 in a complex array and performing
> an inverse FFT on it.
>
> Possibly a tweak or two is in order.
>
> This should be guaranteed white noise !
Well, if you do this, you'll get an impulse - autocorrelation of white noise!
Kiran
Reply by Robin48gx●December 7, 20032003-12-07
On Sun, 07 Dec 2003 09:48:52 +0000, Jess wrote:
> Hello all,
>
> I'm in need of a C program which implements the Gaussian white noise
> algorithm in C. The program is to accept a binary file as input and
> alter it according to the algorithm.
> I'm affraid this project must run on Windoze :( Thank you in advance
>
Although I have not tried it, white noise should have a flat spectrum.
You could try setting all values to 1 in a complex array and performing
an inverse FFT on it.
Possibly a tweak or two is in order.
This should be guaranteed white noise !
Reply by Fred Marshall●December 7, 20032003-12-07
"Jess" <jessex@kmfms.com> wrote in message
news:63bbea8b.0312070148.4a07e00@posting.google.com...
> Hello all,
>
> I'm in need of a C program which implements the Gaussian white noise
> algorithm in C. The program is to accept a binary file as input and
> alter it according to the algorithm.
> I'm affraid this project must run on Windoze :(
Jess,
What does Windows have to do with your question? Presumably you have an
ANSI C compiler that's suitable for generating code that will run on the
usual platforms, no?
What does the "binary file as input" have to do with the question? Are you
meaning to add the noise to the input data or.....? If you intend to add
it, then you'll be concerned with scaling the noise to match the intended
application. This includes the number represenation you'll be using (fixed,
floating, etc.)
Check out:
http://www.dspguru.com/howto/tech/wgn.htmhttp://www.mathtools.net/Java/Random_numbers/C_and_C++/
Fred
Reply by Jess●December 7, 20032003-12-07
Hello all,
I'm in need of a C program which implements the Gaussian white noise
algorithm in C. The program is to accept a binary file as input and
alter it according to the algorithm.
I'm affraid this project must run on Windoze :(
Thank you in advance
Jess