how to find the peaks between the local maxima and local minima

11 ビュー (過去 30 日間)
abdullah felfel
abdullah felfel 2022 年 7 月 1 日
コメント済み: abdullah felfel 2022 年 7 月 2 日
hi, can someone help figure out how to find the peaks that are placed in between the peaks and valleys?
here is the code i used to find the maxima and minima using the first derivative of my pzpg singal
[pks , locs] = findpeaks(ndy,'MinPeakProminence',0.4);
[npks , nlocs] = findpeaks(-ndy,'MinPeakProminence',0.4);
figure(14)
plot(T(locs), pks,'x')
hold on;
plot(T(nlocs), -npks,'o')
shg
hold on;
plot(T ,ndy);title ('local maxima, notch and minima');xlabel('time');ylabel('amplitude')
what im trying to do next is to find the peaks between the maxima (X) and the minima (O)

採用された回答

Image Analyst
Image Analyst 2022 年 7 月 1 日
Try getting rid of minpeakprominence so that you find all peaks.
  5 件のコメント
Image Analyst
Image Analyst 2022 年 7 月 1 日
Find all the peaks and then delete the peaks that have a value more than 0.6:
% First find all peaks
[peakValues, indexesOfPeakValues] = findpeaks(ndy);
% Find out which peaks have a peak value less than 0.6.
goodPeaks = peaksValues < 0.6;
% Get the times at those peak indexes.
tPeaks = T(indexesOfPeakValues);
% Now keep only the good ones.
peakValues = peakValues(goodPeaks);
% Extract the same indexes from our time vector.
tPeaks = tPeaks(goodPeaks);
If you have any more questions, then attach your data and code to read it in with the paperclip icon after you read this:
abdullah felfel
abdullah felfel 2022 年 7 月 2 日
thank you my good sir this is what i need

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

その他の回答 (0 件)

カテゴリ

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

製品


リリース

R2021b

Community Treasure Hunt

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

Start Hunting!

Translated by