## Documentation Center |

The `ColoredNoise` object generates pink noise
and other colored noise signals. The form of the PSD is 1/|f|^{α} with
the exponent, α, a real number in the interval [-2,2].

To generate a colored noise signal:

Define and set up your colored noise generator. See Construction.

Call

`step`to generate the colored noise signal according to the properties of`dsp.ColoredNoise`. The signal is an array with the number of rows given by the`SamplesPerFrame`property. The number of columns is given by the`NumChannels`property.

`H = dsp.ColoredNoise` returns a colored
noise generator, `H`, with default settings. Calling `step` with
the default property settings generates a pink noise signal.

`H = dsp.ColoredNoise('PropertyName',PropertyValue,
...)` returns a colored noise generator,

`H = dsp.ColoredNoise(POW,SAMP,CHAN,'PropertyName',PropertyValue)` returns a colored noise generator,

clone | Create colored noise generator with same property values |

getNumInputs | Number of expected inputs to step method |

getNumOutputs | Number of outputs of step method |

isLocked | Locked status for input attributes and nontunable properties |

release | Allow property value and input characteristics changes |

reset | Reset random number generator seed |

step | Generate colored noise signal |

Many phenomena in diverse fields such as hydrology and finance produce time series with power spectral density (PSD) functions that follow a power law of the form

where α is a real number in the interval [-2,2] and is a positive slowly-varying or constant function. Plotting the power spectral density of such processes on a log-log plot displays an approximate linear relationship between the log frequency and log PSD with slope equal to -α

It is often convenient to plot the PSD in dB as function of the log frequency to base 2 in order to characterize the slope in dB/octave. Rewriting the preceding equation, you obtain

with the slope in dB/octave given by

If α>0, *S(f)* goes
to infinity as the frequency, *f*, approaches 0.
Stochastic processes with power spectral densities of this form exhibit
long memory. Long-memory processes have autocorrelations that persist
for a long time as opposed to decaying exponentially like many common
time-series models. If α<0, the process is antipersistent
and exhibits negative correlation between increments [1].

Special examples of processes include:

α=0 — white noise where

*L(f)*is a constant proportional to the process variance.α=1 — pink, or flicker noise. Pink noise has equal energy per octave. See Measure Pink Noise Power in Octave Bands for a demonstration. Accordingly, the power spectral density of pink noise decreases 3 dB per octave.

α=2 — brown noise, or Brownian motion. Brownian motion is a nonstationary process with stationary increments. You can think of Brownian motion as the integral of a white noise process. Even though Brownian motion is nonstationary, you can still define a generalized power spectrum, which behaves like . Accordingly, power in a brown noise decreases 6 dB per octave.

α= -1 — blue noise. The power spectral density of blue noise increases 3 dB per octave.

α= -2 — violet, or purple noise. The power spectral density of violet noise increases 6 dB per octave. You can think of violet noise as the derivative of white noise process.

`dsp.ColoredNoise` generates colored noise using
a white noise input in an autoregressive model (AR) of order 63.

where *a _{0}*=1 and

The AR coefficients for k≥1 are generated according to the following recursive formula with α the inverse PSD exponent

The AR method used in `dsp.ColoredNoise` is detailed
on pp. 820–822 in [2].

[1] Beran, J., Feng, Y., Ghosh, S., and Kulik,
R. *Long-Memory Processes: Probabilistic Properties and
Statistical Methods*, Springer, 2013.

[2] Kasdin, N.J. "Discrete Simulation
of Colored Noise and Stochastic Processes and 1/f^{α} Power
Law Noise Generation", *Proceedings of the IEEE ^{®}*,
Vol. 83, No. 5, 1995, pp. 802-827.

Was this topic helpful?