axis labels not working
1 visualización (últimos 30 días)
Mostrar comentarios más antiguos
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 comentarios
Respuestas (1)
Walter Roberson
el 30 de Oct. de 2020
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 comentarios
Walter Roberson
el 30 de Oct. de 2020
The code is identifying the correct trough for me with the test data I created. Can you attach your data for testing?
Ver también
Categorías
Más información sobre Multirate Signal Processing en Help Center y File Exchange.
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!