0% found this document useful (0 votes)
8 views9 pages

Coventry University Faculty of Engineering and Computing: PSB6034EE/PSB310SE Advanced Digital System CW Assignment

The document outlines the assignment instructions for Coventry University's Advanced Digital System course, detailing five questions that students must answer by the deadline of May 25, 2025. Students are required to submit a report in PDF format and must destroy all copies of the assignment question paper after completion. The assignment includes tasks related to convolution operations, spectral analysis, discrete time signals, filter design, and a serial adder implementation using VHDL.

Uploaded by

limgp82
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
8 views9 pages

Coventry University Faculty of Engineering and Computing: PSB6034EE/PSB310SE Advanced Digital System CW Assignment

The document outlines the assignment instructions for Coventry University's Advanced Digital System course, detailing five questions that students must answer by the deadline of May 25, 2025. Students are required to submit a report in PDF format and must destroy all copies of the assignment question paper after completion. The assignment includes tasks related to convolution operations, spectral analysis, discrete time signals, filter design, and a serial adder implementation using VHDL.

Uploaded by

limgp82
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 9

Coventry University

Faculty of Engineering and Computing


PSB6034EE/PSB310SE

Advanced Digital System CW Assignment

Instructions:

Deadline: 25th May 2025

Answer all 5 questions. Total 100 marks.

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.

Keeping a copy of the assignment question paper is illegal.

You are not allowed to share the question paper to anyone unless given the
written authorisation by the school.

Do not submit this page.


Bachelor of Engineering with Honours in
Electrical and Electronic Engineering
PSB6034EE/PSB310SE

Advanced Digital System CW Assignment

Apr 2025

1st marker 2nd marker

Q1

Q2

Q3

Q4

Q5

Total

I declare that the report attached is entirely my own.


I understand that plagiarism, collusion, and copying are serious offences.
I understand that disciplinary action will be taken against me, and academic misconduct will
be recorded if I am found guilty on plagiarism, collusion and copying.

Name Student ID Signature date


1)
a)
i. The convolution operator ⨂ is defined as:

ℎ[𝑛] ⊗ 𝑥[𝑛] = ∑ ℎ[𝑖]𝑥[𝑛 − 𝑖] 𝐸𝑞(1).


𝑖=0

Simplify 𝑦[𝑛] = ℎ[𝑛] ⨂ 𝑥[𝑛] to a closed-form expression given that,

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”.

a) Write a MATLAB program according to the instructions below:


Read “piano_single_note.wav” into a vector 𝑥.
Use the built-in function FFT to compute the frequency spectrum of 𝑥,
and save the result in 𝑋.
Create a vector 𝑓𝑟𝑒𝑞 (in Hz) that represents the actual frequencies
corresponding to the indices of 𝑋.
Add clear and concise comments to help the marker understand your
thought process and the functionality of the code.
(6 marks)

b) Determine the sampling rate and the number of samples in 𝑥. (4 marks)

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:

𝑥[𝑛] = (0.7)𝑛 cos(4𝑛) 𝑢[𝑛]

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.

i. Capture in one screenshot, the design parameters, the magnitude


and phase response, and the order of the filter designed by FDA.
(4 marks)
ii. Capture in the same screenshot above, with the use of the data
marker, the values of the magnitudes and phase shifts at 3kHz and
6kHz.
(2 marks)

iii. From the phase delay, calculate the time delay (in ms) of a 3 kHz
sinusoidal signal going through the filter. (2 marks)

b. In this exercise, we use SIMULINK to simulates the response of the


filter when a 3kHz and a 6kHz sinusoidal waveforms are fed into the
filter.
i. In Filter Design & Analysis Tool, click “Export to Simulink
Model” to export the Butterworth filter in 4a to the SIMULINK
environment.

ii. In SIMULINK, create two discrete-time signals 𝑥1 [𝑛] and 𝑥2 [𝑛]


expressed by the following equations:

𝑇𝑠 = (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.

Figure 5a: Block diagram for the serial adder.

Figure 5b: Circuit for the adder FSM.


a) Complete the table below for the state transition and the output sum.

Present Next state Output s


state ab=00 01 10 11 00 01 10 11
y Y s
G=0 G or H?
H=1
(4 marks)
b) Write a VHDL code to implement the adder FSM, according to the table
above. Explain the logic and algorithm by meaningful and explanatory
comments in the code. Capture the screenshot of the source code in the
Vivado software environment.
(6 marks)

c) Synthesize and implement the design. Capture the screenshots of the


schematic diagram produced by Vivado. You may combine b) and c) in
one screenshot. (2 marks)

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)

e) With A = 00111011b and B=01011100b, run the simulation to obtain


the sum s. Capture the screenshot of the simulation result. (4 marks)
Compare with the result with the binary addition, and show whether the
simulation result is correct. (2 marks)

END

You might also like