rwyoung
Joined: 12 Nov 2003 Posts: 563 Location: Lawrence, KS USA
|
|
Posted: Fri Sep 01, 2006 9:29 am |
|
|
Yes. Generate a uniform RN (OK, pseudo-RN). Then take the RN (and depending on the distribution you are looking for, you may need more than one RN sample) and transform it into the desired distribution. Some transformations are more complicated than others and may require the use of look-up tables to avoid heavy computation.
Doesn't use that much processing power. One way to get the RNs is to use a LFSR or you could use one of several different algorithmic methods. The tranforms to go from uniform to other (Gaussain, Poisson, etc) are pretty well documented. Google should pop up several of them.
There are also some good table based methods. Simplest is to have your distribution pre-generated as a table (PDF form of the distribution I believe). Then use a LFSR to generate addresses to step into the table. Extract your value. Depending on bit depth you need you can generate the whole table or you can generate a partial table and interpolate between adjacent values. There are papers written about this technique and implementing it in FPGAs for rapid RN generation. Works pretty well but makes trade offs between speed, processing power, memory and resolution. _________________ Rob Young
The Screw-Up Fairy may just visit you but he has crashed on my couch for the last month! |
|