In digital signal processing applications,
it is often necessary to change the relative amplitudes
of frequency components or remove undesired frequencies of
a signal.
This process is called filtering.
Digital filters are used in a variety of applications.
In Laboratory 4, we saw that digital filters
may be used in systems that perform interpolation and decimation
on discretetime signals.
Digital filters are also used in audio systems
that allow the listener to adjust the bass (lowfrequency energy)
and the treble (high frequency energy) of audio signals.
Digital filter design requires the use of both frequency domain
and time domain techniques.
This is because filter design specifications are often given
in the frequency domain, but filters are usually implemented
in the time domain with a difference equation.
Typically, frequency domain analysis is done using the Ztransform and
the discretetime Fourier Transform (DTFT).
In general, a linear and timeinvariant causal digital filter
with input x(n)x(n) and
output y(n)y(n) may be specified by its difference equation
y
(
n
)
=
∑
i
=
0
N

1
b
i
x
(
n

i
)

∑
k
=
1
M
a
k
y
(
n

k
)
y
(
n
)
=
∑
i
=
0
N

1
b
i
x
(
n

i
)

∑
k
=
1
M
a
k
y
(
n

k
)
(1)where bibi and akak are coefficients which parameterize
the filter. This filter is said to have NN zeros and MM poles.
Each new value of the output signal, y(n)y(n), is determined
by past values of the output, and by present and past values
of the input.
The impulse response, h(n)h(n), is the response of the filter
to an input of δ(n)δ(n), and is therefore the
solution to the recursive difference equation
h
(
n
)
=
∑
i
=
0
N

1
b
i
δ
(
n

i
)

∑
k
=
1
M
a
k
h
(
n

k
)
.
h
(
n
)
=
∑
i
=
0
N

1
b
i
δ
(
n

i
)

∑
k
=
1
M
a
k
h
(
n

k
)
.
(2)There are two general classes of digital filters:
infinite impulse response (IIR) and finite impulse response (FIR).
The FIR case occurs when ak=0ak=0, for all kk. Such a filter is said
to have no poles, only zeros.
In this case, the difference equation in Equation 2
becomes
h
(
n
)
=
∑
i
=
0
N

1
b
i
δ
(
n

i
)
.
h
(
n
)
=
∑
i
=
0
N

1
b
i
δ
(
n

i
)
.
(3)Since Equation 3 is no longer recursive,
the impulse response has finite duration NN.
In the case where ak≠0ak≠0, the difference equation
usually represents an IIR filter.
In this case, Equation 2
will usually generate an impulse response which has nonzero
values as n→∞n→∞.
However, later we will see that for certain values
of ak≠0ak≠0 and bibi, it is possible
to generate an FIR filter response.
The Ztransform is the major tool used for analyzing
the frequency response of filters and their difference
equations.
The Ztransform of a discretetime signal, x(n)x(n), is given by
X
(
z
)
=
∑
n
=

∞
∞
x
(
n
)
z

n
.
X
(
z
)
=
∑
n
=

∞
∞
x
(
n
)
z

n
.
(4)where zz is a complex variable.
The DTFT may be thought of as a special case of the Ztransform
where zz is evaluated on the unit circle in the complex plane.
X
(
e
j
ω
)
=
X
(
z
)
z
=
e
j
ω
=
∑
n
=

∞
∞
x
(
n
)
e

j
ω
n
X
(
e
j
ω
)
=
X
(
z
)
z
=
e
j
ω
=
∑
n
=

∞
∞
x
(
n
)
e

j
ω
n
(5)From the definition of the Ztransform, a change of variable
m=nKm=nK shows
that a delay of KK samples in the time domain is equivalent to
multiplication by zKzK in the Ztransform domain.
x
(
n

K
)
↔
Z
∑
n
=

∞
∞
x
(
n

K
)
z

n
=
∑
m
=

∞
∞
x
(
m
)
z

(
m
+
K
)
=
z

K
∑
m
=

∞
∞
x
(
m
)
z

m
=
z

K
X
(
z
)
x
(
n

K
)
↔
Z
∑
n
=

∞
∞
x
(
n

K
)
z

n
=
∑
m
=

∞
∞
x
(
m
)
z

(
m
+
K
)
=
z

K
∑
m
=

∞
∞
x
(
m
)
z

m
=
z

K
X
(
z
)
(6)We may use this fact to rewrite Equation 1 in
the Ztransform domain, by taking Ztransforms of both sides of
the equation:
Y
(
z
)
=
∑
i
=
0
N

1
b
i
z

i
X
(
z
)

∑
k
=
1
M
a
k
z

k
Y
(
z
)
Y
(
z
)
1
+
∑
k
=
1
M
a
k
z

k
=
X
(
z
)
∑
i
=
0
N

1
b
i
z

i
H
(
z
)
=
△
Y
(
z
)
X
(
z
)
=
∑
i
=
0
N

1
b
i
z

i
1
+
∑
k
=
1
M
a
k
z

k
Y
(
z
)
=
∑
i
=
0
N

1
b
i
z

i
X
(
z
)

∑
k
=
1
M
a
k
z

k
Y
(
z
)
Y
(
z
)
1
+
∑
k
=
1
M
a
k
z

k
=
X
(
z
)
∑
i
=
0
N

1
b
i
z

i
H
(
z
)
=
△
Y
(
z
)
X
(
z
)
=
∑
i
=
0
N

1
b
i
z

i
1
+
∑
k
=
1
M
a
k
z

k
(7)From this formula, we see that any filter which can be represented
by a linear difference equation with constant coefficients
has a rational transfer function
(i.e. a transfer function which is a ratio of polynomials).
From this result, we may compute the frequency response
of the filter by evaluating H(z)H(z) on the unit circle:
H
(
e
j
ω
)
=
∑
i
=
0
N

1
b
i
e

j
ω
i
1
+
∑
k
=
1
M
a
k
e

j
ω
k
.
H
(
e
j
ω
)
=
∑
i
=
0
N

1
b
i
e

j
ω
i
1
+
∑
k
=
1
M
a
k
e

j
ω
k
.
(8)There are many different methods for implementing a general
recursive difference equation of the form Equation 1.
Depending on the application, some methods may be more robust
to quantization error, require fewer multiplies or adds,
or require less memory.
Figure 1 shows a system diagram known
as the direct form implementation; it works for any discretetime filter
described by the difference equation in Equation 1.
Note that the boxes containing the symbol z1z1 represent unit delays, while a parameter written next to a signal path
represents multiplication by that parameter.