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('
returns a colored noise generator, PropertyName
',PropertyValue
,
...)H
,
with each specified property set to the specified value.
H = dsp.ColoredNoise(POW,SAMP,CHAN,
returns
a colored noise generator, 'PropertyName'
,PropertyValue
)H
, with InverseFrequencyPower
equal
to POW
, SamplesPerFrame
equal
to SAMP
, and NumChannels
equal
to CHAN
. Other specified properties are set to
the specified values.

Noise color Specify the color of the noise as one of


Inverse PSD exponent Specify the inverse PSD exponent, α,
as a real number in the interval
This property is applicable only when In a loglog plot of power as a function of frequency, processes
generated by 

Number of output channels Specify the number of output channels as a positive integer. This property determines the number of columns of the signal. The default value of this property is 1. 

Samples per frame Specify the number of samples per frame as a positive integer. This property determines the number of rows of the signal. The default value of this property is 1024. 

Source of random number stream Specify the source of the random number stream as 

Initial seed Specify the initial seed of the mt19937ar random number generator
as a nonnegative integer. This property only applies when 

Output data type Specify the output data type as 
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
$$S(f)=\frac{L(f)}{f{}^{\alpha}}$$
where α is a real number in the interval [2,2] and $$L(f)$$ is a positive slowlyvarying or constant function. Plotting the power spectral density of such processes on a loglog plot displays an approximate linear relationship between the log frequency and log PSD with slope equal to α
$$\mathrm{ln}S(f)=\alpha \mathrm{ln}\leftf\right+\mathrm{ln}L(f).$$
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
$$10\mathrm{log}S(f)=10\alpha \frac{\mathrm{ln}(2){\mathrm{log}}_{2}(f)}{\mathrm{ln}(10)}+10\frac{\mathrm{ln}(L(f))}{\mathrm{ln}(10)}$$
with the slope in dB/octave given by
$$10\alpha \frac{\mathrm{ln}(2){\mathrm{log}}_{2}(f)}{\mathrm{ln}(10)}$$
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. Longmemory processes have autocorrelations that persist for a long time as opposed to decaying exponentially like many common timeseries models. If α<0, the process is antipersistent and exhibits negative correlation between increments [1].
Special examples of $$\frac{1}{f{}^{\alpha}}$$ 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 $$\frac{1}{f{}^{2}}$$. 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.
$$\sum _{k=0}^{63}{a}_{k}}y(nk)=w(n)$$
where a_{0}=1 and w(n) is a zeromean white noise process.
The AR coefficients for k≥1 are generated according to the following recursive formula with α the inverse PSD exponent
$${a}_{k}=(k1{\scriptscriptstyle \frac{\alpha}{2}})\frac{{a}_{k1}}{k}\text{\hspace{0.17em}}\text{\hspace{0.17em}}\text{\hspace{0.17em}}k=1,2,\dots $$
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. LongMemory 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. 802827.