Document From Kaviraj
Document From Kaviraj
REGISTRATION. NO.—12320324
ROLL NO.-36
[2] To understand how ECG signals works and how they tell us about
the heart health.
[3] Using MATLAB for analyzing the ECG data by filtering out the noise
and detecting important aspects of heart.
[4] To build a system of ECG signals analysis that can help us identify
irregular problems related to heart.
[5] To explore how ECG systems can be used in real –time heart health
monitoring.
[7] To learn how the technology can help us in early detection of heart
related problems and take required actions.
METHODOLOGY
STEP 1: DATA COLLECTION
First of all we need the data from like csv file or open source database because .dat file need Waveform
Database which is not supported by 2015 version of MATLAB. This data will help us for testing purposes
on software.
We need filters like bandpass filters and notch filters for cleaning the signal because in real world ECG
signals have noise which is caused by muscle movement or power line interference {50 to 60 hz} or poor
electrode placement. Noise can hide the R- peak or distort the signal. Filtering can give us the accurate
detection of heartbeats.
Bandpass filter—removes the low frequency drift and high frequency drift.
After the signal is noise free or cleaned, we extract the features from ECG waveform like P WAVE, QRS
COMPLEX, T WAVE AND RR INTERVAL.
The time difference between the R- peaks is called the RR interval. The formula for to calculate the heart
rate is HEART RATE=60/RR INTERVALS (IN SEC).
This formula can help us to find out whether the person has slow heartbeat (bradycardia) , fast
heartbeat (tachycardia) or a normal heart rate.
Heart rate variability [HRV] is the variation in time between heartbeats. Sudden or uncertain changes in
HRV can be a sign of stress, arrhythmia or the heart conditions.
In this, we analyze the RR INTERVALS for unusual patterns like skipped beat or irregular spacing between
QRS complexes.
In this, we plot the ECG signal and highlight the detected features (e.g. R- PEAKS) using MATLAB
In this final step, we study the analysis of the result and interpret what the data means.
FLOWCHART
CODE FOR MATLAB
clc;
clear;
close all;
low_cutoff = 0.5; % Hz
high_cutoff = 40; % Hz
'MinPeakDistance', minPeakDist);
heart_rate = 60 ./ RR_intervals;
avg_heart_rate = mean(heart_rate);
subplot(2,1,1);
plot(t, ecgSignal);
xlabel('Time (s)');
ylabel('Amplitude');
subplot(2,1,2);
plot(t, filtered_ecg);
xlabel('Time (s)');
ylabel('Amplitude');
figure;
plot(filtered_ecg);
hold on;
title(['ECG Signal with R-peaks | Avg HR: ' num2str(avg_heart_rate, '%.2f') ' bpm']);
xlabel('Sample Number');
ylabel('Amplitude');
legend('Filtered ECG','R-peaks');
fprintf('Min HR: %.2f bpm | Max HR: %.2f bpm\n', min(heart_rate), max(heart_rate));
The red dots are marking the R-peaks . This indicates that R-peaks detection is working.
Heart rate is 72.72 bpm which is normal resting heart rate range (60-100 bpm).
The ECG waveform is clean and periodic which is achieved by bandpass filters.
The x –axis is marked as “sample number” which can be converted into sampling frequency by
using the t= (0:length (ecg)-/fs;
The project helped us understanding the working raw data of ECG processing and
interpretation .
CONLUSION
In this project, I successfully used MATLAB to analyze ECG signals and monitor
heart health. Starting from raw ECG data, I applied filtering techniques to clean
the signal and then used an algorithm to detect R-peaks — the sharp spikes that
occur with every heartbeat. These R-peaks helped us calculate the heart rate,
which came out to be around 72.72 beats per minute — a healthy, normal value
for a resting heart. The red dots marking the R-peaks made it easy to visualize
how well the detection worked, and the overall waveform showed clear,
repeating patterns of the heart's electrical activity. This kind of analysis is useful
not just for learning, but also as a base for more advanced applications like
detecting irregular heartbeats or building a live monitoring system using sensors.
Overall, the project showed how MATLAB can be a powerful tool for turning raw
biosignals into meaningful insights about heart health in a simple
and effective way.
This project not only helped in understanding how ECG signals work, but also gave
a hands-on experience in using MATLAB for real-world biomedical applications.
One of the most satisfying parts was seeing how a bunch of data points could be
cleaned up, processed, and turned into something that actually tells us about a
person’s heart. It was interesting to learn how even small peaks in the signal can
carry so much important information. Working on this also gave a better
understanding of concepts like signal filtering, peak detection, and heart rate
variability, which are often taught in theory but rarely felt so real. It also showed
how powerful and practical tools like MATLAB can be when applied to health
monitoring. This has opened up ideas for future work, like maybe developing a
mobile-based real-time ECG system or adding machine learning to detect heart
abnormalities. Most importantly, the project gave a sense of how technology and
healthcare can come together to potentially make life-saving tools.
GRAPHS
REFERENCE
GOOGLE SCHOLARS
Study and Analysis of ECG Signal Using MATLAB & LABVIEW as Effective Tools M. K. Islam, A. N. M. M.
Haque, G. Tangim, T. Ahammad, and M. R. H. Khondokar, Member, IACSIT