Search code examples
pythonnumpyrandomnoisewhitenoise

How to add random white noise to data


Suppose I have a column of data whose value ranges from -1.23 to +2.56. What I want is to add 10% random white noise to my data. I'm not sure how to do it in python; please help me with the code.


Solution

  • Add independent Gaussian (normal) randomness to your values.

    Technically it need not be Gaussian. White noise is called that because it has a flat spectrum, meaning it is composed of all frequencies in equal proportions. The Weiner-Khinchin theorem shows that this is mathematically equivalent to having the serial correlation be zero. Many people believe that it requires Gaussian noise, but independence is sufficient to yield a flat spectrum.