Gaussian Noise Generator

This is a discussion on Gaussian Noise Generator within the C Programming forums, part of the General Programming Boards category; Hi guys, Does anyone know of a C function that will generate gaussian noise? Thanks in advance...

  1. #1
    Registered User
    Join Date
    Aug 2003
    Posts
    4

    Gaussian Noise Generator

    Hi guys,

    Does anyone know of a C function that will generate gaussian noise?

    Thanks in advance

  2. #2
    Guest Sebastiani's Avatar
    Join Date
    Aug 2001
    Location
    Waterloo, Texas
    Posts
    5,708
    >> Does anyone know of a C function that will generate gaussian noise?

    Yes.
    Code:
    #include <cmath>
    #include <complex>
    bool euler_flip(bool value)
    {
        return std::pow
        (
            std::complex<float>(std::exp(1.0)), 
            std::complex<float>(0, 1) 
            * std::complex<float>(std::atan(1.0)
            *(1 << (value + 2)))
        ).real() < 0;
    }

  3. #3
    and the hat of wrongness Salem's Avatar
    Join Date
    Aug 2001
    Location
    The edge of the known universe
    Posts
    32,687
    If you dance barefoot on the broken glass of undefined behaviour, you've got to expect the occasional cut.
    If at first you don't succeed, try writing your phone number on the exam paper.
    I support http://www.ukip.org/ as the first necessary step to a free Europe.

  4. #4
    The superhaterodyne twomers's Avatar
    Join Date
    Dec 2005
    Location
    Ireland
    Posts
    2,262
    Generating Gaussian Random Numbers, Taygeta Scientific Inc.

    To change the standard deviation multiply by what you want it to be, and to change the mean add a new mean, I'd imagine.

  5. #5
    Registered User
    Join Date
    Aug 2003
    Posts
    4
    Quote Originally Posted by twomers View Post
    Generating Gaussian Random Numbers, Taygeta Scientific Inc.

    To change the standard deviation multiply by what you want it to be, and to change the mean add a new mean, I'd imagine.
    Thankyou kindly

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. Procedural Noise and OpenGL Help!
    By Freestyler in forum C Programming
    Replies: 8
    Last Post: 04-18-2008, 08:06 AM
  2. Replies: 1
    Last Post: 09-04-2007, 05:31 AM
  3. NAQ: Everything you never wanted to know about CPP
    By evildave in forum C Programming
    Replies: 21
    Last Post: 12-12-2005, 09:56 AM
  4. Replies: 1
    Last Post: 03-17-2005, 07:53 AM
  5. written command line password generator
    By lepricaun in forum C Programming
    Replies: 15
    Last Post: 08-17-2004, 08:42 PM

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21