I cannot define proper equations to return onset time and the relative difference between a valley and the next peak. What is the common used notation for a time series? I have been struggling with set theory and index sets.
Main challenges are to say how many significant peaks exist in a window and what in the onset time of the first significant peak.
I thought about a set S and a set T (which should be ordered and finite, i.e. starting in 1 and finishing in 10). Then, I would store peaks in P and valleys in V and the time indices in TP and TV, respectively, as follows:
π=π‘πππ
π=π πππππ
πΌ=πΌππππ₯ π ππ‘ ππ π πππ π
π=πππππ ={ ππ β π | (ππ > ππβ1) β (ππ β₯ ππ+1) }
π=π£πππππ¦π ={ ππ β π | (ππ β€ ππβ1) β (ππ < ππ+1) }
ππ=π‘πππ ππ πππππ = { ππ β πβΆ β ππ β π | (ππ > ππβ1) β (ππ β₯ ππ+1) }
ππ=π‘πππ ππ π£πππππ¦π = { ππ β πβΆ β ππ β π | (ππ β€ ππβ1) β (ππ < ππ+1) }
π½=πππππ₯ π ππ‘ ππ π πππ ππ
πΎ=πππππ₯ π ππ‘ ππ π πππ ππ
Then, I would look for pairs of valleys and peaks with a difference greater than a threshold, for peaks that are preceded by a valley, as follows:
π ={π₯ β R* | {ππβππ, ππ π β π½ βΆ π=πππ₯(π½<π) β ππβππ β₯ π‘βπ
β
, ππ β πππ β ππ βΆ πππ < πππ
β
, ππ β πππ β ππ βΆ πππ < πππ
}.
ππ ={πππ β R* | {πππ, ππ ππβππ β₯ π‘βπ
β
, ππ β πππ β ππ βΆ πππ < πππ
β
, ππ β πππ β ππ βΆ πππ < πππ
}.
Note: π=πππ₯(π½<π) should stands for the maximum π β π½ which is still lower than k. This way we consider only the closest valley just prior to the peak, but I guess the notation is wrong.
Then I can count the significant responses as the cardinality of R. And the onset of the first significant response would be the first element of the finite ordered set TR.
Are the notations right? I'm not sure about that.