Coventry University Faculty of Engineering and Computing: PSB6034EE/PSB310SE Advanced Digital System CW Assignment
Coventry University Faculty of Engineering and Computing: PSB6034EE/PSB310SE Advanced Digital System CW Assignment
Instructions:
Submit a report in pdf format, fewer than 25 pages, to the Module Assignment
Folder in Blackboard. You are required to keep the program source codes
(Matlab, filter design, VHDL) as presented in the report until the end of the
term, in case the markers want to test run them.
VERY IMPORTANT:
You must destroy and delete all the hard- and soft-copies of the assignment
question paper from all physical and online storages, including but not
limited to hard disk, thumb drive, smartphone, email or messaging app at the
end of the paper.
You are not allowed to share the question paper to anyone unless given the
written authorisation by the school.
Apr 2025
Q1
Q2
Q3
Q4
Q5
Total
1 𝑛 1 𝑛
𝑥[𝑛] = ( ) 𝑢[𝑛] and ℎ[𝑛] = ( ) 𝑢[𝑛].
2 5
Do not use the z-transform method; use the summation formula for the
simplification:
𝑁
1 − 𝑎𝑁+1
𝑛
∑𝑎 = , 𝑛 ≥ 0, 𝑎 < 1
1−𝑎
𝑛=0
(4 marks)
ii. From the closed-form expression obtained above, evaluate 𝑦[𝑛] for
0 ≤ 𝑛 ≤ 3. (2 marks)
b)
i. Write a MATLAB program to implement the convolution operation ⊗
as defined in a) i..
Your program must compute 𝑦[𝑛] according to the mathematical
algorithm in Eq. (1). Explain the algorithm by adding comments in the
program code. (8 marks)
ii. Using the values of 𝑥[𝑛] and ℎ[𝑛] as given in a), run your program to
calculate 𝑦[𝑛] for 0 ≤ 𝑛 ≤ 20. Plot the result 𝑦[𝑛] vs 𝑛 using the
stem() function. (4 marks)
Compare the results obtained by your program with and the analytical
result obtained in (a-ii) for 0 ≤ 𝑛 ≤ 3, and determine whether they are
the same. (2 marks)
2) In this exercise you are to perform spectral analysis on the audio signal
“piano_single_note.wav”.
c) Plot of |𝑋(𝑓𝑟𝑒𝑞)| vs 𝑓𝑟𝑒𝑞 from 0Hz to 3kHz. Tag clearly at each peak
its frequency and magnitude. (4 marks)
Determine the fundamental frequency and its harmonics (up to the 3rd
harmonics) that make up the note. (2 marks)
Arrange the result of a), b) and c) on the computer screen and capture
them in one screenshot.
3) A discrete time signal is given by:
a)
i. Find 𝑋(Ω), the Discrete Time Fourier Transform (DTFT) of 𝑥[𝑛]
analytically. (6 marks)
ii. Write a MATLAB program to plot the amplitude |𝑋(Ω)| and phase
spectra ∠𝑋(Ω) against Ω, 𝜋 ≤ Ω < 𝜋 based on the equation obtained
above. (6 marks)
b)
i. Write a MATLAB program to compute the Fast Fourier Transform
(FFT) of 𝑥[𝑛]. The program should consist of a
vector 𝑥[𝑛] with 64 elements, an 𝑓𝑓𝑡() to compute 𝑋𝐹𝐹𝑇 (𝑘) and use
2π𝑘
equation (Ω = ) to map discrete frequency 𝑘 to horizontal axis of
𝑁
𝜋 ≤ Ω < 𝜋. (4 marks)
ii. Use 𝑓𝑓𝑡𝑠ℎ𝑖𝑓𝑡() to rearrange the output and 𝑝𝑙𝑜𝑡() to plot the
|𝑋𝐹𝐹𝑇 (Ω)| and ∠𝑋𝐹𝐹𝑇 (Ω) against Ω, for 𝜋 ≤ Ω < 𝜋. Notice that the
continuous plot interpolates the FFT results and gives an
approximate representation of the DTFT.
(4 marks)
4) Design filters using Filter Design and Analysis Tool in MATLAB. A low-
pass filter has the following specifications:
• Sampling frequency 48kHz
• Passband attenuation (Apass) = 1 dB
• Stopband attenuation (Astop) = 60 dB
• Passband edge (fpass) = 4kHz
• Stopband edge (fstop) = 5kHz
a. Design a low-pass IIR Butterworth filter with minimum order to meet
the above specifications.
iii. From the phase delay, calculate the time delay (in ms) of a 3 kHz
sinusoidal signal going through the filter. (2 marks)
𝑇𝑠 = (1/48000)𝑠𝑒𝑐
𝑥1 [𝑛] = sin(2𝜋𝑓1 𝑛𝑇𝑠 ) , 𝑓1 = 3𝑘𝐻𝑧
𝑥2 [𝑛] = sin(2𝜋𝑓2 𝑛𝑇𝑠 ) , 𝑓2 = 6𝑘𝐻𝑧
iii. Feed the signal 𝑥1 [𝑛] into the Butterworth lowpass filter and use a
two-channel scope to measure the input and output signals
simultaneously.
Capture the circuit block diagram showing the connection of the
signal source, filter, and the scope. (2 marks)
Capture the input and output waveforms on the same graph for
5ms. (2 marks)
From the waveforms, measure the gain and the time delay after the
output has stabilized. (2 marks)
Compare the gain and delay in this simulation with the design
values obtained in Q4a-iii. (2 marks)
iv. Repeat the same simulation feeding 𝑥2 [𝑛] into the filter. Capture
the input and output waveforms on the same graph for 5ms.
Comment on the output waveform in relation to the function of the
filter.
(6 marks)
5) Figure 5a shows the block diagram of a serial adder. A serial adder adds
two 8bit unsigned number A and B and produces the sum in the Sum-
register. The heart of the serial adder is an Adder Finite State Machine
(FSM) as shown in Figure 5b. The state of the FSM is the carry-in from the
previous bit position, and it is denoted by G=0 or H=1.
d) Write a test bench code to simulate the circuit function. In the test bench
code, a clock signal shifts two 8bit unsigned numbers, 𝐴 = 𝑎7 𝑎6 … 𝑎0
and 𝐵 = 𝑏7 𝑏6 … 𝑏0 to the right bit by bit into the Adder FSM and shifts
the output s into the sum-register. Capture the screenshot of the test
bench code in the Vivado development environment. (4 marks)
END