tags:

views:

248

answers:

3

I need to simulate a Gaussian Channel in C. How do I do that? Where can I get code snippets for this?

A: 

Ops, please ignore this. I found the answer.

Victor
You can close your own questions
jab
You can also put the answer here.
Jefromi
A: 

Now I'm curious. What did you find?

anyone
+1  A: 

IIRC, approximating Gaussian distribution is easy - but slow if you want a good approximation. Just add several independent random numbers to get each output. The more "inputs" per output, the better the approximation.

Definitely works if the "inputs" have uniform distribution. I seem to remember reading that it works for almost any input distribution, but you may need far more inputs per output to get a good approximation.

This is Gaussian white noise - the outputs are independent (all frequencies have same amplitude). There's also a similar pink noise algorithm. Still Gaussian distribution, but higher frequencies have lower amplitudes (the outputs aren't independent). Each ouput is still a sum of a fixed set of independent "input" random numbers, but only first is replaced for every output. The second is replaced for every other output, the third for every fourth output, the fourth for every eighth output etc. For most outputs, precisely two input random numbers are replaced - every 2^n outputs you only replace the first.

Steve314