DSPRelated.com
Forums

How to generate random noise voltage?

Started by khoo_nelson October 3, 2008
Hello, I'm quite new in using Matlab.How to generate a 2000-point
random noise voltage with a dc or mean value of 0 and an rms value of
10 V using a time step of 1 us.
I try like this

N 00;
for n=1:N
x(n)*rand();
end

I don't know correct or not. Please help me!Thank you!
Hi,

You can create the random function in the following way:
x(n)=(rand(1,2000)*10)+(0);

The general expression is: x=(rand(1,N)*(x2-x1))+(x1); if u want to
vary the value between x2 and x1. For ur work -- x2, x1=0.

It may work for you.

Regards,
Pavel

--- In m..., "khoo_nelson" wrote:
>
> Hello, I'm quite new in using Matlab.How to generate a 2000-point
> random noise voltage with a dc or mean value of 0 and an rms value of
> 10 V using a time step of 1 us.
> I try like this
>
> N 00;
> for n=1:N
> x(n)*rand();
> end
>
> I don't know correct or not. Please help me!Thank you!
>
Hello, I'm quite new in using Matlab.How to generate a 2000-point
>random noise voltage with a dc or mean value of 0 and an rms value of
>10 V using a time step of 1 us.
>I try like this
>
>N 00;
>for n=1:N
>x(n)*rand();
>end
>
>I don't know correct or not. Please help me!Thank you!
>

If I am correct, I think you can do it as follows.

N 00;
x*randn(1,N);

Be careful, is not rand(), because this gives us a uniformly distributed values, and you want gaussian noise. That's why you need randn().

Ion