MATLAB代写-ELEC3004
时间:2022-05-06
ELEC3004: Signals, Systems and Control Sem 1, 2022
Problem Set 2: Systems, Filtering & Z-transforms
Total marks: 100 Due Date: Monday May 9, 2022 at 16:00 AEST
Note: This assignment is worth 20% of the final course mark. Please submit your answers
as a single pdf file via Gradescope, including your name and student number. Solutions,
including equations, should be typed. Explain your solutions as if you are trying to teach
a peer. Demonstrate your insight and understanding. Answering an entire question
with bare equations, lone numbers or without any explanation is not acceptable. Marks
may be reduced if an answer is of poor quality, demonstrates little effort or significant
misunderstanding. If you have used code in your solution, please include it in your report.
Questions
Question 1. Filter Design (15 marks)
Consider two types of digital filters: Butterworth and Elliptic.
(a) Butterworth: Smooth & Creamy?
For data sampled at 2000 Hz, design a digital Butterworth filter with a pass band
finishing at 200 Hz, and a stop band which starts at 500 Hz. There should be no
more than 3 dB of ripple in the passband and a minimum attenuation of 80 dB in
the stop band.
What is the lowest order filter you can have which satisfies these criteria?
Plot the magnitude and phase response of the filter, as well as the poles and zeros of
this filter in the z-plane.
[Consider Matlab functions: buttord, butter, bode, tf, zplane, and freqz]
(b) Elliptic: Sharp, but Rough?
Now design an Elliptic filter to the same specifications. What’s the lowest order it
can take while satisfying the criteria?
Plot the magnitude and phase response of the filter, as well as the poles and zeros of
this filter in the z-plane.
[Consider Matlab functions: ellipord, and ellip]
(c) Comment on the difference between your two designed filters (incl. comparison of
filter order, transition band, ripple and phase response).
1
ELEC3004: Signals, Systems and Control Sem 1, 2022
Question 2. Causality and Stability (15 marks)
(a) A linear, time-invariant discrete system is causal if its unit-sample response, h[n], is
zero for n < 0. Explain why in terms of the definition of causality, and relate to the
input and output of the system.
(b) For a system transfer function H(z), why must there not be more finite zeros than
finite poles for the system to be causal?
(c) What does it mean for a system to be BIBO stable? Which region(s) of the z-
plane correspond to stable regions in terms of location of poles and zeros and the
Region of Convergence? Also comment on the existence of the Discrete-Time Fourier
Transform.
Question 3. Convolution (5 marks)
(a) Digital Convolution
Consider an LTI system that has an impulse response h[n] given in the figure below
(and is zero everywhere else):
−1 0 1 2
−3
−2
−1
0
1
2
3
n
h[n]
Suppose the input to the system is x[n] = u[n+ 1] + u[n− 1]− 2u[n− 2].
Determine the output of the system, y[n]. You may provide your answer either as
sample values and their corresponding sample number (n) or using a plot, remem-
bering to label your axes.
2
ELEC3004: Signals, Systems and Control Sem 1, 2022
Question 4. Filters and Windowing (25 marks)
Filters are a type of system. In the design of FIR filters, we can select a desired frequency
response in the analog domain and convert it to the digital domain using the Fourier series
method. By definition, the FIR filter impulse response must be of finite duration. There-
fore, the desired impulse response must be truncated to have finite duration. Truncating
the impulse response abruptly will result in oscillatory frequency response because of the
Gibbs phenomenon. In some filter applications the oscillatory frequency response in the
stopband may not be acceptable. By using a tapered window function for truncation of
h[n], the oscillatory behaviour can be reduced or even eliminated at the cost of increasing
the transition band.1
(a) Briefly explain the similarities and differences between FIR and IIR filters, e.g. in
terms of feedback/recursion, computational efficiency, transition bandwidth, stabil-
ity, phase.
(b) Consider the impulse response of an ideal low pass filter with a filter length of N0,
and cut-off frequency ωc pi rad/sample:
hLP [n] = ωc sinc
(
ωc
(
n− N0 − 1
2
))
.
After applying a window, we have:
hWLP [n] = hLP [n] · w[n],
where w[n] is the chosen window function (e.g. Hamming, Hanning, Kaiser). For
example, the Hamming window is given by:
wHAM [n] =
(
0.54− 0.46 · cos
(
2pin
N0 − 1
))
(u[n]− u[n−N0])
Consider the case of a filter order of N = 40 (i.e. a filter length of N0 = 41) and
ωc = 0.4 pi rad/sample. Determine hWLP manually, for a Hamming window using the
equations above. Then generate an FIR filter in Matlab (or equivalent) using the
command fir1.
Compare your manually generated and Matlab’s FIR filter in time domain and fre-
quency domain. You may use the plotting tool freqz to compare them. Briefly
explain, are these filters the same?
(c) Compare the Rectangular, Hamming and Hanning windows for the specification in
part (b) above. You may want to use: rectwin, hamming, hann in Matlab.
1Source: Lathi, Chapter 12
3
ELEC3004: Signals, Systems and Control Sem 1, 2022
(d) Bilinear Transformations and Equivalence
One approach to realising a digital filter is to transform an analog filter (a complex
function in the s-domain) to a digital one (a complex function in the z-domain). This
may be accomplished via a bilinear transformation of the form:
s = K
(
1− z−1
1 + z−1
)
,
where K is a design parameter. A common choice for this is K = 2
Ts
; that is, Tustin’s
Rule.
Using this approach, design a digital lowpass filter with a cutoff frequency of ωd =
500 rad/s and sampling frequency ωs = 2000pi rad/s, equivalent to a 5th-order But-
terworth LPF2. Determine the digital transfer function H(z), and plot the magnitude
response of both the analog and digital LPFs using normalised frequency (normalis-
ing to Ts = 1 s). Comment on the difference between the digital and analog filters
and their cut-off frequency.
Question 5. Z-transforms (10 marks)
Please assume the bilateral Z-transform in all questions unless otherwise stated.
(a) Determine the Z-transform and Region of Convergence of:
x[n] = a|n| for a > 0
Note: a|n| = anu[n] + a−nu[−n− 1]
If needed, you may include hand-drawn ROC plots.
(b) Determine the Z-transform and Region of Convergence (ROC) of:
x[n] = {2, 0, 2, 2, 3, 0, 0, 4}, n = −4 : 3
Ensure you consider if the ROC includes 0 and/or ∞.
2Note that the Lathi textbook has an error in the Butterworth coefficient tables!
4
ELEC3004: Signals, Systems and Control Sem 1, 2022
Question 6. FIR Moving Average Filter (30 marks)
The moving average filter is a crude, but common, technique for smoothing a noisy data
sequence. For an input signal vector, x[n], it operates by averaging the sequence over N+1
samples such that the output, y[n], is computed as the average of x[n] and the N preceding
samples x[n− 1], x[n− 2], ..., x[n−N ], which may be described as:
y[n] =
1
N + 1
N∑
k=0
x[n− k]
(a) Determine the corresponding impulse response, h[n], of this system
(b) Determine the system function, H(z), for this system
(c) Determine the zero and/or pole locations for H(z)
(d) Using the result from part (c), plot the pole/zero impulse for the case where N = 3.
(e) Plot the magnitude response and phase response over the range −pi ≤ Ω ≤ pi, where
Ω is the normalised angular frequency (hint: it may help to analytically determine
the magnitude, H(ejΩ))
(f) Repeat case (e) and plot the magnitude responses (not phase) for the cases where
NX = 10. NY = 15, NZ = 3004. (hint: it may help to generate this using Matlab or
other software)
5


essay、essay代写