How to calculate the heart rate from an ECG signal?
조회 수: 131 (최근 30일)
이전 댓글 표시
Hi, I have for example this ecg signal from how I did the plot in time:
load 'sig.mat'
fs = 300;
t=linspace(0,length(sig)/fs,length(sig));
figure()
plot(t,sig/max(sig));
title('Signal in Time Domain');
xlabel('Time(s)');
ylabel('Amplitude');
And from the plot I roughly calculate in the x axis the time between one peak (R wave) to the other. That is circa 1.5 s. If the distance between two R peaks in an ECG is approximately 1.5 seconds, I calculate the heart rate based on that interval.
Converting 1.5 seconds to milliseconds:
1.5 seconds * 1000 = 1500 milliseconds
Now, we can calculate the heart rate:
Heart Rate = 60,000 / 1500 = 40 beats per minute
Therefore, with a distance between two R peaks of approximately 1.5 seconds, the heart rate would be around 40 beats per minute.
There is a more precice way to calculate the heart rate from an ECG signal?
Attention this signal is not filtered. Is better to filter first? And if so, how?
댓글 수: 1
Cris LaPierre
2023년 6월 15일
No need to convert to milliseconds
HeartRate = 60/1.5 % seconds/min * beats/sec = beats/min
답변 (1개)
Cris LaPierre
2023년 6월 15일
See this answer: https://www.mathworks.com/matlabcentral/answers/374766-determining-average-heart-rate-of-ecg-signal
There is also a tool for this in the File Exchange: https://www.mathworks.com/matlabcentral/fileexchange/73049-calculate-heart-rate-from-electrocardiogram-data
댓글 수: 2
Cris LaPierre
2023년 6월 15일
You will need to spend some time finding the appropriate settings for your findpeaks function call. It also wouldn't hurt to filter your signal, though with the prominence of the R peaks, that's proabably not necessary.
You may find this page helpful, too: https://www.mathworks.com/help/matlab/data_analysis/cleandatawithliveeditortasks.html
참고 항목
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!