cnoise, a C code which generates sequences that simulate 1/f^alpha power law noise. This includes white noise (alpha = 0), pink noise (alpha = 1) and red or Brownian noise (alpha = 2), as well as noise for values of alpha between 0 and 2, by Miroslav Stoyanov.
The program is based in part on an algorithm by Kasdin, as cited in the references.
Kasdin's implementation referenced a number of functions from the Numerical Recipes library (FOUR1, FREE_VECTOR, GASDEV, RAN1, REALFT, VECTOR). Numerical Recipes is a proprietary library whose components cannot be freely distributed. The implementation given here relies instead on the free source library "GSL" (the GNU Scientific Library). Thus anyone can build the code without requiring access to restricted or proprietary software.
Other features of this version of the algorithm include:
Versions of the algorithm are implemented which generate a vector x of size N with a 1/f^alpha frequency distribution, with three choices for the underlying distribution of the white noise vector:
Note that this code was updated on 10 June 2011. Previously, the random number generator was used in such a way that it was possible to return a value which was exactly zero. Because the logarithm of these numbers was used in the generation of the noise vectors, this meant that occasionally a floating point exception would be triggered. A minor adjustment to the algorithm has removed this problem.
The computer code and data files described and made available on this web page are distributed under the MIT license
cnoise is available in a C version and a MATLAB version.
BLACK_SCHOLES, a C code which implements some simple approaches to the Black-Scholes option valuation theory, by Desmond Higham.
colored_noise, a C code which generates samples of noise obeying a 1/f^alpha power law.
PINK_NOISE, a C code which computes a "pink noise" signal obeying a 1/f power law.
SDE, a C code which illustrates the properties of stochastic differential equations (SDE's), and common algorithms for their analysis, by Desmond Higham;
STOCHASTIC_RK, a C code which applies a Runge-Kutta scheme to a stochastic differential equation.
Miroslav Stoyanov, Oak Ridge National Laboratory.