How to find the R peaks in QRS complexes

3 visualizzazioni (ultimi 30 giorni)
Mohammed Alqanber
Mohammed Alqanber il 7 Ott 2016
Commentato: Star Strider il 7 Ott 2016
Hi,
I'm trying to write a code to load an ECG data and plot it. Also time scale it. However there is one last step that i could not do. I need to find the peaks R in all QRS complex in the given ECG data file. then use that information to calculate heart rate per minute in each case (original case, time compression, time expansion) using the correct time for each case.
the Code is below
clear;close all;clc;
load('ECGnormal.txt');
x=ECGnormal (1:250,1); %selecting the patients ECG data
t=0:1/250:1-1/250; %original time duration with Fs=250
figure(1);
subplot (2,1,1)
plot(t,x,'LineWidth',2);grid on;hold on;xlim auto;
title('Patient Electrocadriogram (ECG)');ylabel('Voltage (mV)');xlabel('Time (sec)');
legend('Original ECG');
% Time Compression: alpha=2
tcompressed=t/2;
subplot (2,2,3)
plot(tcompressed,x,'LineWidth',2);grid on;hold on;xlim auto;
title('Time-Compressed ECG');ylabel('Voltage (mV)');xlabel('Time (sec)');
legend('Time-Compressed ECG');
% Time Expansion: alpha=1/2
texpanded=2*t;
subplot (2,2,4)
plot(texpanded,x,'LineWidth',2);grid on;xlim([0 2]);
title('Time-expended ECG');ylabel('Voltage (V)');xlabel('Time (sec)');
legend('Time-Expended ECG');
%Determining the peaks in all the QRS complexes
  1 Commento
Star Strider
Star Strider il 7 Ott 2016
You don’t seem to post the part of your code that finds the peaks.
It would be necessary to see the EKG you are working with. Depending on the lead, the R-wave can be difficult to identify using simple thresholding. This can also be a problem in various disease states, but since your file is ‘ECGnormal.txt’, we can probably rule out pathology.

Accedi per commentare.

Risposte (1)

Massimo Zanetti
Massimo Zanetti il 7 Ott 2016
Here you cannot use built in matlab function findpeaks, because it works only in 1D. To work in 2D use this:

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by