Azzera filtri
Azzera filtri

Identify time interval where values are greater than a threshold

23 visualizzazioni (ultimi 30 giorni)
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 Commento
dpb
dpb il 15 Set 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...

Accedi per commentare.

Risposte (1)

Walter Roberson
Walter Roberson il 15 Set 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 ... ?

Categorie

Scopri di più su MATLAB in Help Center e File Exchange

Prodotti


Release

R2017b

Community Treasure Hunt

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

Start Hunting!

Translated by