CST304 Assignment Informal
CST304 Assignment Informal
DESCRIPTION OF COURSEWORK
D. Instruction to Students
1. Complete this task as a group or as an individual. If you are working in a group, you must
form a GROUP of no more than two (2) students to complete the task. Select your own
partner.
2. The assignment report should be typewritten. Include the assignment cover page with ‘own
work declaration’ statements.
3. Finish all tasks and paste your code into the assignment report.
4. The report shall not exceed 15 pages.
5. You are required to submit the completed assignment to MOODLE site. There will be two
files of submission in MOODLE;
i. Assignment report and
ii. Source Codes in m-file (.m) format.
6. The due date for this assignment is on 13 July 2024, 5:00 pm.
7. The report must be well-formatted. Line spacing of 1.5, Times New Roman with a font size
of 12, page margin of 1 inch at all ends, contents not more than 15 pages (not including cover
page and list of references), come with introduction and conclusion, basic referencing with
a list of references. A mark deduction of 5% will be imposed for poorly-formatted report.
F. Tasks
A digital signal can be either discrete-time or continuous-time. Although not all digital signals are
discrete-time, they all have a discrete value at each sampling point. These signals are commonly
used to represent data as a sequence of discrete values. As illustrated in Figure 1, when the sample
values of a discrete signal are quantized, it becomes a digital signal.
Figure 1
You are requiring to construct various form of discrete signal using Matlab/ Octave as following:
(i) Produce a sample rate of 100 Hz in a variable named fs. Then, create a signal named t that
extends from 0 seconds to 1 second, with time steps that are 1/fs.
[Matlab Code solution- 5 marks]
(ii) Construct a 5 Hz sine signal named sig at the sample times in t. Then, diagram a plot
of sig versus t.
[Matlab Code solution- 5 marks]
(iii) Construct a vector of normally distributed random numbers named noise that is the same size
as sig. Multiply the vector by 0.1 to scale the vector.
[Matlab Code solution- 5 marks]
(iv) Add the signal vector with the noise vector. Name the output NoisySig. Then diagram a plot
of NoisySig versus t.
[Matlab Code solution- 5 marks]
(v) Revise and diagram your signal sig and NoisySig into discrete signal.
[Matlab plots of sig and NoisySig - 10 marks]
Given a finite duration discrete-time sequence 𝑥(𝑛) = {2, −1, 0, 1} with 𝑛 = [ 0, 1, 2, 3].
Use MATLAB/OCTAVE code to calculate the DTFT based on the equation above with the
frequency range, Omega = linspace(-pi, pi,500+1). [8 marks]
Use MATLAB/OCTAVE code to compute the DFT based on the equation above. [8 marks]
(iii) Determine the DFT of sequence 𝑥(𝑛) = {2, − 1, 0, 1} for 0 ≤ 𝑛 ≤ 3 by padding 60 zero-
valued samples at the end of the sequence. [7 marks]
Evaluate and discuss your observation on spectrum plots based on above computations.
[7 marks]
One of the digital signal processing applications is a digital filter. A digital bandpass filter (BPF)
is a device that passes frequencies within a certain range and rejects frequencies outside that range.
The difference equation of a system that performs the bandpass filter is given as follows,
The filter has a lower-cutoff frequency, 𝑓𝑙𝑐 at 1𝑘𝐻𝑧, an upper-cutoff frequency, 𝑓𝑢𝑐 at 1.5𝑘𝐻𝑧 and
a sampling rate, 8𝑘𝐻𝑧.
i. Analytically, determine the transfer function, 𝐻(𝑧) of the filter. [10 marks]
ii. Compute the filter frequency response and plot the spectrums. [10 marks]
iii. Let the input of the filter discrete-time signal, 𝑥(𝑛) is an audio recording ‘audio.mat’,
a) Compute the output of the system, 𝑦(𝑛) i.e., the filtered signal. [10 marks]
b) Compute the spectral plot of the filtered signals. [10 marks]
TOTAL 100
Note to students: Please print out and attach this appendix together with the submission of coursework