Re: Gaussian Noise Generation



cincydsp@xxxxxxxxx wrote:
On Aug 1, 10:39 am, Chris Barrett
<"chrisbarret"@0123456789abcdefghijk113322.none> wrote:
cincy...@xxxxxxxxx wrote:
On Aug 1, 9:09 am, Chris Barrett
<"chrisbarret"@0123456789abcdefghijk113322.none> wrote:
So for a Gaussian noise sequence y[i], would I write that as
x[i] - M
y[i] = ----------- ,
sigma
where x[i] are the identically distributed samples, M is the mean of
x[i], and sigma is the standard deviation of x[i]?
You need to sum up some (finite variance) IID samples before
subtracting the mean and dividing by the standard deviation. So, x[i]
is your collection of random samples and each sample has mean M and
variance sigma^2, your Gaussian sample would be:
[ sum_(i=0)^(N-1) x[i] ] - NM
y[i] = -------------------------------------------
sigma * sqrt(N)
where N is the number of samples in your sum. As others have
recommended, 8-12 is a decent number.
Jason
But this only gives one sample. Do I do this for sets of 8-12 samples?
In other words, should I use this equation:

[ sum_(i=0)^(N-1) x[i+Nj] ] - NM
y[j] = -------------------------------------------
sigma * sqrt(N)

where x[i] has been replaced by x[i+Nj] ?

Like others have suggested, you can use a linear filter (i.e. a boxcar
filter) to generate the running sum of the last N samples from your
random generator, then apply the mean/variance correction once for
each sample. You can implement this more efficiently so you don't have
to compute the full sum for every output sample.

A boxcar filter highly correlates successive outputs. After all, N-1 out of N addends are unchanged, so the next number can't differ much from the present one. The noise may be Gaussian, but it isn't white. To retain whiteness, don't reuse any of the linearly distributed inputs.

Jerry
--
Engineering is the art of making what you want from things you can get.
.



Relevant Pages