Skip to content Skip to navigation Skip to collection information

OpenStax-CNX

You are here: Home » Content » A First Course in Electrical and Computer Engineering » Filtering: Exponential Averages and Recursive Filters

Navigation

Table of Contents

Lenses

What is a lens?

Definition of a lens

Lenses

A lens is a custom view of the content in the repository. You can think of it as a fancy kind of list that will let you see content through the eyes of organizations and people you trust.

What is in a lens?

Lens makers point to materials (modules and collections), creating a guide that includes their own comments and descriptive tags about the content.

Who can create a lens?

Any individual member, a community, or a respected organization.

What are tags? tag icon

Tags are descriptors added by lens makers to help label content, attaching a vocabulary that is meaningful in the context of the lens.

This content is ...

Endorsed by Endorsed (What does "Endorsed by" mean?)

This content has been endorsed by the organizations listed. Click each link for a list of all content endorsed by the organization.
  • IEEE-SPS

    This collection is included inLens: IEEE Signal Processing Society Lens
    By: IEEE Signal Processing Society

    Click the "IEEE-SPS" link to see all content they endorse.

  • College Open Textbooks display tagshide tags

    This collection is included inLens: Community College Open Textbook Collaborative
    By: CC Open Textbook Collaborative

    Comments:

    "Reviewer's Comments: 'I recommend this book as a "required primary textbook." This text attempts to lower the barriers for students that take courses such as Principles of Electrical Engineering, […]"

    Click the "College Open Textbooks" link to see all content they endorse.

    Click the tag icon tag icon to display tags associated with this content.

Affiliated with (What does "Affiliated with" mean?)

This content is either by members of the organizations listed or about topics related to the organizations listed. Click each link to see a list of all content affiliated with the organization.
  • Bookshare

    This collection is included inLens: Bookshare's Lens
    By: Bookshare - A Benetech Initiative

    Comments:

    "Accessible versions of this collection are available at Bookshare. DAISY and BRF provided."

    Click the "Bookshare" link to see all content affiliated with them.

  • NSF Partnership display tagshide tags

    This collection is included inLens: NSF Partnership in Signal Processing
    By: Sidney Burrus

    Click the "NSF Partnership" link to see all content affiliated with them.

    Click the tag icon tag icon to display tags associated with this content.

  • Featured Content display tagshide tags

    This collection is included inLens: Connexions Featured Content
    By: Connexions

    Comments:

    "A First Course in Electrical and Computer Engineering provides readers with a comprehensive, introductory look at the world of electrical engineering. It was originally written by Louis Scharf […]"

    Click the "Featured Content" link to see all content affiliated with them.

    Click the tag icon tag icon to display tags associated with this content.

Also in these lenses

  • UniqU content

    This collection is included inLens: UniqU's lens
    By: UniqU, LLC

    Click the "UniqU content" link to see all content selected in this lens.

  • Evowl

    This collection is included inLens: Rice LMS's Lens
    By: Rice LMS

    Comments:

    "Language: en"

    Click the "Evowl" link to see all content selected in this lens.

  • Lens for Engineering

    This module and collection are included inLens: Lens for Engineering
    By: Sidney Burrus

    Click the "Lens for Engineering" link to see all content selected in this lens.

Recently Viewed

This feature requires Javascript to be enabled.

Tags

(What is a tag?)

These tags come from the endorsement, affiliation, and other lenses that include this content.
 

Filtering: Exponential Averages and Recursive Filters

Module by: Louis Scharf. E-mail the author

Note:

This module is part of the collection, A First Course in Electrical and Computer Engineering. The LaTeX source files for this collection were created using an optical character recognition technology, and because of this process there may be more errors than usual. Please contact us if you discover any errors.

Suppose we try to extend our method for computing finite moving averages to infinite moving averages of the form

x n = k = 0 w k u n - k = w 0 u n + w 1 u n - 1 + + w 1000 u n - 1000 + x n = k = 0 w k u n - k = w 0 u n + w 1 u n - 1 + + w 1000 u n - 1000 +
(1)

In general, this moving average would require infinite memory for the weighting coefficients w0,w1,...w0,w1,... and for the inputs un,un-1,...un,un-1,.... Furthermore, the hardware for multiplying wkun-kwkun-k would have to be infinitely fast to compute the infinite moving average in finite time. All of this is clearly fanciful and implausible (not to mention impossible). But what if the weights take the exponential form

w k = 0 , k < 0 w 0 a k , k 0 ? w k = 0 , k < 0 w 0 a k , k 0 ?
(2)

Does any simplification result? There is hope because the weighting sequence obeys the recursion

w k = 0 , k < 0 w 0 , k = 0 a w k - 1 k 1 . w k = 0 , k < 0 w 0 , k = 0 a w k - 1 k 1 .
(3)

This recursion may be rewritten as follows, for k1k1:

wk-awk-1=0,k1.wk-awk-1=0,k1.
(4)

Let's now manipulate the infinite moving average and use the recursion for the weights to see what happens. You must follow every step:

x n = k = 0 w k u n - k = k = 1 w k u n - k + w 0 u n = k = 1 a w k - 1 u n - k + w 0 u n = a m = 0 w m u n - 1 - m + w 0 u n = a x n - 1 + w 0 u n . x n = k = 0 w k u n - k = k = 1 w k u n - k + w 0 u n = k = 1 a w k - 1 u n - k + w 0 u n = a m = 0 w m u n - 1 - m + w 0 u n = a x n - 1 + w 0 u n .
(5)

This result is fundamentally important because it says that the output of the infinite exponential moving average may be computed by scaling the previous output xn-1xn-1 by the constant a, scaling the new input u n u n by w 0 w 0 , and adding. Only three memory locations must be allocated: one for w 0 w 0 , one for a a, and one for xn-1xn-1. Only two multiplies must be implemented: one for axn-1axn-1 and one for w0unw0un. A diagram of the recursion is given in Figure 1. In this recursion, the old value of the exponential moving average, xn-1xn-1, is scaled by a a and added to w0unw0un to produce the new exponential moving average x n x n . This new value is stored in memory, where it becomes xn-1xn-1 in the next step of the recursion, and so on.

Figure 1: Recursive Implementation of an Exponential Moving Average
This diagram is a series of arrows and figures. On the far left there is the expression U_n with an arrow pointing to the right. This arrow ends and above the point of this arrow is the expression W_0. Another arrow proceeds to the right of the previous arrows points. This arrow ends at a circle containing a plus. A line extends to the right of the cirle and above this line is the expression X_n This line ends at a rectangle containg the word memory. Another line extends to the right ending in an arrow point pointing at the expression X_(n-1). Halfway along this last line and another line extends down perpendicularly and then turns at a right angle to the left. This line has an arrow point halfway along its path and about the arrow point is the expression alpha. The line continues after this arrow point and has another right angle so the that the arrow now points up and ends at the circle containing the plus.

Exercise 1

Try to extend the recursion of the previous paragraphs to the weighted average

x n = k = 0 N - 1 a k u n - k . x n = k = 0 N - 1 a k u n - k .
(6)

What goes wrong?

Exercise 2

Compute the output of the exponential moving average xn=xn=axn-1+w0unaxn-1+w0un when the input is

u n = 0 , n < 0 u , n 0 . u n = 0 , n < 0 u , n 0 .
(7)

Plot your result versus n n.

Exercise 3

Compute w 0 w 0 in the exponential weighting sequence

w n = 0 , n < 0 a n w 0 , n 0 w n = 0 , n < 0 a n w 0 , n 0
(8)

to make the weighting sequence a valid window. (This is a special case of Exercise 3 from Filtering: Moving Averages.) Assume -1<a<1-1<a<1

Collection Navigation

Content actions

Download:

Collection as:

PDF | EPUB (?)

What is an EPUB file?

EPUB is an electronic book format that can be read on a variety of mobile devices.

Downloading to a reading device

For detailed instructions on how to download this content's EPUB to your specific device, click the "(?)" link.

| More downloads ...

Module as:

PDF | More downloads ...

Add:

Collection to:

My Favorites (?)

'My Favorites' is a special kind of lens which you can use to bookmark modules and collections. 'My Favorites' can only be seen by you, and collections saved in 'My Favorites' can remember the last module you were on. You need an account to use 'My Favorites'.

| A lens I own (?)

Definition of a lens

Lenses

A lens is a custom view of the content in the repository. You can think of it as a fancy kind of list that will let you see content through the eyes of organizations and people you trust.

What is in a lens?

Lens makers point to materials (modules and collections), creating a guide that includes their own comments and descriptive tags about the content.

Who can create a lens?

Any individual member, a community, or a respected organization.

What are tags? tag icon

Tags are descriptors added by lens makers to help label content, attaching a vocabulary that is meaningful in the context of the lens.

| External bookmarks

Module to:

My Favorites (?)

'My Favorites' is a special kind of lens which you can use to bookmark modules and collections. 'My Favorites' can only be seen by you, and collections saved in 'My Favorites' can remember the last module you were on. You need an account to use 'My Favorites'.

| A lens I own (?)

Definition of a lens

Lenses

A lens is a custom view of the content in the repository. You can think of it as a fancy kind of list that will let you see content through the eyes of organizations and people you trust.

What is in a lens?

Lens makers point to materials (modules and collections), creating a guide that includes their own comments and descriptive tags about the content.

Who can create a lens?

Any individual member, a community, or a respected organization.

What are tags? tag icon

Tags are descriptors added by lens makers to help label content, attaching a vocabulary that is meaningful in the context of the lens.

| External bookmarks