Generate colored noise signal
The dsp.ColoredNoise
System
object™ generates a colored noise signal with a power spectral density (PSD) of 1/|f|α over its entire frequency range. The inverse frequency power,
α, can be any value in the interval [-2 2]
. The type
of colored noise the object generates depends on the Color you
choose. When you set Color
to 'custom'
, you can
specify the power density of the noise through the InverseFrequencyPower property.
The size and data type properties of the generated signal depend on SamplesPerFrame, NumChannels, and the OutputDataType properties.
This object uses the default MATLAB® random stream, RandStream
. Reset the default stream for
repeatable simulations.
To generate colored noise signal:
Create the dsp.ColoredNoise
object and set its properties.
Call the object with arguments, as if it were a function.
To learn more about how System objects work, see What Are System Objects? (MATLAB).
cn = dsp.ColoredNoise
cn = dsp.ColoredNoise(Name,Value)
cn = dsp.ColoredNoise(pow,samp,numChan,Name,Value)
creates a colored
noise object, cn
= dsp.ColoredNoisecn
, that outputs a noise signal one sample or frame at
a time, with a 1/|f|α spectral characteristic over its entire frequency range. Typical values
for α are α = 1 (pink noise) and
α = 2 (brownian noise).
creates a colored noise object with each specified property set to the specified value.
Enclose each property name in single quotes. cn
= dsp.ColoredNoise(Name,Value
)
creates a colored noise object with the cn
= dsp.ColoredNoise(pow,samp,numChan,Name,Value
)InverseFrequencyPower
property set to pow, the SamplesPerFrame
property
set to samp, and the NumChannels
property set to
numChan.
For versions earlier than R2016b, use the step
function to run the System object algorithm. The arguments to
step
are the object you created, followed by
the arguments shown in this section.
For example, y = step(obj,x)
and y = obj(x)
perform equivalent operations.
noiseOut = cn()
To use an object function, specify the
System
object as the first input argument. For
example, to release system resources of a System
object named obj
, use
this syntax:
release(obj)
[1] Beran, J., Y.Feng, S.Ghosh, and R.Kulik, Long-Memory Processes: Probabilistic Properties and Statistical Methods. NewYork: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.