axis labels not working
1 回表示 (過去 30 日間)
古いコメントを表示
Basically I was trying to do a while loop to find the s point of a qrs signal that has already filtered. I tried to use the statement provided below to find the S component, however it gave me the error that,." Index exceeds the number of array elements (1)". Was hoping someone could tell me what was wrong with while loop.
Thanks
%Simplied Version of previous stuff
ECG_Raw=Orig_Sig;
t=length(ECG_Raw);
[AmpRC,TimeRC]=findpeaks(Orig_Sig,'MinPeakDistance',120,'MinPeakHeight',150);
TimeR=TimeRC';
% While loop statement which I am having problems with
current=TimeR(1);
next=current+1;
while Orig_Sig(current)>=Orig_Sig(next)
current=next;
next=next+1;
end
plot(t(current),Orig_Sig(current))
0 件のコメント
回答 (1 件)
Walter Roberson
2020 年 10 月 30 日
Suppose there is only one peak detected, and that everything from there on is non-increasing.
*
/ \
\
----
and the position of the * is returned. Then for each point from there on, the signal value at the "current" point is >= the signal value of the "next" point. So as you move forward looking for an increase back, you run off the end of the array.
Now, that is a general problem with your algorithm. However you also have the much more specific problem that for some reason your Orig_Sig is only a single sample long.
2 件のコメント
Walter Roberson
2020 年 10 月 30 日
The code is identifying the correct trough for me with the test data I created. Can you attach your data for testing?
参考
カテゴリ
Help Center および File Exchange で Multirate Signal Processing についてさらに検索
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!