EDAboard.com | EDAboard.eu | EDAboard.de | EDAboard.co.uk | RTV forum PL | NewsGroups PL

Q on "average"

Ask a question - edaboard.com

elektroda.net NewsGroups Forum Index - Electronics Design - Q on "average"

Goto page 1, 2  Next

Robert Baer
Guest

Tue Jan 17, 2012 10:57 am   



Keywords: average, mean, RMS.
Take N samples of a "noisy" level.
Typical scheme seems to be sum(readings)/N.
Now, let N be odd, then sort the data and pick the middle value.
A minimum seems to be 7 but i prefer 11 as a minimum sample count.

A few outliers have little effect on the result - no matter how
outrageous they are; cannot say the same for any of the other methods.

Is there any test or paper that supports this oddball scheme?

Don Y
Guest

Tue Jan 17, 2012 11:13 am   



Hi Robert

On 1/17/2012 2:57 AM, Robert Baer wrote:
Quote:
Keywords: average, mean, RMS.
Take N samples of a "noisy" level.
Typical scheme seems to be sum(readings)/N.
Now, let N be odd, then sort the data and pick the middle value.
A minimum seems to be 7 but i prefer 11 as a minimum sample count.

A few outliers have little effect on the result - no matter how
outrageous they are; cannot say the same for any of the other methods.

Is there any test or paper that supports this oddball scheme?

"median"

Martin Brown
Guest

Tue Jan 17, 2012 11:37 am   



Robert Baer wrote:
Quote:
Keywords: average, mean, RMS.
Take N samples of a "noisy" level.
Typical scheme seems to be sum(readings)/N.
Now, let N be odd, then sort the data and pick the middle value.
A minimum seems to be 7 but i prefer 11 as a minimum sample count.

A few outliers have little effect on the result - no matter how
outrageous they are; cannot say the same for any of the other methods.

Is there any test or paper that supports this oddball scheme?

It is called the median and predates the mean as an estimator.

Modern analytical solutions solve it as minimum L1-Norm as opposed to
the "normal" approach of least squares which is minimum L2-Norm.

Try Numerical Recipes p699 http://apps.nrbook.com/c/index.html

These methods are usually known as robust estimators.

Regards,
Martin Brown

Tim Williams
Guest

Tue Jan 17, 2012 2:40 pm   



Open up PaintShop, load a picture and select median (smoothing,
edge-finding, noise rejecting, etc.) filter. If desired, add noise to the
image first to observe the difference.

It provides better smoothing than a linear filtering process (the typical
image filter is a couple-pixel-wide FIR), but leaves the image with a
somewhat surreal, cartoony character, due to the way the color changes.

Tim

--
Deep Friar: a very philosophical monk.
Website: http://webpages.charter.net/dawill/tmoranwms

"Robert Baer" <robertbaer_at_localnet.com> wrote in message
news:z7ydnVdXpa6k24jSnZ2dnUVZ_oudnZ2d_at_posted.localnet...
Quote:
Keywords: average, mean, RMS.
Take N samples of a "noisy" level.
Typical scheme seems to be sum(readings)/N.
Now, let N be odd, then sort the data and pick the middle value.
A minimum seems to be 7 but i prefer 11 as a minimum sample count.

A few outliers have little effect on the result - no matter how
outrageous they are; cannot say the same for any of the other methods.

Is there any test or paper that supports this oddball scheme?


John Larkin
Guest

Tue Jan 17, 2012 5:27 pm   



On Tue, 17 Jan 2012 01:57:54 -0800, Robert Baer
<robertbaer_at_localnet.com> wrote:

Quote:
Keywords: average, mean, RMS.
Take N samples of a "noisy" level.
Typical scheme seems to be sum(readings)/N.
Now, let N be odd, then sort the data and pick the middle value.
A minimum seems to be 7 but i prefer 11 as a minimum sample count.

A few outliers have little effect on the result - no matter how
outrageous they are; cannot say the same for any of the other methods.

Is there any test or paper that supports this oddball scheme?

Try it on a square wave.

John

Tim Wescott
Guest

Tue Jan 17, 2012 6:36 pm   



On Tue, 17 Jan 2012 08:27:44 -0800, John Larkin wrote:

Quote:
On Tue, 17 Jan 2012 01:57:54 -0800, Robert Baer
robertbaer_at_localnet.com> wrote:

Keywords: average, mean, RMS.
Take N samples of a "noisy" level.
Typical scheme seems to be sum(readings)/N. Now, let N be odd, then
sort the data and pick the middle value. A minimum seems to be 7 but
i prefer 11 as a minimum sample count.

A few outliers have little effect on the result - no matter how
outrageous they are; cannot say the same for any of the other methods.

Is there any test or paper that supports this oddball scheme?

Try it on a square wave.

John

Robert: it's too bad that you're plonked over here for a few too many
posts directly quoted from right-wing rags that call themselves
"investment newsletters".

Take N samples of a signal whose noise is exactly equal to 99 1% of the
time, and -1 99% of the time.

Do your median scheme.

Do you see a problem?

The nature of the noise dictates the nature of the estimator. As pointed
out, different estimators are good in different circumstances. Averaging
almost always works well for me; it's good in the case of additive noise
with statistics that make it average out to Gaussian. Averaging-with-
outliers-tossed can work well, and, as you've found, median filtering can
work well.

It all depends on the noise.

--
My liberal friends think I'm a conservative kook.
My conservative friends think I'm a liberal kook.
Why am I not happy that they have found common ground?

Tim Wescott, Communications, Control, Circuits & Software
http://www.wescottdesign.com

Fred Bloggs
Guest

Tue Jan 17, 2012 8:53 pm   



On Jan 17, 4:57 am, Robert Baer <robertb...@localnet.com> wrote:
Quote:
   Keywords: average, mean, RMS.
   Take N samples of a "noisy" level.
   Typical scheme seems to be sum(readings)/N.
   Now, let N be odd, then sort the data and pick the middle value.
   A minimum seems to be 7 but i prefer 11 as a minimum sample count.

   A few outliers have little effect on the result - no matter how
outrageous they are; cannot say the same for any of the other methods.

   Is there any test or paper that supports this oddball scheme?

Yes, it is proven by showing that the expected value of the sample
median is equal to the median of the density function underlying the
random variable. In the case where the median is equal to the mean,
you have your result. A small write-up here:
http://www.sjsu.edu/faculty/watkins/samplemedian1.htm , a heuristic
write-up, not the best in the world, but gives you an idea.

Don Y
Guest

Tue Jan 17, 2012 9:40 pm   



Hi Fred,

On 1/17/2012 1:10 PM, Fred Bloggs wrote:
Quote:
On Jan 17, 12:36 pm, Tim Wescott<t...@seemywebsite.com> wrote:
On Tue, 17 Jan 2012 01:57:54 -0800, Robert Baer
robertb...@localnet.com> wrote:

Keywords: average, mean, RMS.
Take N samples of a "noisy" level.
Typical scheme seems to be sum(readings)/N. Now, let N be odd, then
sort the data and pick the middle value. A minimum seems to be 7 but
i prefer 11 as a minimum sample count.

A few outliers have little effect on the result - no matter how
outrageous they are; cannot say the same for any of the other methods.

Is there any test or paper that supports this oddball scheme?

Take N samples of a signal whose noise is exactly equal to 99 1% of the
time, and -1 99% of the time.

Do your median scheme.

Do you see a problem?

The problem is that example has no median.

No, for N >= 1 there is always an average, median, mode, etc.
(though I admit the mode could be ambiguous in some cases!)

The problem is that those may not be good measures of central tendency
for a given population/sample set.

You have to think about what you want the measure to *tell* you.
And, how it can be biased in a population.

E.g., the median home value and average home value in any
particular neighborhood *tend* to be pretty close. (homes
tend to have similar values within a neighborhood... odd to
find 7,000 sq ft palaces alongside 600 sq ft "shacks")

The average salary of people riding a *bus* may closely
correlate with the median of that same population -- on
*some* busses! On others, it may be wildly different!

Fred Bloggs
Guest

Tue Jan 17, 2012 10:10 pm   



On Jan 17, 12:36 pm, Tim Wescott <t...@seemywebsite.com> wrote:
Quote:
On Tue, 17 Jan 2012 08:27:44 -0800, John Larkin wrote:
On Tue, 17 Jan 2012 01:57:54 -0800, Robert Baer
robertb...@localnet.com> wrote:

  Keywords: average, mean, RMS.
  Take N samples of a "noisy" level.
  Typical scheme seems to be sum(readings)/N. Now, let N be odd, then
  sort the data and pick the middle value. A minimum seems to be 7 but
  i prefer 11 as a minimum sample count.

  A few outliers have little effect on the result - no matter how
outrageous they are; cannot say the same for any of the other methods.

  Is there any test or paper that supports this oddball scheme?

Try it on a square wave.

John

Robert: it's too bad that you're plonked over here for a few too many
posts directly quoted from right-wing rags that call themselves
"investment newsletters".

Take N samples of a signal whose noise is exactly equal to 99 1% of the
time, and -1 99% of the time.

Do your median scheme.

Do you see a problem?

The problem is that example has no median.


Robert Baer
Guest

Wed Jan 18, 2012 9:54 am   



Don Y wrote:
Quote:
Hi Robert

On 1/17/2012 2:57 AM, Robert Baer wrote:
Keywords: average, mean, RMS.
Take N samples of a "noisy" level.
Typical scheme seems to be sum(readings)/N.
Now, let N be odd, then sort the data and pick the middle value.
A minimum seems to be 7 but i prefer 11 as a minimum sample count.

A few outliers have little effect on the result - no matter how
outrageous they are; cannot say the same for any of the other methods.

Is there any test or paper that supports this oddball scheme?

"median"
Yes, that is another keyword, and seems to apply in this case.


Martin Brown
Guest

Wed Jan 18, 2012 9:56 am   



Don Y wrote:
Quote:
Hi Fred,

On 1/17/2012 1:10 PM, Fred Bloggs wrote:
On Jan 17, 12:36 pm, Tim Wescott<t...@seemywebsite.com> wrote:
On Tue, 17 Jan 2012 01:57:54 -0800, Robert Baer
robertb...@localnet.com> wrote:

Keywords: average, mean, RMS.
Take N samples of a "noisy" level.
Typical scheme seems to be sum(readings)/N. Now, let N be odd, then
sort the data and pick the middle value. A minimum seems to be 7
but
i prefer 11 as a minimum sample count.

A few outliers have little effect on the result - no matter how
outrageous they are; cannot say the same for any of the other methods.

Is there any test or paper that supports this oddball scheme?

Take N samples of a signal whose noise is exactly equal to 99 1% of the
time, and -1 99% of the time.

Do your median scheme.

Do you see a problem?

The problem is that example has no median.

No, for N >= 1 there is always an average, median, mode, etc.
(though I admit the mode could be ambiguous in some cases!)

The problem is that those may not be good measures of central tendency
for a given population/sample set.

You have to think about what you want the measure to *tell* you.
And, how it can be biased in a population.

One of the relevant ones to electronics is MTBF for a filament lamp.
(and other units subject to infant mortality and limited service life)

Hardly any filament lamps actually fail at their nominal MTBF. A cohort
of a few percent die very quickly soon after being fitted and the rest
tend to live to a ripe old age. If you swap lamps out too soon to avoid
having any in service failures you actually increase the risk of
downtime due to the replacement dying suddenly during its burn in phase.

The average in this case significantly underestimates the working life
of lamps that survive the first few days - the median is usually a far
better estimator where distributions are skewed or subject to outliers.

If you have the set of measured values it is as well to plot the
histogram of their distribution to avoid surprises. Crunching it down to
a single number can easily lead you astray.

Quote:
E.g., the median home value and average home value in any
particular neighborhood *tend* to be pretty close. (homes
tend to have similar values within a neighborhood... odd to
find 7,000 sq ft palaces alongside 600 sq ft "shacks")

The average salary of people riding a *bus* may closely
correlate with the median of that same population -- on
*some* busses! On others, it may be wildly different!

Median and L1-Norm model fitting is generally preferable when the data
are extremely noisy and subject to serious interference and outliers. It
wasn't popular in the past because apart from a handful of special cases
it is much harded to compute. But these days with almost unlimited
computing power on your desktop it is not a real problem.

The L2-Norm (aka least squares fit) tends to be dominated by fitting the
largest values whether or not they are accurate. Pulse counting devices
have systematic errors from dead time at high count rates and so can
warp the calibration of otherwise highly linear instruments.

Regards,
Martin Brown

Robert Baer
Guest

Wed Jan 18, 2012 10:05 am   



Martin Brown wrote:
Quote:
Robert Baer wrote:
Keywords: average, mean, RMS.
Take N samples of a "noisy" level.
Typical scheme seems to be sum(readings)/N.
Now, let N be odd, then sort the data and pick the middle value.
A minimum seems to be 7 but i prefer 11 as a minimum sample count.

A few outliers have little effect on the result - no matter how
outrageous they are; cannot say the same for any of the other methods.

Is there any test or paper that supports this oddball scheme?

It is called the median and predates the mean as an estimator.

Modern analytical solutions solve it as minimum L1-Norm as opposed to
the "normal" approach of least squares which is minimum L2-Norm.

Try Numerical Recipes p699 http://apps.nrbook.com/c/index.html

These methods are usually known as robust estimators.

Regards,
Martin Brown
Rather close to obscene; not fit for reading by virtually anyone.


Robert Baer
Guest

Wed Jan 18, 2012 10:08 am   



Tim Wescott wrote:
Quote:
On Tue, 17 Jan 2012 08:27:44 -0800, John Larkin wrote:

On Tue, 17 Jan 2012 01:57:54 -0800, Robert Baer
robertbaer_at_localnet.com> wrote:

Keywords: average, mean, RMS.
Take N samples of a "noisy" level.
Typical scheme seems to be sum(readings)/N. Now, let N be odd, then
sort the data and pick the middle value. A minimum seems to be 7 but
i prefer 11 as a minimum sample count.

A few outliers have little effect on the result - no matter how
outrageous they are; cannot say the same for any of the other methods.

Is there any test or paper that supports this oddball scheme?
Try it on a square wave.

John

Robert: it's too bad that you're plonked over here for a few too many
posts directly quoted from right-wing rags that call themselves
"investment newsletters".

Take N samples of a signal whose noise is exactly equal to 99 1% of the
time, and -1 99% of the time.

Do your median scheme.

Do you see a problem?

The nature of the noise dictates the nature of the estimator. As pointed
out, different estimators are good in different circumstances. Averaging
almost always works well for me; it's good in the case of additive noise
with statistics that make it average out to Gaussian. Averaging-with-
outliers-tossed can work well, and, as you've found, median filtering can
work well.

It all depends on the noise.

That means i should do a noise study to see how "bad" it is and the

"spectrum" (distribution) as well.

Robert Baer
Guest

Wed Jan 18, 2012 10:11 am   



Fred Bloggs wrote:
Quote:
On Jan 17, 4:57 am, Robert Baer <robertb...@localnet.com> wrote:
Keywords: average, mean, RMS.
Take N samples of a "noisy" level.
Typical scheme seems to be sum(readings)/N.
Now, let N be odd, then sort the data and pick the middle value.
A minimum seems to be 7 but i prefer 11 as a minimum sample count.

A few outliers have little effect on the result - no matter how
outrageous they are; cannot say the same for any of the other methods.

Is there any test or paper that supports this oddball scheme?

Yes, it is proven by showing that the expected value of the sample
median is equal to the median of the density function underlying the
random variable. In the case where the median is equal to the mean,
you have your result. A small write-up here:
http://www.sjsu.edu/faculty/watkins/samplemedian1.htm , a heuristic
write-up, not the best in the world, but gives you an idea.
Thanks.


Fred Bloggs
Guest

Wed Jan 18, 2012 5:20 pm   



On Jan 18, 3:56 am, Martin Brown <|||newspam...@nezumi.demon.co.uk>
wrote:
Quote:
Don Y wrote:
Hi Fred,

On 1/17/2012 1:10 PM, Fred Bloggs wrote:
On Jan 17, 12:36 pm, Tim Wescott<t...@seemywebsite.com>  wrote:
On Tue, 17 Jan 2012 01:57:54 -0800, Robert Baer
robertb...@localnet.com>  wrote:

   Keywords: average, mean, RMS.
   Take N samples of a "noisy" level.
   Typical scheme seems to be sum(readings)/N. Now, let N be odd, then
   sort the data and pick the middle value. A minimum seems to be 7
but
   i prefer 11 as a minimum sample count.

   A few outliers have little effect on the result - no matter how
outrageous they are; cannot say the same for any of the other methods.

   Is there any test or paper that supports this oddball scheme?

Take N samples of a signal whose noise is exactly equal to 99 1% of the
time, and -1 99% of the time.

Do your median scheme.

Do you see a problem?

  The problem is that example has no median.

No, for N >= 1 there is always an average, median, mode, etc.
(though I admit the mode could be ambiguous in some cases!)

The problem is that those may not be good measures of central tendency
for a given population/sample set.

You have to think about what you want the measure to *tell* you.
And, how it can be biased in a population.

One of the relevant ones to electronics is MTBF for a filament lamp.
(and other units subject to infant mortality and limited service life)

Hardly any filament lamps actually fail at their nominal MTBF. A cohort
of a few percent die very quickly soon after being fitted and the rest
tend to live to a ripe old age. If you swap lamps out too soon to avoid
having any in service failures you actually increase the risk of
downtime due to the replacement dying suddenly during its burn in phase.

The average in this case significantly underestimates the working life
of lamps that survive the first few days - the median is usually a far
better estimator where distributions are skewed or subject to outliers.

Not sure if that is really good example because in the case
reliability statistics what you have is a time dependent failure rate
parameter throughout the burn-in phase. In other words, the
distribution itself is changing. Once past the burn-in phase, the
distribution steady-states to a constant failure rate exponential
distribution, in the simplest case, until the wear-out phase wherein
the failure rate becomes time-dependent again, i.e. the distribution
changes once more. The exponential might look skewed, but in the case
of the constant failure rate exponential, the MTBF does coincide with
the 50% point of the cumulative and is therefore also the median. So
RB's technique of using a sample median as an approximation of
population mean is valid and will converge.

Quote:

If you have the set of measured values it is as well to plot the
histogram of their distribution to avoid surprises. Crunching it down to
a single number can easily lead you astray.

E.g., the median home value and average home value in any
particular neighborhood *tend* to be pretty close.  (homes
tend to have similar values within a neighborhood... odd to
find 7,000 sq ft palaces alongside 600 sq ft "shacks")

The average salary of people riding a *bus* may closely
correlate with the median of that same population -- on
*some* busses!  On others, it may be wildly different!

Median and L1-Norm model fitting is generally preferable when the data
are extremely noisy and subject to serious interference and outliers. It
wasn't popular in the past because apart from a handful of special cases
it is much harded to compute. But these days with almost unlimited
computing power on your desktop it is not a real problem.

The L2-Norm (aka least squares fit) tends to be dominated by fitting the
largest values whether or not they are accurate. Pulse counting devices
have systematic errors from dead time at high count rates and so can
warp the calibration of otherwise highly linear instruments.

Regards,
Martin Brown- Hide quoted text -

- Show quoted text -


Goto page 1, 2  Next

elektroda.net NewsGroups Forum Index - Electronics Design - Q on "average"

Ask a question - edaboard.com

Arabic versionBulgarian versionCatalan versionCzech versionDanish versionGerman versionGreek versionEnglish versionSpanish versionFinnish versionFrench versionHindi versionCroatian versionIndonesian versionItalian versionHebrew versionJapanese versionKorean versionLithuanian versionLatvian versionDutch versionNorwegian versionPolish versionPortuguese versionRomanian versionRussian versionSlovak versionSlovenian versionSerbian versionSwedish versionTagalog versionUkrainian versionVietnamese versionChinese version
RTV map EDAboard.com map News map EDAboard.eu map EDAboard.de map EDAboard.co.uk map Opony