Find only peaks of interest

1 次查看(过去 30 天)
Sriram Guddati
Sriram Guddati 2019-5-9
I need to pick only the periodic peaks. Meaning I want peaks only in the circled region (because they are periodic) or other regions where the peaks are periodic. I don't want to pick any other peaks especially the ones with larger transtions. Can someone help me with this.
Capture.PNG

回答(1 个)

Star Strider
Star Strider 2019-5-9
Your best option is to use two separate calls to findpeaks with different 'MinPeakHeight' arguments for each. The first one would not have a 'MinPeakHeight' argument at all, and the second would be 0. Then use the setdiff function to retrieve the locations you want.
Example —
locs1 = 1:10; % All Peaks
locs2 = [1:3 7:10]; % Peaks With ‘'MinPeakHeight',0’
locsWanted = setdiff(locs1, locs2); % Desired Peaks
Once you have the ‘locs’, (here ‘locsWanted’)getting the peaks and whatever the independent variable values are for those peaks is just indexing into the various vectors using ‘locsWanted’ as the index. .

Community Treasure Hunt

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

Start Hunting!

Translated by