File Exchange

image thumbnail

ECG Beat Calculation

version 1.1 (1.53 KB) by

Calculates ECG beats per minute

9 Ratings



View License

This program calculates the beats per minute of of an ECG signal. The data file can be any text format. The output will be an averaged value, since normal ecg of a person is not always constant. There maybe drifts and variations. The percentage error for six seconds of the ecg will be 60/sampling frequency.

Comments and Ratings (14)

what is the sampling rate you are using?

Xuesong Niu

niu bao


Julie Nevins

Thank you for this very useful code! Is there a way to output the latency of the R peaks (or any part of the PQRS wave) from this code?

menaka mohan


i am new in matlab.
i have a heart rate signal and i want to measure distance between two peak to get heart rate. so how can i measure distance?

thanks for help


ramya (view profile)

how to get ecg signal beat calculation file pls anybody help me

Aura Silva

Aruni Fonseka

I think this is a good program

Aruni Fonseka

Arun Kumar

Arun Kumar (view profile)



Now the code can read data in any text format. There was a drift error in the calculation which has been corrected to obtain more accurate beat value.

MATLAB Release
MATLAB 7.4 (R2007a)

Inspired: ECG QRS Detection

Download apps, toolboxes, and other File Exchange content using Add-On Explorer in MATLAB.

» Watch video