Can anyone help me run this code to detect the R peaks in my ecg signal and then modify it to obtain the bpm?

1 回表示 (過去 30 日間)
%clear stuff
clf
clear
clc
%Load the ECG/EKG data
EKG = load('Child_E1SISO.mat')
EKG = struct with fields:
Child_E1: [2500×1 double]
EKG_1 = EKG.val(1,:);
Unrecognized field name "val".
EKG_2 = EKG.val(2,:);
%time step vector
ts = (0:10/length(EKG_1):10-10/length(EKG_1));
%plot data
plot(ts, EKG_1)
hold on;
title('EKG Data (Channel 1)')
xlabel('Time (in seconds)')
ylabel('EKG amplitude')
%[PkAmp, PkTime] = findpeaks(Displacement)
[PkAmp, PkTime] = findpeaks(EKG_1, 'MinPeakHeight', 1100);
Actual_Time = PkTime/length(EKG_1);
I am trying to get the Rpeaks and then obtain the heart rate of the signal in bpm.
  2 件のコメント
Cris LaPierre
Cris LaPierre 2023 年 5 月 16 日
Child_E1SISO.mat does not contain a variable named val, and the variable that it does contain (Child_E1) only has a single column of data.
Rafia Noshin
Rafia Noshin 2023 年 5 月 16 日
As far as i know this is the logic behind finding the bpm by detecting the R peaks first using the matlab built in function. Could you kindly tell me how to proceed otherwise? I want to find the Rpeaks and hence the bpm of this ecg file specifically.

サインインしてコメントする。

回答 (1 件)

Cris LaPierre
Cris LaPierre 2023 年 5 月 16 日
I'd suggest doing this interactively in a live script using the Find Local Extrema live task. There, you can interactively adjust the settings until you obtain the points you want, and then either turn that into code, or just work with the output.

カテゴリ

Help Center および File ExchangeDescriptive Statistics についてさらに検索

Community Treasure Hunt

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

Start Hunting!

Translated by