程序代写案例-00AM
时间:2022-08-02
UNIVERSITY OF GLASGOW
Degrees of MEng, BEng, MSc and BSc in Engineering
DIGITAL SIGNAL PROCESSING MSC (ENG5027)
Thursday 9th December 2021
Release time: 09:00AM (GMT) for 2.5 hours
Exam duration: 2 hours to complete exam plus 30 mins for download/upload of the
submission
Total 100 marks
Attempt ALL questions
A calculator may be used. Show intermediate steps in calculations.
The numbers in square brackets in the right-hand margin indicate the marks allotted to the
part of the question against which the mark is shown. These marks are for guidance only.
Page 1 of 4 Continued overleaf
Q1 A digital filter has the transfer function:
H(z) =
1
1−az−1
(a) What is the value of a at which the filter becomes unstable and why? [2]
(b) a is set to a= 0.5. Sketch the filter’s frequency response by calculating its response
for DC, its Nyquist frequency and with that information drawing a rough graph of
it. Label both x and y axis appropriately. [8]
(c) Draw a dataflow diagram of the filter [5]
(d) Somebody has written python code of the filter:
class Filter:
buffer = 0
a = 0.5
def filter(self,v):
"""Sample by sample filtering
v -- scalar sample
returns filtered sample
"""
self.buffer = v - self.a * self.buffer
return buffer
i. A unit test sends in the values 2,4,−2 into the filter Eq. Q1. Execute the code
by hand for the 3 steps by comparing actual and expected values returned from
the filter. [6]
ii. Decide if the filter is working properly or not, provide an explanation and pos-
sibly fix the bug. [4]
Q2 FIR filter design in the frequency domain
(a) Sketch the frequency response of an ideal bandstop filter. [5]
(b) Perform an inverse Fourier transform of a ideal bandstop amplitude response ana-
lytically to obtain the impulse response of the filter. [10]
(c) At a sampling rate of 1 kHz one wants to create a 2 Hz notch filter at 50Hz. How
many taps are needed theoretically and practically. Provide explanations for both
choices. [6]
(d) Provide two sketches which show the frequency response of the bandstop for a rect-
angular window and for a Hamming window. [4]
Page 2 of 4 Continued overleaf
Q3 The Fast Fourier Transform (FFT) Figure Q3 shows the discrete time (x(n)) and frequency
representation (X(k)) of a spoken sentence of one second duration at a sampling rate of
44100 Hz.
Figure Q3: Time and frequency plot of a spoken sentence
(a) State the lowest fundamental frequency in the sentence and the frequency of its first
harmonic. Provide an explanation. [4]
(b) Imagine you want to remove any low frequency noise with the Fast Fourier Trans-
form by transforming the audio signal x(n) into the frequency spectrum X(k) with
the Fast Fourier Transform, manipulating the spectrum X(k) and transforming it
back.
i. Which frequency samples X(k) need to be manipulated and how. Provide a
formula or formulas in Python syntax of how to manipulate the X(k). [6]
ii. Sketch the final frequency spectrum in frequency samples k = 0 . . .N−1,X(k)
after the X(k) have been manipulated to remove the low frequency noise. Indi-
cate the exact frequency indices k in the spectrum. [6]
(c) Which frequency samples X(k) need to be manipulated and how to increase the
amplitude of the highest harmonics of the voice. Use your experience from the lab
what improved the voice quality. [6]
(d) After having transformed the signal from the frequency domain back to the time do-
main x(n) you’d like to save it again as a WAV file. Which additional manipulations
are required to save it as a WAV file with 16 bit signed integer? [3]
Page 3 of 4 Continued overleaf
Q4 Detection
Figure Q4: Spectra of two vowels
(a) In the assignment you were asked to detect two different vowels from speech with
the help of the Fourier Transform. Figure Q4 shows the spectra of two vowels.
i. Describe how to distinguish between these two vowels just using their fun-
damental frequencies. Describe a robust approach which is independent how
loud the vowels were spoken using the frequency spectrum obtained by the
FFT. [6]
ii. Describe an approach to detect the two different vowels by comparing the am-
plitudes of harmonics. Which harmonic could be used? State its approximate
frequency and how its amplitude can be used in a robust way? [6]
(b) In the assignment you detected R-peaks in an ECG with the help of wavelets.
i. Sketch a wavelet and an R-peak from the ECG. [2]
ii. Explain why the wavelet is ideal for detecting ECG. [3]
iii. Why is it imperative that the ECG signal and the wavelet is DC free? [4]
iv. What can be done to improve detection and remove wrong detections?
[4]
Page 4 of 4 End of question paper
essay、essay代写