binder 1
TRANSCRIPT
ECG
Dig
ital
Sig
nal
Pro
cess
ing
Exam
Rep
ort
on E
CG D
FT S
igna
l Pro
cess
ing
Facu
lty O
f Eng
inee
ring
, Cai
ro U
nive
rsity
, Sys
tem
s an
d Bi
omed
ical
Eng
inee
ring
.
Elgh
arab
awy,
Aym
an
Task1ECG
ECG Digital Signal Processing 2
Question 1
Exam Report Exam Tasks :
1. Compute and display the DFT of ECG signals for normal, ventricular couplet, ventricular tachycardia, ventricular bigeminy, and ventricular fibrillation types. Compute the DFT for only one sample signal from each type.
2. Compute and display the power spectrum of ECG signals for normal, ventricular couplet, ventricular tachycardia, ventricular bigeminy, and ventricular fibrillation types. Use all signals and periodogram averaging to compute the power spectrum for each type.
3. It is desired to filter the ECG samples using a low pass filter with cut-off frequency of 38 Hz. Transition band must be not more than 10 Hz to avoid having the 50 Hz noise interfere with the signal. The attenuation of the stop-band must not be less than 35 dB. Design and compare the digital filter to meet these requirements using the following approaches:
a. FIR filters with 3 different windows (e.g., rectangular, Hamming, Kaiser, etc.)
b. IIR filter with 3 different approaches (e.g., Butterworth, Chebyshev, elliptic, etc.)
4. It is desired to compute the Fourier transformation of a normal ECG signal at two different frequency resolutions of 0.001 and 0.002 Hz starting from the original samples of one normal ECG signal. Design a signal processing method that enables you to do that.
Task1ECG
ECG Digital Signal Processing 3
Question 1
Question 1
1-Normal ECG Signal
Calculating the DFT of the all Signals By using Matlab Function FFT and plot it and compare it with DFT of one Signal
Methodology:
So instead of displaying DFT that goes from 0 to fs, it would be more appropriate to show the spectrum from fs/2 to fs/2 . This can be ccomplished by using Matlab's fftshift function as the following code demonstrates.
Matlab Code:
%=========================================================% % A: Fourier transform %=========================================================% %=============== % 1-Total Signal %=============== N=1080; normalSignal=Learndata1(1,:); fftnormal = fft(normalSignal,N); fftnormalshift=fftshift(abs(fftnormal));
Task1ECG
ECG Digital Signal Processing 4
Question 1
%Prepare X Axis f = (Fs1/N)*[-N/2:N/2-1]; figure(3); subplot(2,3,1) plot(normalSignal); subplot(2,3,2) plot(f,20*log10(fftnormalshift)) ,title('DFT of Normal ECG') ,xlabel('Frequency in Hz'),ylabel('Aplitude in dB'); grid; subplot(2,3,3) f = (Fs1/N)*[0:N/2-1]; plot(f,20*log10(fftnormal(1:N/2))) ,title('DFT of Normal ECG') ,xlabel('Frequency in Hz'),ylabel('Aplitude in dB'); grid; %=============== % 2-One Sample Signal %=============== N=350; samplenormalSignal=Learndata1(1,1:350); fftsamplenormalSignal = fft(samplenormalSignal,N); fftsamplenormalshift=fftshift(abs(fftsamplenormalSignal)); %Prepare X Axis f = (Fs1/N)*[-N/2:N/2-1]; subplot(2,3,4) plot(samplenormalSignal); subplot(2,3,5) plot(f,20*log10(fftsamplenormalshift)),title('DFT of one sample of Normal ECG') ,xlabel('Frequency in Hz'),ylabel('Aplitude in dB'); grid; subplot(2,3,6) f = (Fs1/N)*[0:N/2-1]; plot(f,20*log10(fftsamplenormalSignal(1:N/2))) ,title('DFT of one sample of Normal ECG') ,xlabel('Frequency in Hz'),ylabel('Aplitude in dB'); grid;
Task1ECG
ECG Digital Signal Processing 5
Question 1
DFT of normal ECG signal
Results:
The DFT of one signal is less spectrum density from all signals which means the 4 periodic ECG signals are not identically .
Discussions:
Task1ECG
ECG Digital Signal Processing 6
Question 1
2-VTachy , VCouplet , VBigEminy and Fibrilation Signals
Calculating the DFT of the all Signals By using Matlab Function FFT and plot it and compare it with DFT of one Signal
Methodology:
So instead of displaying DFT that goes from 0 to fs, it would be more appropriate to show the spectrum from fs/2 to fs/2 . This can be ccomplished by using Matlab's fftshift function as the following code demonstrates.
Task1ECG
ECG Digital Signal Processing 7
Question 1
VTachy
Matlab Code:
%=====================================================================% % VTachy signal %=====================================================================% %=====================================================================% % A: Fourier transform %=====================================================================% %=============== % 1-Total Signal %=============== N=1080; vTachySignal=Learndata1(129,:); fftvTachySignal = fft(vTachySignal,N); fftvTachySignalshift=fftshift(abs(fftvTachySignal)); %Prepare X Axis f = (Fs1/N)*[-N/2:N/2-1]; figure(3); subplot(2,3,1) plot(vTachySignal); subplot(2,3,2) plot(f,20*log10(fftvTachySignalshift)) ,title('DFT of VTachy signal') ,xlabel('Frequencyin Hz'),ylabel('Aplitude in dB'); grid; subplot(2,3,3) f = (Fs1/N)*[0:N/2-1]; plot(f,20*log10(fftvTachySignal(1:N/2))) ,title('DFT of VTachy signal') ,xlabel('Frequencyin Hz'),ylabel('Aplitude in dB'); grid; %=============== % 2-One Sample Signal %=============== N=350; samplevTachySignal=Learndata1(129,1:350); fftsamplevTachySignal = fft(samplevTachySignal,N); fftsamplevTachySignalshift=fftshift(abs(fftsamplevTachySignal)); %Prepare X Axis f = (Fs1/N)*[-N/2:N/2-1]; subplot(2,3,4) plot(samplevTachySignal); subplot(2,3,5) plot(f,20*log10(fftsamplevTachySignalshift)) ,title('DFT of one sample
Task1ECG
ECG Digital Signal Processing 8
Question 1
of VTachy signal') ,xlabel('Frequency in Hz'),ylabel('Aplitude in dB'); grid; subplot(2,3,6) f = (Fs1/N)*[0:N/2-1]; plot(f,20*log10(fftsamplevTachySignal(1:N/2))) ,title('DFT of one sample of VTachy signal') ,xlabel('Frequency in Hz'),ylabel('Aplitude in dB'); grid;
VCouplet
%=====================================================================% % VCouplet signal %=====================================================================% %=====================================================================% % A: Fourier transform %=====================================================================% %=============== % 1-Total Signal %=============== N=1080; vCoupletSignal=Learndata1(65,:); fftvCoupletSignal = fft(vCoupletSignal,N); fftvCoupletSignalshift=fftshift(abs(fftvCoupletSignal)); %Prepare X Axis f = (Fs1/N)*[-N/2:N/2-1]; figure(3); subplot(2,3,1) plot(vCoupletSignal); subplot(2,3,2) plot(f,20*log10(fftvCoupletSignalshift)) ,title('DFT of VCouplet signal') ,xlabel('Frequency in Hz'),ylabel('Aplitude in dB'); grid; subplot(2,3,3) f = (Fs1/N)*[0:N/2-1]; plot(f,20*log10(fftvCoupletSignal(1:N/2))) ,title('DFT of VCouplet signal') ,xlabel('Frequency in Hz'),ylabel('Aplitude in dB'); grid; %=============== % 2-One Sample Signal %===============
Task1ECG
ECG Digital Signal Processing 9
Question 1
N=350; samplevCoupletSignal=Learndata1(65,1:350); fftsamplevCoupletSignal = fft(samplevCoupletSignal,N); fftsamplevCoupletSignalshift=fftshift(abs(fftsamplevCoupletSignal)); %Prepare X Axis f = (Fs1/N)*[-N/2:N/2-1]; subplot(2,3,4) plot(samplevCoupletSignal); subplot(2,3,5) plot(f,20*log10(fftsamplevCoupletSignalshift)) ,title('DFT of one sample of VCouplet signal') ,xlabel('Frequency'),ylabel('Aplitude in dB'); grid; subplot(2,3,6) f = (Fs1/N)*[0:N/2-1]; plot(f,20*log10(fftsamplevCoupletSignal(1:N/2))) ,title('DFT of one sample of VCouplet signal') ,xlabel('Frequency'),ylabel('Aplitude in dB'); grid;
VBigEminy
%=====================================================================% % Vbigeminy signal %=====================================================================% %=====================================================================% % A: Fourier transform %=====================================================================% figure(2) %=============== % 1-Total periodic Signal %=============== N=1080; vBigeminySignal=Learndata1(197,:); fftvBigeminySignal = fft(vBigeminySignal,N); fftvBigeminySignalshift=fftshift(abs(fftvBigeminySignal)); %Prepare X Axis f = (Fs1/N)*[-N/2:N/2-1]; subplot(2,3,1) plot(vBigeminySignal); subplot(2,3,2) plot(f,20*log10(fftvBigeminySignalshift)) ,title('DFT of VBigeminy Signal') ,xlabel('Frequency'),ylabel('Aplitude in dB'); grid; subplot(2,3,3) f = (Fs1/N)*[0:N/2-1];
Task1ECG
ECG Digital Signal Processing 10
Question 1
plot(f,20*log10(fftvBigeminySignal(1:N/2))) ,title('DFT of VBigeminy Signal') ,xlabel('Frequency'),ylabel('Aplitude in dB'); grid; %=============== % 2-One Sample Signal %=============== N=350; samplevBigeminySignal=Learndata1(197,1:350); fftsamplevBigeminySignal = fft(samplevBigeminySignal,N); fftshiftsamplevBigeminySignal=fftshift(abs(fftsamplevBigeminySignal)); %Prepare X Axis f = (Fs1/N)*[-N/2:N/2-1]; subplot(2,3,4) plot(samplevBigeminySignal); subplot(2,3,5) plot(f,20*log10(fftshiftsamplevBigeminySignal)) ,title('DFT of one sample of VBigeminy Signal') ,xlabel('Frequency'),ylabel('Aplitude in dB'); grid; subplot(2,3,6) f = (Fs1/N)*[0:N/2-1]; plot(f,20*log10(fftsamplevBigeminySignal(1:N/2))) ,title('DFT of one sample of VBigeminy Signal') ,xlabel('Frequency'),ylabel('Aplitude in dB'); grid;
Fibrilation
Task1ECG
ECG Digital Signal Processing 11
Question 1
VTachy
Results:
Task1ECG
ECG Digital Signal Processing 12
Question 1
VCouplet
Vbiginy
Task1ECG
ECG Digital Signal Processing 13
Question 1
Fibrilation
Discussions:
Task1ECG
ECG Digital Signal Processing 14
Question 1
Task1ECG
ECG Digital Signal Processing 15
Question 1
ECG
Dig
ital
Sig
nal
Pro
cess
ing
Exam
Rep
ort
on E
CG D
FT S
igna
l Pro
cess
ing
Facu
lty O
f Eng
inee
ring
, Cai
ro U
nive
rsity
, Sys
tem
s an
d Bi
omed
ical
Eng
inee
ring
.
Elgh
arab
awy,
Aym
an
Task1ECG
ECG Digital Signal Processing 2
Question 2
Exam Report Exam Tasks :
1. Compute and display the DFT of ECG signals for normal, ventricular couplet, ventricular tachycardia, ventricular bigeminy, and ventricular fibrillation types. Compute the DFT for only one sample signal from each type.
2. Compute and display the power spectrum of ECG signals for normal, ventricular couplet, ventricular tachycardia, ventricular bigeminy, and ventricular fibrillation types. Use all signals and periodogram averaging to compute the power spectrum for each type.
3. It is desired to filter the ECG samples using a low pass filter with cut-off frequency of 38 Hz. Transition band must be not more than 10 Hz to avoid having the 50 Hz noise interfere with the signal. The attenuation of the stop-band must not be less than 35 dB. Design and compare the digital filter to meet these requirements using the following approaches:
a. FIR filters with 3 different windows (e.g., rectangular, Hamming, Kaiser, etc.)
b. IIR filter with 3 different approaches (e.g., Butterworth, Chebyshev, elliptic, etc.)
4. It is desired to compute the Fourier transformation of a normal ECG signal at two different frequency resolutions of 0.001 and 0.002 Hz starting from the original samples of one normal ECG signal. Design a signal processing method that enables you to do that.
Task1ECG
ECG Digital Signal Processing 3
Question 2
Task 2 Spectrum
1-Normal ECG Signal
Methodology:
Matlab Code:
Results:
Discussions:
2-VTachy , VCouplet and VBigEminy Signals
Task1ECG
ECG Digital Signal Processing 4
Question 2
Methodology:
Matlab Code:
Results:
Discussions:
Task1ECG
ECG Digital Signal Processing 5
Question 2