Effacer les filtres
Effacer les filtres

Identify time interval where values are greater than a threshold

23 vues (au cours des 30 derniers jours)
Ahmed Hassan
Ahmed Hassan le 14 Sep 2018
Hi,
I have a time series and I need to identify the total time interval where the values are greater than certain threshold, either positive or negative.
Any idea what's the best command to use? I'm trying to use find but I don't see how to get it work in complicated cases (like when the signals exceeds the threshold and comes back several times).
  1 commentaire
dpb
dpb le 15 Sep 2018
What's the definition of exceedance--all time irregardless of how long or many interruptions in being above threshold or something else?
ix=v>threshold;
is the logical addressing vector that will return all elements that are over the threshold; how to determine a time associated would depend on whether is regularly-sampled time series or irregular clock times or...

Connectez-vous pour commenter.

Réponses (1)

Walter Roberson
Walter Roberson le 15 Sep 2018
Simple case:
nnz(YourTimeseries.Data > threshold)
This is a count. If you needed to convert it to time, then you would multiply by the interval between samples, assuming that interval is constant.
The expressions would be more complicated if you wanted to check that values are within a range (or outside of a range).
If the intervals are not constant and you need to find the time interval, then you need to define how you want to handle transitions. If the condition is not met at time t1, but is met at adjacent time t2, then do you want to assume that the condition become true half way between t1 and t2, or should you allocate the whole of t2-t1 as being part of the interval, or do you want to look at the values at those times and calculate the slope to figure out when the boundary was crossed, or ... ?

Catégories

En savoir plus sur MATLAB dans Help Center et File Exchange

Produits


Version

R2017b

Community Treasure Hunt

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

Start Hunting!

Translated by