# 7.1 Filtering: simple averages

 Page 1 / 1
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.

The simplest numerical filter is the simple averaging filter. This filter is defined by the equation

$x=\frac{1}{N}\sum n=1N{u}_{n}.$

The filter output x is the average of the N filter inputs ${u}_{1},{u}_{2},...$ , u N . These inputs may be real or complex numbers, and x may be real or complex. This simple averaging filter is illustrated in Figure 1 .

If the averaging filter is excited by the constant sequence ${u}_{1}={u}_{2}=\cdots ={u}_{N}=u$ , then the output is

$x=\frac{1}{N}\sum n=1Nu=u.$

The output is, truly, the average of the inputs. Now suppose the filter is excited by the linearly increasing sequence

${u}_{n}=n,n=1,2,...,N.$

This sequence is plotted in Figure 2 . How do we sum such a sequence in order to produce the average $x$ ? For $N$ even, the average may be written as

$x=\frac{1}{N}\left({x}_{1}+{x}_{N}\right)+\frac{1}{N}\left({x}_{2}+{x}_{N-1}\right)+\cdots +\frac{1}{N}\left({x}_{N/2}+{x}_{\left(N/2\right)+1}\right).$

Each pair-sum in parentheses equals $N+1$ , and there are $\frac{N}{2}$ such pair-sums, so the average is

$x=\frac{1}{N}\frac{N}{2}\left(N+1\right)=\frac{N+1}{2}.$

This is certainly a reasonable answer for the average of a linearly increasing sequence. See Figure 2 .

General Sum Formula. Suppose the input to the simple averaging filter is the polynomial sequence

${u}_{n}={n}^{k},n=1,2,...,N$

where $k$ is a non-negative integer such as $k=0,1,2,...$ . The output of the filter is

${x}_{N}^{\left(k\right)}=\frac{1}{N}\sum n=1N{n}^{k}.$

We rewrite $x$ as ${x}_{N}^{\left(k\right)}$ to remind ourselves that we are averaging $N$ numbers, each of which is ${n}^{k}$ . For example, when $N=8$ and $k=2$ ,

${x}_{8}^{\left(2\right)}=\frac{1}{8}\sum n=18{n}^{2}=\frac{1}{8}\left(1+4+9+\cdots +64\right).$

Rather than study the average ${x}_{N}^{\left(k\right)}$ , we will study the sum $N{x}_{N}^{\left(k\right)}$ and divide by $N$ at the very end:

${S}_{N}^{\left(k\right)}=N{x}_{N}^{\left(k\right)}=\sum n=1N{n}^{k}.$

The sum ${S}_{N}^{\left(k\right)}$ may be rewritten as the sum

${S}_{N}^{\left(k\right)}=\sum n=1N-1{n}^{k}+{N}^{k}={S}_{N-1}^{\left(k\right)}+{N}^{k}.$

This result is very important because it tells us that the sum ${S}_{N}^{\left(k\right)}$ , viewed as a function of $N$ , obeys a recursion in which ${S}_{N}^{\left(k\right)}$ is just the sum using one less input, namely, ${S}_{N-1}^{\left(k\right)}$ , plus ${N}^{k}$ . Now, since polynomials are the most general functions that obey such recursions, we know that ${s}_{N}^{\left(k\right)}$ must be a polynomial of order $k+1$ in the variable $N$ :

${s}_{N}^{\left(k\right)}={a}_{0}+{a}_{1}N+{a}_{2}{N}^{2}+\cdots +{a}_{k+1}{N}^{k+1}.$

Let's check to see that this polynomial really can obey the required recursion. First note that ${S}_{N-1}^{\left(k\right)}$ is the following polynomial:

${s}_{N-1}^{\left(k\right)}={a}_{0}+{a}_{1}\left(N-1\right)+\cdots +{a}_{k+1}{\left(N-1\right)}^{k+1}.$

The term ${\left(N-1\right)}^{k+1}$ produces ${\left(}_{0}^{k+1}\right){N}^{k+1}{\left(-1\right)}^{0}+{\left(}_{1}^{k+1}\right){N}^{k}{\left(-1\right)}^{1}+\cdots$ . (Remember the binomial expansion?) Therefore the difference between ${S}_{N}^{\left(k\right)}$ and ${S}_{N-1}^{\left(k\right)}$ is

${S}_{N}^{\left(k\right)}-{S}_{N-1}^{\left(k\right)}={c}_{0}+{c}_{1}N+\cdots +{c}_{k}{N}^{k}.$

This recursion is general enough to produce the difference N k provided we can solve for ${a}_{0},{a}_{1},...$ , ${a}_{k+1}$ to make ${c}_{0}={c}_{1}=\cdots ={c}_{k-1}=0$ and ${c}_{k}=1$ . We know that ${S}_{N}^{\left(k\right)}=0$ for $N=0$ , so we know that ${a}_{0}=0$ , meaning that the polynomial for ${S}_{N}^{\left(k\right)}$ can really be written as

${S}_{N}^{\left(k\right)}={a}_{1}N+{a}_{2}{N}^{2}+\cdots +{a}_{k+1}{N}^{k+1}.$

In order to solve for the coefficients of this polynomial, we propose to write out our equationfor ${s}_{N}^{\left(k\right)}$ as follows:

$\left(N=1\right){S}_{1}^{\left(k\right)}={a}_{1}+\cdots +{a}_{k+1}\left(N=2\right){S}_{2}^{\left(k\right)}=2{a}_{1}+\cdots +{2}^{k+1}{a}_{k+1}\left(N=3\right){s}_{3}^{\left(k\right)}=3{a}_{1}+\cdots +{3}^{k+1}{a}_{k+1}⋮⋮\left(N=k\right){S}_{k}^{\left(k\right)}=k{a}_{1}+\cdots +{k}^{k+1}{a}_{k+1}\left(N=k+1\right){S}_{k+1}^{\left(k\right)}=\left(k+1\right){a}_{1}+\cdots +{\left(k+1\right)}^{k+1}{a}_{k+1}.$

Using the linear algebra we learned earlier, we may write these equations as the matrix equation

$l1...124...{2}^{k+1}⋮⋮⋮k{k}^{2}...{k}^{k+1}\left(k+1\right){\left(k+1\right)}^{2}...{\left(k+1\right)}^{k+1}{a}_{1}{a}_{2}⋮{a}_{k+1}={s}_{1}^{\left(k\right)}{S}_{2}^{\left(k\right)}⋮{S}_{k+1}^{\left(k\right)}.$

The terms on the right-hand side of the equal sign are “initial conditions” that tell us how the sum ${S}_{N}^{\left(k\right)}$ begins for $N=1,2,...,k+1$ . These initial conditions must be computed directly. (For example, ${S}_{2}^{\left(k\right)}={1}^{k}+{2}^{k}.$ ) Then the linear system of $\left(k+1\right)$ equations in $\left(k+1\right)$ unknowns may be solved for ${a}_{1},{a}_{2},...,{a}_{k+1}$ . The solution for ${S}_{N}^{k}$ is then complete, and we may use it to solve for ${S}_{N}^{k}$ for arbitrary $N$ .

When $k=2$ , we have the following equation for the coefficients ${a}_{1},{a}_{2}$ , and ${a}_{3}$ in the polynomial ${S}_{N}^{\left(2\right)}={a}_{1}N+{a}_{2}{N}^{2}+{a}_{3}{N}^{3}$ :

$1112483927{a}_{1}{a}_{2}{a}_{3}={1}^{2}{1}^{2}+{2}^{2}{1}^{2}+{2}^{2}+{3}^{2}=1514·$

Exponential Sums. When the input to an averaging filter is the sequence

${u}_{n}={a}^{n},n=0,1,2,...,N-1,$

we say that the input is exponential (or geometric). Typical sequences are illustrated in Figure 6.5 for $a=0.9,a=1$ , and $a=1.1$ . Don't let it throw you that we have changed the index to run from 0 to $N-1$ rather than from 1 to $N$ . This change is not fundamentally important, but it simplifies our study. The sum of the inputs is

${S}_{N}=\sum n=0N-1{a}^{n}.$

How do we evaluate this sum? Well, we note that the sum $a{S}_{N}$ is

$a{S}_{N}=\sum n=0N-1{a}^{n+1}=\sum k=1N{a}^{k}=\sum k=0N-1{a}_{k}+{a}^{N}-1={S}_{N}+{a}^{N}-1.$

Therefore, provided $a\ne 1$ , the sum ${S}_{N}$ is

${S}_{N}=\frac{1-{a}^{N}}{1-a},a\ne 1.$

This formula, discovered already in the chapter covering the functions ${e}^{x}$ and ${e}^{j\theta }$ , works for $a\ne 1$ . When $a=1$ , then ${S}_{N}=N$ :

${S}_{N}=\frac{1-{a}^{N}}{1-a},a\ne 1N,a=1.$

When $|a|<1$ , then ${a}^{N}\to 0$ for $N\to \infty$ , and we have the asymptotic formula

$\underset{N\to \infty }{lim}{S}_{N}=\frac{1}{1-a}\text{,}|a|<1.$

Recursive Computation. Every sum of the form

${S}_{N}=\sum n=0N-1{u}_{n}$

obeys the recursion

${S}_{N}={S}_{N-1}+{u}_{N-1}.$

This means that when summing numbers you may “use them and discard them.” That is, you do not need to read them, store them, and sum them.

You may read ${u}_{0}$ to form ${S}_{1}$ and discard ${u}_{0}$ ; add ${u}_{1}$ to ${S}_{1}$ and discard ${u}_{1}$ ; add ${u}_{2}$ to ${S}_{2}$ ; and continue.

This is very important for hardware and software implementations of running sums. You need only store the current sum, not the measurements that produced it. Two illustrations of the recursion ${S}_{n+1}={S}_{n}+{u}_{n}$ are provided in Figure 4 . The diagram on the left is self-explanatory. The diagram on the right says that the sum ${S}_{n}$ is stored in a memory location, to be added to ${u}_{n}$ to produce ${S}_{n+1}$ , which is then stored back in the memory location to be added to ${u}_{n+1}$ , and so on.

so some one know about replacing silicon atom with phosphorous in semiconductors device?
how to fabricate graphene ink ?
for screen printed electrodes ?
SUYASH
What is lattice structure?
of graphene you mean?
Ebrahim
or in general
Ebrahim
in general
s.
Graphene has a hexagonal structure
tahir
On having this app for quite a bit time, Haven't realised there's a chat room in it.
Cied
what is biological synthesis of nanoparticles
what's the easiest and fastest way to the synthesize AgNP?
China
Cied
types of nano material
I start with an easy one. carbon nanotubes woven into a long filament like a string
Porter
many many of nanotubes
Porter
what is the k.e before it land
Yasmin
what is the function of carbon nanotubes?
Cesar
I'm interested in nanotube
Uday
what is nanomaterials​ and their applications of sensors.
what is nano technology
what is system testing?
preparation of nanomaterial
Yes, Nanotechnology has a very fast field of applications and their is always something new to do with it...
what is system testing
what is the application of nanotechnology?
Stotaw
In this morden time nanotechnology used in many field . 1-Electronics-manufacturad IC ,RAM,MRAM,solar panel etc 2-Helth and Medical-Nanomedicine,Drug Dilivery for cancer treatment etc 3- Atomobile -MEMS, Coating on car etc. and may other field for details you can check at Google
Azam
anybody can imagine what will be happen after 100 years from now in nano tech world
Prasenjit
after 100 year this will be not nanotechnology maybe this technology name will be change . maybe aftet 100 year . we work on electron lable practically about its properties and behaviour by the different instruments
Azam
name doesn't matter , whatever it will be change... I'm taking about effect on circumstances of the microscopic world
Prasenjit
how hard could it be to apply nanotechnology against viral infections such HIV or Ebola?
Damian
silver nanoparticles could handle the job?
Damian
not now but maybe in future only AgNP maybe any other nanomaterials
Azam
Hello
Uday
I'm interested in Nanotube
Uday
this technology will not going on for the long time , so I'm thinking about femtotechnology 10^-15
Prasenjit
can nanotechnology change the direction of the face of the world
At high concentrations (>0.01 M), the relation between absorptivity coefficient and absorbance is no longer linear. This is due to the electrostatic interactions between the quantum dots in close proximity. If the concentration of the solution is high, another effect that is seen is the scattering of light from the large number of quantum dots. This assumption only works at low concentrations of the analyte. Presence of stray light.
the Beer law works very well for dilute solutions but fails for very high concentrations. why?
how did you get the value of 2000N.What calculations are needed to arrive at it
Privacy Information Security Software Version 1.1a
Good
Got questions? Join the online conversation and get instant answers!