CNOISE
1/F^alpha Power Law Noise Generation
CNOISE
is a MATLAB library 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.
CNOISE 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. Moreover,
the Fourier transform functions require the size of the data
to be a power of 2.
This version of the program is implemented as a MATLAB function.
The Fourier transform functions that are invoked can handle input
data of any size.
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:
-
f_alpha_uniform ( n, range, alpha ),
a uniform distribution on (-range,+range);
-
f_alpha_gaussian ( n, q_d, alpha ),
a Gaussian distribution with mean 0, variance q_d;
-
f_alpha_tgaussian ( n, q_d, range, alpha ),
a Gaussian distribution with mean 0,
variance q_d, truncated to (-range,range).
Licensing:
The computer code and data files described and made available on this web page
are distributed under
the GNU LGPL license.
Languages:
CNOISE is available in
a C version and
a MATLAB version.
Related Data and Programs:
COLORED_NOISE,
a MATLAB library which
generates samples of noise obeying a 1/f^alpha power law.
ORNSTEIN_UHLENBECK,
a MATLAB library which
approximates solutions of the Ornstein-Uhlenbeck
stochastic differential equation (SDE) using the Euler method and
the Euler-Maruyama method.
PINK_NOISE,
a MATLAB library which
computes a "pink noise" signal obeying a 1/f power law.
STOCHASTIC_RK,
a MATLAB library which
applies a Runge-Kutta scheme to a stochastic differential equation.
Author:
Miroslav Stoyanov, Oak Ridge National Laboratory, mkstoyanov@gmail.com.
Reference:
-
Martin Gardner,
White and brown music, fractal curves and one-over-f fluctuations,
Scientific American,
Volume 238, Number 4, April 1978, pages 16-32.
-
Jeremy Kasdin,
Discrete Simulation of Colored Noise and Stochastic Processes
and 1/f^a Power Law Noise Generation,
Proceedings of the IEEE,
Volume 83, Number 5, 1995, pages 802-827.
-
Edoardo Milotti,
1/f noise: a pedagogical review,
arXiv:physics/0204033.
-
Sophocles Orfanidis,
Introduction to Signal Processing,
Prentice-Hall, 1995,
ISBN: 0-13-209172-0,
LC: TK5102.5.O246.
-
William Press,
Flicker Noises in Astronomy and Elsewhere,
Comments on Astrophysics,
Volume 7, Number 4, 1978, pages 103-119.
-
Miroslav Stoyanov, Max Gunzburger, John Burkardt,
Pink Noise, 1/f^alpha Noise, and Their Effect on Solutions
of Differential Equations,
International Journal for Uncertainty Quantification,
Volume 1, Number 3, pages 257-278, 2011.
ZIP File:
The following ZIP file contains the three noise algorithms and the
frequency plotter:
Source Code:
-
f_alpha_gaussian.m,
generates a discrete colored noise vector of size N with power
spectrum distribution of ALPHA.
White noise is sampled from a Gaussian (0,q_d) distribution.
-
f_alpha_tgaussian.m,
generates a discrete colored noise vector of size N with power
spectrum distribution of ALPHA.
White noise is sampled from a truncated Gaussian distribution
with zero-mean, variance Q_D, and range (-R,+R).
-
f_alpha_uniform.m,
generates a discrete colored noise vector of size N with power
spectrum distribution of ALPHA.
White noise is sampled from a uniform distribution
with range (-R,+R).
-
freq_plotter.m,
performs a numerical test on the frequency distribution of
discrete approximations to a continuous noise field.
-
timestamp.m,
prints the current YMDHMS date as a timestamp.
Last revised on 22 December 2018.