The time window of *y*[*n*] in equation
(3.1) is very short (4 samples), so its effects are very local. To
smooth over a larger slice of the signal, we can do two things:

a) increase
the
number of samples in *x*[*n*] ... *x* [*n*-*m*]
in the formula for
*y*[*n*].

b) make *y*[*n*] depend in part on its own previous
value (*y*[*n*-1]) or several previous values.

A filter of the second kind has the general form:

(3.2) y[n]
= b_{
0}x[n] |
+ b_{1} x[
n-1]
+ b_{2} x[n
-1] + ...
+ b _{k}x[n
- k]
- a_{1} y[n-1]
+
.... + a _{j}y[n-j] |

(In the moving average example, *b*_{0}
= *b*_{1} = *b*_{
2} = *b*_{3} = 0.25
and all
*a _{n}*
= 0).

This kind of filter is called an **IIR Filter**. (IIR stands for
*Infinite
Impulse Response*. Sometimes they are called **recursive**
filters.)
If all *a _{n}* = 0 (i.e. if previous
values of

By varying the *a*'s, *b*'s, and the number and spacing of
previous *x* and *y* samples, a variety of filters with
various
kinds of frequencyselecting behaviours can be constructed. It is requires
some rather advanced mathematics to calculate what the *a*'s and *b*
's have to be to filter out a desired range of frequencies (we shall see
an example shortly). Alternatively, you can get the values from tables:
click here
for low-pass
filter
coeffients , or here
for high-pass
filter
coefficients .