Assignment 2: Spring 2020
Assignment 2: Spring 2020
Assignment 2
Cut-off date: 10 May 2020
Spring 2020
Solution
Not all steps given. For reference only.
The distribution of marks for this assignment is shown in the following table:
Question 1 2 3 4 Total
Percentage 25% 25% 25% 25% 100%
Question 1 [ 25 marks ]
Using the Window Design Method, design an FIR high-pass filter with the following
specifications:
fpass = 10kHz, fstop = 6kHz, Apass = 1.23dB, Astop = -48dB, sampling frequency fs = 30kHz
(a) Name the window(s) that is / are suitable for the application. Explain why the selected
window(s) is / are suitable. [ 3 marks ]
Answer:
- Hamming and Blackman windows
- Apass and Astop of the windows are lower than required specification
(b) If Hamming window is used for designing the filter, find the expression for hHP[k], the
impulse response of the high-pass filter. Show your work. [ 13 marks ]
Answer:
$%#
ℎ!" [𝑘] = (−1)# ∙ +0.54 − 0.46 cos 4 $& 56 ∙ [0.4666𝑠𝑖𝑛𝑐(0.4666𝑘)],
𝑓𝑜𝑟 𝑘 = 0,1,2, … , 26
[ End of Question 1 ]
Using the Bilinear Transform Method, design an Infinite Impulse Response (IIR) filter using
the analog prototype filter, which is described by the s-domain transfer function, H(s):
2200
𝐻 (𝑠 ) =
𝑠 ! + 376𝑠 + 4220
(a) Given the sampling interval ts = 0.1s, find the z-domain transfer function of the IIR filter.
Show your work. [ 12 marks ]
".$%$!!&".'(!))* '( &".$%$!!* ')
Answer: 𝐻(𝑧) = $&".(!+'!* '( ,".!'%%%* ')
Answer:
- Stable
- All the poles of H(z) are inside the unit circle on z-plane. Poles are: z = -0.89594 and z = 0.26662
(c) Give the time-domain difference equation of the IIR filter you have designed in Part (a).
[ 5 marks ]
Answer:
(d) Using signal processing operational symbols, sketch and label a block diagram to describe
the IIR filter you have designed in Part (a). [ 4 marks ]
Answer:
[ End of Question 2 ]
(a) Assume that x(t) is sampled at 500Hz and the first sample is taken at 0 second. Using circles
‘o’, mark on x(t) where the samples are taken. [ 3 marks ]
Answer:
(b) If the ‘glitch’ near 0.0035 second is noise, what is the most practical way to remove the
noise before sampling x(t)? [ 4 marks ]
(c) If the ‘glitch’ near 0.0035 second is actually part of the signal, what are the technical
considerations that must be taken in the sampling process, so that information of the entire
signal can be retained after sampling? [ 4 marks ]
Answer: Increase sampling rate. Sampling rate should at >= Nyquist sampling rate
ii.) Mark on x(t) the horizontal lines that represent the quantization steps.
Answer:
Answer: 2 0 3 -1 -3 2
(e) If the amplitude changes near 0.0035 second is very important, is 3-bit quantization good
enough? Explain why or why not. [ 4 mark ]
Answer:
- Not enough
- The changes near 0.0035sec is around 2.5 in amplitude. However, it will be quantized to 3
(f) Assume that x(t) is sampled at 500Hz using a 6-bit binary system with 2’s complement,
and the first sample is taken at 0 second. Give the values of the first six (6) samples.
[ 2 marks ]
[ End of Question 3 ]
(a) With the aid of appropriate tables and diagrams, build the Huffman code table of the given
message. [ 7 marks ]
Answer:
(b) Determine the average number of bits per symbol for the coded message using the code-
table you built in Part (a). Show your work. [ 4 marks ]
Answer: Average code length = 3.37 bits / symbol
(c) With the aid of appropriate tables and diagrams, build the Shannon-Fano code table for
the same message. Show your work [ 7 marks ]
Answer:
(d) Determine the average number of bits per symbol for the coded message using the code-
table you built in Part (c). Show your work. [ 4 marks ]
Answer: Average code length = 3.37 bits / symbol
(e) Determine the entropy of the message. Show your work. [ 3 marks ]
[ End of Question 4 ]
[ End of Assignment 2 ]