Você está na página 1de 20

# ECG Digital Signal Processing

## Faculty Of Engineering, Cairo University, Systems and Biomedical Engineering.

Elgharabawy, Ayman
ECG Digital Signal Processing
Question 1
2

Exam Report

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.)

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.
ECG Digital Signal Processing
Question 1
3

Question 1

## 1-Normal ECG Signal

Methodology:

Calculating the DFT of the all Signals By using Matlab Function FFT and plot
it and compare it with DFT of one Signal

## 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));
ECG Digital Signal Processing
Question 1
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
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
6

## 2-VTachy , VCouplet , VBigEminy and Fibrilation Signals

Methodology:

Calculating the DFT of the all Signals By using Matlab Function FFT and plot
it and compare it with DFT of one Signal

## 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.
ECG Digital Signal Processing
Question 1
7

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
8

## 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
%===============
ECG Digital Signal Processing
Question 1
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
10

## 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
ECG Digital Signal Processing
Question 1
11

Results:

VTachy
ECG Digital Signal Processing
Question 1
12

VCouplet

Vbiginy
ECG Digital Signal Processing
Question 1
13

Fibrilation

Discussions:
ECG Digital Signal Processing
Question 1
14
ECG Digital Signal Processing
Question 1
15
ECG Digital Signal Processing
Exam Report on ECG DFT Signal Processing

## Faculty Of Engineering, Cairo University, Systems and Biomedical Engineering.

Elgharabawy, Ayman
ECG Digital Signal Processing
Question 2
2

Exam Report

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.)

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.
ECG Digital Signal Processing
Question 2
3

Methodology:

Matlab Code:

Results:

Discussions:

## 2-VTachy , VCouplet and VBigEminy Signals

ECG Digital Signal Processing
Question 2