06 Tanal
06 Tanal
Y (z) = H(z)X(z),
where H(z) is the system function, or the z-transform of the system impulse
response.
Recall that a LTI system is completely characterised by its impulse response,
or equivalently, its system function.
The frequency response H(ejω ) of a system is defined as the gain that the
system applies to the complex exponential input ejωn . The Fourier transforms
of the system input and output are therefore related by
1
1.1 Ideal frequency-selective filters
1
|H(ejω )|
−π ωc 0 ωc π
ω
π
∢H(ejω )
−π
−π ωc 0 ωc π
ω
This response, as for all discrete-time signals, is periodic with period 2π. Its
impulse response (for −∞ < n < ∞) is
Z ωc ωc
1 1 1
hlp [n] = ejωn dω = ejωn
2π −ωc 2π jn −ωc
1 1 jωc n sin(ωc n)
= (e − e−jωc n ) = ,
πn 2j πn
which for ωc = π/4 is
2
0.3
0.2
hlp [n] 0.1
−0.1
−20 −15 −10 −5 0 5 10 15 20
n
The ideal lowpass filter is noncausal, and its impulse response extends from
−∞ < n < ∞. The system is therefore not computationally realisable. Also,
the phase response of the ideal lowpass filter is specified to be zero — this is a
problem in that causal ideal filters have nonzero phase responses.
The ideal highpass filter is
0 |ω| ≤ ωc
Hhp (ejω ) =
1 ωc < |ω| ≤ π.
3
The magnitude and phase of this response are
|Hid (ejω )| = 1,
∢Hid (ejω ) = −ωnd , |ω| < π.
The phase distortion of the ideal delay is therefore a linear function of ω. This
is considered to be a rather mild (and therefore acceptable) form of phase
distortion, since the only effect is to shift the sequence in time. In other words,
a filter with linear phase response can be viewed as a cascade of a zero-phase
filter, followed by a time shift or delay.
In designing approximations to ideal filters, we are therefore frequently willing
to accept linear phase distortion. The ideal lowpass filter with phase distortion
would be defined as
e−jωnd |ω| ≤ ωc
jω
Hlp (e ) =
0 ωc < |ω| ≤ π,
4
system is therefore defined as
d
τ (ω) = grd[H(ejω )] = − arg[H(ejω )] .
dω
The deviation of the group delay away from a constant indicates the degree of
nonlinearity of the phase. Note that the phase here must be considered as a
continuous function of ω.
or equivalently
N M
! !
X X
ak z −k Y (z) = bk z −k X(z).
k=0 k=0
The system function for a system that satisfies a difference equation of the
required form is therefore
PM QM
Y (z) k=0 bk z b0 k=1 (1 − ck z )
−k −1
H(z) = = PN = N
.
X(z) a
Q
k=0 ak z −k 0 k=1 (1 − dk z −1 )
5
Each factor (1 − ck z −1 ) in the numerator contributes a zero at z = ck and a
pole at z = 0. Each factor (1 − dk z −1 ) contributes a zero at z = 0 and a pole
at z = dk .
The difference equation and the algebraic expression for the system function
are equivalent, as demonstrated by the next example.
Example: second-order system
Given the system function
(1 + z −1 )2
H(z) = ,
(1 − 12 z −1 )(1 + 43 z −1 )
we can find the corresponding difference equation by noting that
1 + 2z −1 + z −2 Y (z)
H(z) = = .
1 + 14 z −1 − 38 z −2 X(z)
Therefore
1 3
(1 + z −1 − z −2 )Y (z) = (1 + 2z −1 + z −2 )X(z),
4 8
and the difference equation is
1 3
y[n] + y[n − 1] − y[n − 2] = x[n] + 2x[n − 1] + x[n − 2].
4 8
A difference equation does not uniquely specify the impulse response of a LTI
system. For a given system function (expressed as a ratio of polynomials),
each possible choice of ROC will lead to a different impulse response.
However, they will all correspond to the same difference equation.
If a system is causal, it follows that the impulse response is a right-sided
sequence, and the region of convergence of H(z) must be outside of the
outermost pole.
6
Alternatively, if we require that the system be stable, then we must have
∞
X
|h[n]| < ∞.
n=−∞
so the condition for stability is equivalent to the condition that the ROC of
H(z) include the unit circle.
Example: determining the ROC
The frequency response of the LTI system with difference equation
5
y[n] − y[n − 1] + y[n − 2] = x[n]
2
is
1 1
H(z) = = .
1 − 52 z −1 + z −2 (1 − 21 z −1 )(1 − 2z −1 )
There are three choices for the ROC:
• Causal: ROC outside of outermost pole |z| > 2 (but then not stable).
1
• Stable: ROC such that 2 < |z| < 2 (but then not causal).
1
• If |z| < 2
then the system is neither causal nor stable.
For a causal and stable system the ROC must be outside the outermost pole
and include the unit circle. This is only possible if all the poles are inside the
unit circle.
7
which implies that
1
H(z) = .
Hi (z)
The time-domain equivalent is
8
frequency components above the cutoff frequency that were set to zero by the
action of the lowpass filter.
If a system has a rational transfer function, with at least one pole that is not
cancelled by a zero, then there will always be a term corresponding to an
infinite length sequence in the impulse response. Such systems are called
infinite impulse response (IIR) systems.
On the other hand, if a system has no poles except at z = 0 (that is, N = 0 in
the canonical LCCDE expression), then
M
X
H(z) = bk z −k .
k=0
In this case the impulse response is finite in length, and the system is called a
finite impulse response (FIR) system.
Example: a first-order IIR system
Given a causal system satisfying the difference equation
9
The condition for stability is |a| < 1. The inverse z-transform is
h[n] = an u[n].
zk = aej2πk/(M +1) , k = 0, 1, . . . , M.
With a assumed real and positive, the pole at z = a is cancelled by a zero. The
pole-zero plot for the case of M = 7 is therefore given by
z−plane Im
7th
order
1
Re
The difference equation satisfied by the input and output of the LTI system is
the convolution
M
X
y[n] = ak x[n − k].
k=0
10
The input and output also satisfy the difference equation
If a stable LTI system has a rational system function, then its frequency
response has the form
PM
k=0 bk e
−jωk
jω
H(e ) = PN .
k=0 ak e −jωk
We want to know the magnitude and phase associated with the frequency
response. To this end, it is useful to express H(ejω ) in terms of the poles and
zeros of H(z):
QM
b0 k=1 (1 − ck e )
−jω
jω
H(e ) = QN .
a0 k=1 (1 − dk e −jω )
It follows that QM
b k=1 |1 − ck e |
−jω
jω 0
|H(e )| = QN .
a0 k=1 |1 − dk e −jω |
Therefore |H(ejω )| is the product of the magnitudes of all the zero factors of
H(z) evaluated on the unit circle, divided by the product of the magnitudes of
all the pole factors evaluated on the unit circle.
The gain in dB of H(ejω ), also called the log magnitude, is given by
11
which for a rational system function takes the form
M
jω b0 X
20 log10 |H(e )| = 20 log10 + 20 log10 |1 − ck e−jω |
a0
k=1
N
X
− 20 log10 |1 − dk e−jω |.
k=1
Also
Attenuation in dB = −Gain in dB.
Thus a 60dB attenuation at frequency ω corresponds to |H(ejω )| = 0.001.
Also,
The zero factors contribute with a plus sign and the pole factors with a minus.
In the above equation, the phase of each term is ambiguous, since any integer
multiple of 2π can be added at each value of ω without changing the value of
the complex number. When calculating the phase with a computer, the angle
returned will generally be the principal value ARG[H(ejω )], which lies in the
range −π to π. This phase will generally be a discontinuous function,
containing jumps of 2π radians whenever the phase wraps. Appropriate
multiples of 2π can be added or subtracted, if required, to yield the continuous
phase function arg[H(ejω )].
12
ARG[H(ejω )]
π
0 ω
π
−π
arg[H(ejω )]
π
0 ω
π
−π
−2π
−3π
−4π
(1 − rejθ e−jω )
13
The following plot shows the frequency response for r = 0.9 and three
different values of θ:
Gain (dB) 10
−10
π
θ=0 θ= 2 θ=π
−20
π 3π
0 2 π 2 2π
ω
π
2
Phase (radians)
− π2 π 3π
0 2 π 2 2π
ω
Note that
• The gain dips at ω = θ. As θ changes, the frequency at which the dip
occurs changes.
• The gain is maximised for ω − θ = π, and for r = 0.9 the magnitude of
the resulting gain is
10 log10 (1 + r2 + 2r) = 20 log10 (1 + r) = 5.57dB.
• The gain is minimised for ω = θ, and for r = 0.9 the resulting gain is
10 log10 (1 + r2 − 2r) = 20 log10 |1 − r| = −20dB.
14
The frequency response can be sketched from the pole-zero plot using a simple
geometric construction. Note firstly that the frequency response corresponds to
an evaluation of H(z) on the unit circle. Secondly, the complex value of each
pole and zero can be represented by a vector in the z-plane from the pole or
zero to a point on the unit circle.
Take for example the case of a single zero factor
z − rejθ
H(z) = (1 − rejθ z −1 ) = r < 1,
z
which corresponds to a pole at z = 0 and a zero at z = rejθ .
Im
φ3
z−plane
v2 v3
v1
θ ω Re
15
Consider now the pole zero system depicted below:
Im
z−plane
v3
v1
v1
v3 φ3 ω
v2 Re
The frequency response for the single zero at different values of r and θ = π is
10
Gain (dB)
0
r=0.5
−10 r=0.7
r=0.9
−20 r=1
π 3π
0 2 π 2 2π
ω
π
2
Phase (radians)
− π2 π 3π
0 2 π 2 2π
ω
Note that the log magnitude dips more sharply as r approaches 1 (and at ω = π
tends to −∞ as r tends towards 1). The phase function has positive slope
around ω = θ. This slope increases as r approaches 1, and becomes infinite for
r = 1. In this case the phase function is discontinuous, with a jump of π
16
radians at ω = θ.
If r increases still further, to lie outside of the unit circle,
Im
z−plane
v1
v3
φ3
φ3 v2
Re
10
Gain (dB)
−10 r=1/0.9
r=1.25
−20 r=2.0
π 3π
0 2 π 2 2π
ω
π
Phase (radians)
−π π 3π
0 2 π 2 2π
ω
17
3.2 Frequency response with multiple poles and zeros
where z1 , . . . , zM0 are the zeros, and p1 , . . . , pN0 the poles of H(z). This
representation could also be obtained by merely factorising H(z) in terms of z
rather than z −1 .
The frequency response of this system is
QM0 jω
i=0 (e − zk )
H(ejω ) = K QN .
0
(e jω − p )
i=0 k
In the z-plane, (ejω − zk ) is simply the vector from the zero zk to the point on
the unit circle. The term |ejω − zk | is the length of this vector, and
∢(ejω − zk ) is the angle that it makes with the positive real axis. Similarly, the
term (ejω − pk ) corresponds to the vector from the pole pk to the point on the
unit circle.
18
It follows then that the the magnitude response is the product of the lengths of
the zero vectors, divided by the product of the lengths of the pole vectors. The
phase response is the sum of the angles of the zero vectors, minus the sum of
the angles of the pole vectors. Thus, for the two pole, two zero system
Im
φ1 V1
z−plane
p1
U1
U2 θ1
θ2
z2 V2 z1 Re
p2 φ2
19
Discrete-time filters are often represented in the form of block or signal flow
diagrams, which are convenient for representing the difference equations or
transfer functions.
For example, the system with the difference equation
The symbol z −1 represents a delay of one unit of time, and the arrows
represent multipliers (with the constant multiplication factors next to them).
The equivalent signal flow diagram is
z −1
x[n] y[n]
z −1
−b1
y[n−1]
z −1
b2
y[n−2]
z −1
b3
y[n−3]
The relationship between the diagrams and the difference equation is clear.
20
Many alternative filter structures can be developed, and they differ mainly with
respect to their numerical stability and the effects of quantisation on their
performance. A discussion of these effects can be found in many DSP texts.
21