I have some data, that basically looks like a sine wave. I run that through the peak detection function to find the peaks and mins of the data:
[Maxima,MaxIdx] = findpeaks(Peak,'MinPeakHeight',mean(Peak),'MinPeakDistance',10);
Mins=1.01*max(Peak)-Peak;
[Minima,MinIdx] = findpeaks(Mins,'MinPeakHeight',mean(Mins),'MinPeakDistance',10);
Minima = Peak(MinIdx);
What I would like to do is calculate the slope between each peak and trough, and then use that slope to calculate a time weighted average minimum value and see how that method compares to the minimum value. How would I go about this?
was asked to show some data:-