Escolar Documentos
Profissional Documentos
Cultura Documentos
Elgharabawy, Ayman
ECG Digital Signal Processing
Question 1
Task1ECG
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.)
Question 1
Methodology:
Calculating the DFT of the all Signals By using Matlab Function FFT and plot
it and compare it with DFT of one Signal
Matlab Code:
%=========================================================%
% A: Fourier transform
%=========================================================%
%===============
% 1-Total Signal
%===============
N=1080;
normalSignal=Learndata1(1,:);
fftnormal = fft(normalSignal,N);
fftnormalshift=fftshift(abs(fftnormal));
ECG Digital Signal Processing
Question 1
Task1ECG
4
%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;
ECG Digital Signal Processing
Question 1
Task1ECG
5
Results:
DFT of normal ECG signal
Discussions:
The DFT of one signal is less spectrum density from all signals which means the 4
periodic ECG signals are not identically .
ECG Digital Signal Processing
Question 1
Task1ECG
6
Methodology:
Calculating the DFT of the all Signals By using Matlab Function FFT and plot
it and compare it with DFT of one Signal
Matlab Code:
VTachy
%=====================================================================%
% 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
ECG Digital Signal Processing
Question 1
Task1ECG
8
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
%===============
ECG Digital Signal Processing
Question 1
Task1ECG
9
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];
ECG Digital Signal Processing
Question 1
Task1ECG
10
%===============
% 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
ECG Digital Signal Processing
Question 1
Task1ECG
11
Results:
VTachy
ECG Digital Signal Processing
Question 1
Task1ECG
12
VCouplet
Vbiginy
ECG Digital Signal Processing
Question 1
Task1ECG
13
Fibrilation
Discussions:
ECG Digital Signal Processing
Question 1
Task1ECG
14
ECG Digital Signal Processing
Question 1
Task1ECG
15
ECG Digital Signal Processing
Exam Report on ECG DFT Signal Processing
Elgharabawy, Ayman
ECG Digital Signal Processing
Question 2
Task1ECG
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.)
Task 2 Spectrum
Methodology:
Matlab Code:
Results:
Discussions:
Methodology:
Matlab Code:
Results:
Discussions:
ECG Digital Signal Processing
Question 2
Task1ECG
5