How to determine fundamental frequencies (beats/minute) of heartbeat? (matlab)
I would suggest processing the ECG signal through a standard QRS detection algorithm (e.g. Pan-Tompkins). Once you have isolated the QRS complexes in your ECG signal, you can simply count them, divide by the duration of your ECG signal, and convert to beats/min. Here is one implementation of Pan-Tompkins: https://www.mathworks.com/matlabcentral/fileexchange/45840-complete-pan-tompkins-implementation-ecg-qrs-detector. I am sure you can find others on physionet.