comp.lang.idl-pvwave archive
Messages from Usenet group comp.lang.idl-pvwave, compiled by Paulo Penteado

Home » Public Forums » archive » Re: Normal Distributed Random Numbers
Show: Today's Messages :: Show Polls :: Message Navigator
E-mail to friend 
Return to the default flat view Create a new topic Submit Reply
Re: Normal Distributed Random Numbers [message #26519 is a reply to message #26518] Tue, 04 September 2001 14:04 Go to previous message
Craig Markwardt is currently offline  Craig Markwardt
Messages: 1869
Registered: November 1996
Senior Member
"Kay Bente" <KBente@lycos.de> writes:

> Hi
> I have to create arrays with normal distributed random numbers, but with
> variable FWHM (Full width half max/standard deviation sigma?).
> I want to add normal distributed noise to an image, so that the values
> differ around a mean value.
> In IDL there is a procedure to create such arrays RandomN, but you can�t
> change the FWHM and I can�t find what FWHM the normal distribution there
> has.

From the IDL Reference Guide:

> The RANDOMN function returns one or more normally-distributed,
> floating-point, pseudo-random numbers with a mean of zero and a
> standard deviation of one.

So there you go, the deviates produced by RANDOMN have a gaussian
sigma of 1, like this:

S = RANDOMN(SEED, 1000)

And then it's well established for a gaussian distribution that if you
want a new mean, MU, and new gaussian sigma, SIG, then you would apply
the following formula:

SPRIME = S*SIG + MU

And, knowing that gaussian sigma is approximately SIG = FWHM / 2.35,
you are set. The key here is that SIG can be an array, not just a
scalar, so you can have a different value of SIG (and hence FWHM) for
each pixel.

Good luck,
Craig

--
------------------------------------------------------------ --------------
Craig B. Markwardt, Ph.D. EMAIL: craigmnet@cow.physics.wisc.edu
Astrophysics, IDL, Finance, Derivatives | Remove "net" for better response
------------------------------------------------------------ --------------
[Message index]
 
Read Message
Read Message
Read Message
Previous Topic: Normal Distributed Random Numbers
Next Topic: Speed penalty using START and COUNT with HDF_SD_GETDATA

-=] Back to Top [=-
[ Syndicate this forum (XML) ] [ RSS ] [ PDF ]

Current Time: Sun Oct 12 16:54:00 PDT 2025

Total time taken to generate the page: 0.79876 seconds