Got Questions? Get Answers.
Discover MakerZone

MATLAB and Simulink resources for Arduino, LEGO, and Raspberry Pi

Learn more

Discover what MATLAB® can do for your career.

Opportunities for recent engineering grads.

Apply Today

Thread Subject:
Add normal error to some measurements

Subject: Add normal error to some measurements

From: Valeriu

Date: 2 Jun, 2012 09:18:36

Message: 1 of 3

Hello,

I have a set of ideal -error free- measurements and i want to add some error to them to simulate measurement error (noise etc). I want to know how to add an error with a known standard deviation.

X is the ideall measurements.
? is the standard deviation of the error measurement - known
e - error

Xreal = X + e

Xreal = X + ?^2*randn(1) ?

this is not right becouse i will have only positive errors...

please help needed!!

Subject: Add normal error to some measurements

From: Nasser M. Abbasi

Date: 2 Jun, 2012 09:42:13

Message: 2 of 3

On 6/2/2012 4:18 AM, Valeriu wrote:
> Hello,
>
> I have a set of ideal -error free- measurements and i want to add some error
>to them to simulate measurement error (noise etc). I want to know how to add an error with a known standard deviation.
>
> X is the ideall measurements.
> ? is the standard deviation of the error measurement - known
> e - error
>
> Xreal = X + e
>
> Xreal = X + ?^2*randn(1) ?
>
> this is not right becouse i will have only positive errors...
>
> please help needed!!


2*randn(1) you give one random number from distribution whose mean
is zero and with std of 2. So, you'll get negative numbers 50% of the time.

How about using randn with mean of 6?

        6+2*randn(1) ?

This way since std=2, then -3*std will get you to zero and +3*std will
get you to 12.

So, 99.73% of the time, your errors will stay in the positive range.

Or you can go to mean of 8? this way, 99.994% of all the
numbers will come out positive?

(if you happen to get one negative, you can throw the dice again?)

Or you can go with mean=10, then 99.99999999999% (or something like this)
of the time the numbers will be positive? etc... you get the point

--Nasser

Subject: Add normal error to some measurements

From: Valeriu

Date: 2 Jun, 2012 10:37:36

Message: 3 of 3

Thanks a lot for the answer!
I really appreciate it!!

Tags for this Thread

What are tags?

A tag is like a keyword or category label associated with each thread. Tags make it easier for you to find threads of interest.

Anyone can tag a thread. Tags are public and visible to everyone.

Contact us