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_1 = EKG.val(1,:);
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
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.
回答 (1 件)
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.
0 件のコメント
参考
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!