Missing points before and after the R peaks

1 回表示 (過去 30 日間)
Ioana Cretu
Ioana Cretu 2021 年 2 月 9 日
コメント済み: darova 2021 年 2 月 9 日
I have a signal which I want to segment in heartbeats. I have the location of the R peaks and want to create a sliding window which takes 100 points before and 100 points after each peak, but before the first beat are just 78 points and after the last peak are also less than 100.
How can I avoid those peaks and just select the beats that have enough points before an after the R-peak?
  4 件のコメント
Rik
Rik 2021 年 2 月 9 日
Don't you mean a for-loop? If that is the case you could compute the indices first and use continue if any of them is invalid.
Ioana Cretu
Ioana Cretu 2021 年 2 月 9 日
sorry I used a for loop, idk why I wrote if

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

回答 (1 件)

Rik
Rik 2021 年 2 月 9 日
Something like this is what I meant:
before=100; after=100;
for n=1:numel(qrs_i)
ind=(qrs_i(n)-before):(qrs_i(n)+after);
if ind(1)<1 || ind(end)>numel(ECG), continue, end
beat(n,:)=ECG(ind);
end
  2 件のコメント
Ioana Cretu
Ioana Cretu 2021 年 2 月 9 日
Thank you Rik! This is exactly what I needed
darova
darova 2021 年 2 月 9 日

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

カテゴリ

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