How do I take the phase difference of oscillators across time
Best Answer
It depends on whether the phase relationship is constant or changes, and what the data are. If it is constant, calculating them is relatively straightforward using Product-to-sum and sum-to-product identities, and other relationships.
With your data being 20000 x 50 my guess is that you have 20000 measurements for each of 50 entities, rather than 50 measurements for each of 20000 entities. If I am correct, then you would want the y gradient:
xstep = 1; %doesn't really matter, we are going to ignore
To get the peaks (and their locations and some other characteristics on them) use thefindpeaks (link) function. You can then do whatever statistics you want to on them.
Thegradient (link) function can calculate the instantaneous derivatives of your data to get the slopes.
You might also find theenvelope (link) function helpful.
I do not understand what you want with‘the slopes of all the peak amplitude’. The peak amplitude of any given peak would be a point, so the slope would be undefined.
Best Answer