Searching \ for '[OT]: - Who is awake?' in subject line. ()
Make payments with PayPal - it's fast, free and secure! Help us get a faster server
FAQ page: www.piclist.com/techref/index.htm?key=who+awake
Search entire site for: '- Who is awake?'.

Exact match. Not showing close matches.
PICList Thread
'[OT]: - Who is awake?'
2000\06\14@194727 by Plunkett, Dennis

flavicon
face
15/6/2000

<flame suite on>
A short time ago there was a thread on filters, and a suggestion for a long
term averaging filter was proposed that went along the lines of:-

       average = (((temp*width)-average)+newsample)/width


And to my surprise no one that I can recall picked up on this little "gem" I
thought that perhaps Paul, or Sean would have been chafing at the bit to go
at this.

1/ This filter assumes that the processor is a floating point
2/ The filter is great for downward changing signals only, as an upward
change will not be reflected until the delta is greater than the width
3/ The impulse response is dependant on the width
etc.

<suit off>

Dennis

2000\06\14@200204 by Mark Willis

flavicon
face
Plunkett, Dennis wrote:
> 15/6/2000
>
> <flame suite on>
> A short time ago there was a thread on filters, and a suggestion for a long
> term averaging filter was proposed that went along the lines of:-
>
>         average = (((temp*width)-average)+newsample)/width
>
> And to my surprise no one that I can recall picked up on this little "gem" I
> thought that perhaps Paul, or Sean would have been chafing at the bit to go
> at this.
>
> 1/ This filter assumes that the processor is a floating point

Not initially obviously so to me!
Most of us would set width = a power of 2 (4, 8, 16, etc.) and integer &
shift ops would do this just fine, right?  You'd have to use extra width
(i.e. say 24-bit math in the ((temp*width)-average)+newsample part, for
16-bit newsample values - roundoff is a problem here, sure, so you'd
have a remainders accumulator, if you thought about it - how's an FP
processor necessary when you can do it all with shifts and an
accumulator?  FP's not that hard to do in software <G>

> 2/ The filter is great for downward changing signals only, as an upward
> change will not be reflected until the delta is greater than the width

Not so with the accumulator, it solves that (you'd get a little
bounciness of the output due to accumulator filling up so some
hysteresis might be good - FOR the proper design needs.  DEPENDS on what
you're doing.  (Don't mistake the equation for the implementation in
software <G>)

> 3/ The impulse response is dependant on the width

True - Preloading, etc. are already in most people who use digital
filters' minds, though, I hope?

>  etc.
>
> <suit off>
>
> Dennis

 Mark

2000\06\14@204151 by Scott Dattalo

face
flavicon
face
On Thu, 15 Jun 2000, Plunkett, Dennis wrote:

> 15/6/2000
>
> <flame suite on>
> A short time ago there was a thread on filters, and a suggestion for a long
> term averaging filter was proposed that went along the lines of:-
>
>         average = (((temp*width)-average)+newsample)/width

I don't recall seeing THIS one. Are you sure this is correct? As it is written
it makes no sense. For a simple example, suppose temp=0 and newsample=0. This
reduces the equation to:

  average = -average/width

? This is an exponentially decaying sinusoid.

Why don't you take off the Flame Suit and give us the real equation?

If I had to take a stab at it, I'd guess you really meant to write:

avg = (avg*K1 - K2 + newsample*K3)/width

When we last discussed filters, the equation was of this form with:

K2 = 0
K1 + K3 = width

I suppose we could generalize this to:

K1 - K2 + K3 = width

Is this what you were thinking about?

Scott

{Quote hidden}

More... (looser matching)
- Last day of these posts
- In 2000 , 2001 only
- Today
- New search...