Download as pdf or txt
Download as pdf or txt
You are on page 1of 6

ELEC S334

Signal Processing and Multimedia Technology

Assignment 2
Cut-off date: 10 May 2020

Spring 2020

Solution
Not all steps given. For reference only.

Assignment 2 ELEC S334, Spr 2020 Pres. Solution 1


ELEC S334 Assignment 1 (2020) Cut-off date: 10 May 2020

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%

- Q3f answer not updated

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

The available windows are listed in Table 3.1 of Unit 3.

(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 ]

Assignment 2 ELEC S334, Spr 2020 Pres. Solution 2


Question 2 [ 25 marks ]

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: 𝐻(𝑧) = $&".(!+'!* '( ,".!'%%%* ')

(b) Is this IIR filter stable? Explain by providing justifications. [ 4 marks ]

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:

𝑦[𝑛] = 0.018122𝑥 [𝑛] + 0.36244𝑥[𝑛 − 1] + 0.18122𝑥[𝑛 − 2] − 0.62932 ∙ 𝑦[𝑛 − 1] +


0.23888 ∙ 𝑦[𝑛 − 2]

(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 ]

Assignment 2 ELEC S334, Spr 2020 Pres. Solution 3


Question 3 [ 25 marks ]
Consider the analogue signal x(t) shown below.

(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 ]

Answer: Apply a low-pass filter or band-pass filter before sampling

(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

Assignment 2 ELEC S334, Spr 2020 Pres. Solution 4


(d) Assume that a system samples x(t) at 500Hz (first sample taken at 0 second), and performs
3-bit quantization within amplitude range -4 to 3. [ 8 marks ]

i.) What is the quantization step size?


Answer: 1

ii.) Mark on x(t) the horizontal lines that represent the quantization steps.
Answer:

iii.) Give the quantized values.

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 ]

Answer: 000010, 000000, 000011, 111111, 111101, 000010

[ End of Question 3 ]

Assignment 2 ELEC S334, Spr 2020 Pres. Solution 5


Question 4 [ 25 marks ]
Given a message: I ASPIRE TO INSPIRE BEFORE I EXPIRE

The space is included in the message as a symbol.

(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 ]

Answer: H(x) = 3.32 bits / symbol

[ End of Question 4 ]
[ End of Assignment 2 ]

Assignment 2 ELEC S334, Spr 2020 Pres. Solution 6

You might also like