??? 09/12/07 21:04 Read: times |
#144517 - The application is... Responding to: ???'s previous message |
I have to generate noise and add it to a digital encoded signal and decode this signal.
the noise must be AWGN (Addtive White Gaussian Noise). So to generate this noise, I use Rayleigh-distributed random variable R and a uniform random variable U in C I wrote: U = (float) lrand48() / RAND_MAX; if (U == 1.0) U = 0.999999999; R = sigma * sqrt(-2.0*log(1.0 - U)); U = (float) lrand48() / RAND_MAX; if (U == 1.0) U = 0.999999999; mean + R*cos(2.0*PI*U); where mean is the mean of noise and sigma the noise variance. lrand48() generate positive long integers uniformly distributed over the interval [0,2^31-1). I found this method in "Contemporary Communication Systems USING MATLAB(R)" by John G. Proakis and Masoud Salehi. It works with C (I've done many many tests) and want to make it work on a 8051 based board. So it's all about generating AWGN. |