Peak to Peak Value of Sinusoidal Grad

13 ビュー (過去 30 日間)
k
k 2020 年 3 月 31 日
コメント済み: Star Strider 2020 年 3 月 31 日
I have a sinusoidal position vs. time graph. The graph is from time t=0s to t=40s. I need to caluclate the peak to peak amplitude between each of the peaks from 10 to 20 seconds. How would I do this?
I tried doing X1 = peak2peak(time) where X1 is the position values on the y axis of my graph, but it only returns one value.

回答 (1 件)

Star Strider
Star Strider 2020 年 3 月 31 日
Use the islocalmax function to find the maxima, islocalmin to find the minima, and go from there. (These functions were introduced in R2017b.)
  2 件のコメント
k
k 2020 年 3 月 31 日
I have R2016a
Star Strider
Star Strider 2020 年 3 月 31 日
Then use the Signal Processing Toolbox findpeaks function. To detect the peaks, use it normally, to detect the valleys,use findpeaks on the negated signal.
[pks,pklocs] = findpeaks(signal);
[vys,vylocs] = findpeaks(-signal);
Remember that the amplitudes of the valleys (the ‘vys’ variable) are the negatives of the returned values. The locations of both are valid regardless, and do not need to be changed.

サインインしてコメントする。

カテゴリ

Help Center および File ExchangeDescriptive Statistics についてさらに検索

タグ

Community Treasure Hunt

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

Start Hunting!

Translated by