5. (46 marks) Event detection in ECG and PPG
a. Plot both time-domain signals in one figure using the built-in ‘subplot’ function. Observe their waveforms, identify unique features (e.g., QRS complex in ECG and dicrotic notch if any in PPG), and briefly describe how these features are associated with cardiovascular physiology.
(10 marks)
b. Plot their amplitude spectra (through ‘fft’) in one figure using the built-in ‘subplot’ function. Please compare and briefly discuss about the frequency content of ECG and PPG.
(6 marks)
c. From the spectra, what are the respective minimum sampling rate requirements for ECG and PPG according to the Nyquist theorem? Please justify your answers.
(6 marks)
d. Please realize an algorithm that can detect the major peak in each of the two signals. Please also label those peaks on the waveforms. Note that this labelling must be done by smart coding, not manually.
(20 marks)
e. Please compute the heart rates using the peak detection from ECG and PPG. Are the calculated heart rates the same? Are the heart rates constant?
(4 marks)