Description
3.1 Rational Z-transforms
As noted in your textbook, the common Z-transform pairs can be written as a ratio of two
polynomials in z
-1
or z. That is
N
N
M
M
a a z a z
b b z b z
D z
N z
H z
1
0 1
1
0 1
( )
( )
( )
If we know that a system can be described by H(z), its output to a known input X(z) can
be computed by multiplying H(z) X(z). On the other hand, if we know the input X(z) and
the output Y(z), the system can be identified. The time domain solution can be easily
obtained by using partial-fraction expansions.
Problem 1.
Consider the system:
3 2
( )
2
2
z z
z z
H z
How many poles and zeros do you have?
Poles _______
Zeros _______
Use the command roots in Matlab to determine the numerical values of these poles and
zeros. Use roots([1 –1 0]) for the zeros and roots([1 3 2]) for the poles.
Poles =
Zeros =
Describing the same system in terms of increasing order of z
-1
, we have
1 2
1
1 3 2
1
( )
z z
z
H z
Use roots([1 –1]) for the zeros and roots([1 3 2]) for the poles. Do you have the same
answer?
Poles =
Zeros =
Compute h(n) using the poles and zeros found with Matlab.
h(n) =
Problem 2
Use the filter command in Matlab to generate and plot the impulse response h[n] of the
following second order difference equation. Plot h[n] in the range of –10 n 100.
y[n] – 1.8cos(/16)y[n-1] + 0.81y[n-2] = x[n] + 0.5x[n-1]
Determine the impulse response using the inverse Z-transform and confirm your results.
3.2 Frequency response of difference equations
The frequency response of a system h(n) can be obtained by evaluating the z-transform of
the system on the unit circle. That is, if a system is described by
( )
( )
( )
1
1
M
m
m
K
k
k
z p
z z
H z A ,
the contribution of each pole and each zero to the magnitude in the frequency domain
depends on the length of the vector from the pole or zero to the point
jw
e
. Thus, taking
the magnitude and evaluating at
jw
e
yields:
M
m
m
K
k
k
M
m
m
jw
K
k
k
jw
jw A
e p
e z
H e A
1
1
1
1
u
v
| |
| |
| ( ) |
as shown in the next figure.
The phase is given by
M
m
k
jw
K
k
k
jw jw H e A e z e p
1 1
( ) ( ) ( )
Problem 3.
Plot the poles and zeros of the system in Problem 2.
Using the command freqz, plot the magnitude and phase of the frequency response of this
system. If the system is to be defined as a filter, what kind of filter it is?
Filter is ____________________________
Do the same for the following filters:
* y[n] + 0.13y[n-1] + 0.52y[n-2] + 0.3y[n-3] = 0.16x[n] – 0.48x[n-1] + 0.48x[n-2] –
0.16x[n-3]
H(z) =
____________________________________________
Filter is ____________________________
* y[n] – 0.268y[n-2] = 0.634x[n] – 0.634x[n-2]
H(z) =
____________________________________________
Filter is ____________________________
* y[n] + 0.268y[n-2] = 0.634x[n] + 0.634x[n-2]
H(z) =
____________________________________________
Filter is ____________________________
* 10y[n] – 5y[n-1] + 2y[n-2] = x[n] – 5x[n-1] + 10x[n-2]
H(z) =
____________________________________________
Filter is ____________________________
Without taking into consideration the cut-off frequencies, draw the poles and zeros of the
simplest low-pass and high-pass filters you can think of. That is, use a minimum number
of poles and zeros. Explain your results.
You will be given an acoustic signal in the file BoatWhale.mat. Note that the signal is
already in Matlab format. The samples correspond to a recording using a hydrophone of a
whale sound but it also records the sound of the boat (Fs = 22050Hz). Design a filter that
can attenuate the sound of the boat. Please include the pole-zero diagram and your
methodology.
Matlab instructions that can help you:
To listen to the audio use sound
To obtain a polynomial from roots use the command poly
The command tf can give you the pole-zero plot.
Hint, the sound of the boat has a good number of harmonics.