See discussions, stats, and author profiles for this publication at: https://www.researchgate.
net/publication/351528340
Processing of ECG signals with MATLAB program
Method · May 2021
DOI: 10.13140/RG.2.2.26681.08807
CITATIONS READS
0 5,283
1 author:
Zahra Abdolali Kazemi
Hochschule Düsseldorf
6 PUBLICATIONS 2 CITATIONS
SEE PROFILE
All content following this page was uploaded by Zahra Abdolali Kazemi on 12 May 2021.
The user has requested enhancement of the downloaded file.
Processing of ECG signals with MATLAB program
Researcher: Zahra AbdolAli Kazemi
The ECG signals were recorded from 92 patients (27 were female). Each recording is segmented
to ten-second sections. As the total recording duration was different for each participant, the
number of segments per patient ranges from one to thirty-one. The total number of ten-
second segments is 540 for all patients. The average age of the patient population is 65.23 years.
First we will have the initial signal as shown below:
Fig1. The initial signal received from the patient with arrhythmia
Draw a period from the above signal: First we determine the sampling frequency, for example
1000 Hz, and we determine the periodicity of 500. To determine a periodicity, we use the
following program. Here, the period of T multiplied by 1000 Hz represents the selection of a
periodicity of the above alternating signal.
clc
clear
close all
load('ecg lab2.mat')
fs=1000;
T=500;
x= ecg(:,1:T*1000);
t=1/fs:1/fs:T;
plot(t,x)
fig2. selection of a periodicity of the above alternating initial signal.
Use the following commands to remove frequencies less than 0.5 and then draw the signal again.
× 10−3
load('ecg lab2.mat')
fs=500;
m=length(ecg);
fy=fft(ecg,m);
p=(0:(m-1))*(fs/m);
k=(abs(fy))/(500);
plot(p,k)
r=find(p<50);
r=0;
ecg1=ifft(k);
plot(ecg1)
fig3. Signal after passing the low-pass filter
As you can see, the ecg signal is accompanied by noise, and this noise must be eliminated or
minimized as much as possible so that we can perform our desired processing on the signal. To
remove noise, we need to have noise information and be able to delete the noise information to
reduce the noise. But we do not have any previous noise information and we have to get this
information somehow. A simple way is to take the signal to the frequency domain and see at
what frequencies the noise occurred.
load('ecg lab2.mat')
fs=500;
fy=fft(ecg);
m=length(ecg);
p=(fy(1:floor(m/2)+1));
n=linspace(0,fs/2,m/2+1);
figure
plot(n,abs(p))
[b,a]=butter(3,[1 50]/(fs/2),'bandpass');
signal1=filtfilt(b,a,ecg);
subplot(2,1,1)
plot(ecg(1:1500,1),'b','linewidth',1)
title('orginal sinal')
subplot(2,1,2)
plot(signal1(1:1500),'m','linewidth',2)
title('ecg2')
fig4. Isolated signal noise
As you can see, the noise occurred at frequencies above 50 Hz, so if we can delete information
about frequencies above 50 Hz, we will most likely eliminate the noise.
To delete this information, we can use both the transient filter and the low pass filter, or we can
delete the information between 5 Hz and fs /2 with the transient filter.
And thus the desired signal is as follows:
Fig5. The final signal
View publication stats