Gaussian white noise code in C

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
0
jessex (1)
12/7/2003 9:48:52 AM
comp.dsp 20275 articles. 1 followers. allnor (8506) is leader. Post Follow

6 Replies
1364 Views

Similar Articles

[PageSpeed] 50

"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.htm
http://www.mathtools.net/Java/Random_numbers/C_and_C++/

Fred


0
Fred
12/7/2003 7:51:10 PM
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 !
0
Robin48gx
12/8/2003 12:05:35 AM
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
0
kiranatiisc
12/8/2003 4:21:37 AM
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
--

0
Carlos
12/8/2003 5:49:44 AM
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.
�����������������������������������������������������������������������

0
Jerry
12/8/2003 4:52:41 PM
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


0
Nick
12/12/2003 1:28:42 AM
Reply: