COMPGROUPS.NET | Search | Post Question | Groups | Stream | About | Register

### How to generate colored Noise

• Follow

```Hi Everyone.

I am trying to generate colored gaussian noise in matlab. I already know the variance of the noise. Does anyone know how to do it?
```
 0

```"robert LAURENCE" <bzoh@uno.edu> wrote in message <i7ds7l\$4lf\$1@fred.mathworks.com>...
> Hi Everyone.
>
> I am trying to generate colored gaussian noise in matlab. I already know the variance of the noise. Does anyone know how to do it?

Hi Robert, colored noise is a very general term that indicates that the noise has an autocorrelation that is not like white noise, in other words, an autocorrelation that is statistically different from zero at nonzero lags. You can generate such a noise by filtering a white noise input using filter(). However, you need to know the filter's numerator and denominator coefficients. For example, you can generate a lowpass AR(1) process by placing a  pole near 1 on the unit circle and a zero at the origin.

y = filter(1,[1 -0.9],randn(1024,1));

AR(1) processes are just one type of colored noise. They are often referred to as "red noise". You can generate colored noises as realizations of moving average processes, autoregressive moving average processes, etc.

Wayne
```
 0

```Thank you for you answer wayne. I had the p.s.d of the noise and integrated it to get the average power, also equals to variance.Now I am trying to generate a colored noise with that variance. I can't really tell what kind of noise it is.
```
 0

```On Sep 23, 10:16=A0am, "robert LAURENCE" <b...@uno.edu> wrote:
> Thank you for you answer wayne. I had the p.s.d of the noise and integrat=
ed it to get the average power, also equals to variance.Now I am trying to =
generate a colored noise with that variance. I can't really tell what kind =
of noise it is.

Assuming your PSD has N data and the first frequency is nonzero (i.e.
1.  Take the square root of the power to get amplitude.
2.  Generate N random phases between 0 and 2*pi using rand(N,1)*2*pi
3.  Compose: Y=3Damp.*exp(i*phase);
4.  Generate YY=3D[0;Y;0;flipud(conj(Y))];
5.  Invert to get time series: y=3Difft(YY);
6.  Scale so that you get the correct variance.
```
 0

```"robert LAURENCE" <bzoh@uno.edu> wrote in message <i7dv76\$gi7\$1@fred.mathworks.com>...
> Thank you for you answer wayne. I had the p.s.d of the noise and integrated it to get the average power, also equals to variance.Now I am trying to generate a colored noise with that variance. I can't really tell what kind of noise it is.

You only have a psd estimate of the noise? You don't have at least one realization of the actual noise process?

Wayne
```
 0

```"Wayne King" <wmkingty@gmail.com> wrote in message <i7e3k7\$p4m\$1@fred.mathworks.com>...
> "robert LAURENCE" <bzoh@uno.edu> wrote in message <i7dv76\$gi7\$1@fred.mathworks.com>...
> > Thank you for you answer wayne. I had the p.s.d of the noise and integrated it to get the average power, also equals to variance.Now I am trying to generate a colored noise with that variance. I can't really tell what kind of noise it is.
>
> You only have a psd estimate of the noise? You don't have at least one realization of the actual noise process?
>
> Wayne

Thank you Wayne for your contribution. I have an expression for the noise P.S.D. I am using a chirp signal. I integrated the psd expression over the frequency bandwidth to obtain the average power which is equal to the variance. Now I wanna use that variance to generate the noise(colored).
```
 0

5 Replies
811 Views

Similiar Articles:

7/24/2012 6:32:33 AM