Effacer les filtres
Effacer les filtres

How do I Identify the intervals between heart sound S1 and heart sound S2? :/

1 vue (au cours des 30 derniers jours)
John Hubert
John Hubert le 29 Sep 2013
Commenté : Walter Roberson le 29 Sep 2013
In the picture, I need to find the intervals/position of red marked and orange marked using MATLAB. Kindly help me. :(
  3 commentaires
Image Analyst
Image Analyst le 29 Sep 2013
In the future, it would help people help you if you attached an m-file that generated your signal.
Walter Roberson
Walter Roberson le 29 Sep 2013
The values between the marks are not 0, but they are within a certain tolerance of 0, are they not? abs() of the signal is less than some constant? If you look at my line of code
hassilence = [false, (abs(YourSignal) < NoiseTolerance), false];
notice that it is not testing for 0 but rather that it is within some fixed bounds for the silence. To guard against the possibility that the signal might be near that value as it crosses between negative and positive, my code requires a number of consecutive points within those bounds; the number of consecutive points needed is controlled by my variable "min_interval_size".

Connectez-vous pour commenter.

Réponses (1)

Walter Roberson
Walter Roberson le 29 Sep 2013
hassilence = [false, (abs(YourSignal) < NoiseTolerance), false];
min_interval_size = 5; %adjust as needed
intervals_begin = strfind([false true(1,min_interval_size)], hassilence);
intervals_end = strfind([true(1,min_interval_size), false], hassilence);
Now, if intervals_begin(1) is 1, then the signal started with silence, and the first non-silence is at position (intervals_end(1) + min_interval_size - 1); each silence interval starts at (intervals_begin(K)) and ends at (intervals_end(K) + min_interval_size - 1). If the two vectors intervals_begin and intervals_end are not the same length then the signal ends with silence with signal position (intervals_begin(end)) not indicating anything useful.
If intervals_begin(1) is not 1, then the signal starts with noise, and I leave it to you to figure out the correspondences between the pairs. Just keep in mind that the position found in intervals_begin(K) will exactly match the location of the beginning of silence in the signal, but the positions found in intervals_end(K) need to be adjusted to find the corresponding location in the signal array.

Catégories

En savoir plus sur ECG / EKG dans Help Center et File Exchange

Community Treasure Hunt

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

Start Hunting!

Translated by