Home > Community > Forums > Functional Verification > e-code: Generation of Normal_Gaussian Distribution

Email

* Required Fields

Recipients email * (separate multiple addresses with commas)

Your name *

Your email *

Message *

Contact Us

* Required Fields
First Name *

Last Name *

Email *

Company / Institution *

Comments: *

 e-code: Generation of Normal_Gaussian Distribution 

Last post Sun, Feb 5 2006 11:27 AM by archive. 0 replies.
Started by archive 05 Feb 2006 11:27 AM. Topic has 0 replies and 1055 views
Page 1 of 1 (1 items)
Sort Posts:
  • Sun, Feb 5 2006 11:27 AM

    • archive
    • Top 75 Contributor
    • Joined on Fri, Jul 4 2008
    • Posts 88
    • Points 4,930
    e-code: Generation of Normal_Gaussian Distribution Reply

    This code generates a Normal distributed variable.

    This cofde generates 12 (it's an importnat number) uniformly distributed variables (Xs)between -100 and 100 and adds them into a 1000 sample vector called gausian.

    Of course, you can play with the parameters to satisfy your demands, but the important things are:
    1) if you give Xs asymetric range , and you want a normal (i.e mean=0) distribution, don't forget to substract
    range_size/2 from every sample.
    2) The number 12 gives the std 1 because a uniform std is 0.25 =~sqrt(1/12) and by adding 12 Xs you obtain std=1
    so if you change this number be sure to modify your std as well.
    3) I gave an example with 1000 points. Of course, the more points-the more accurte distribution, but longer run.

    The code includes coverage so that if you run it with specview and open the coverage window and look at samples
    ( under normal.collect) you can see graghically the distribution (flipped to the side)

    author: Avi Farjoun updated 10/28/2004 1071 bytes


    Originally posted in cdnusers.org by Administrator
    • Post Points: 0
Page 1 of 1 (1 items)
Sort Posts:
Started by archive at 05 Feb 2006 11:27 AM. Topic has 0 replies.