How do I find the right peaks?

1 view (last 30 days)
Orville
Orville on 24 Jul 2014
Commented: Image Analyst on 24 Jul 2014
I need to find the two peaks that are shown below in red. The graph on the left is a periodogram.
I tried to do smoothing using the pwelch('Tukey') method (shown to the right of the periodogram), but I only get one peak in the area from 100 to 400 hz rather than the two peaks. I've tried other smoothing methods as well, with similar results. Any suggestions?

Answers (2)

Azzi Abdelmalek
Azzi Abdelmalek on 24 Jul 2014

Image Analyst
Image Analyst on 24 Jul 2014
Use findpeaks in the Signal Processing Toolbox. But since you did not say how general this must be and how varied the data are, you can get then for just the specific signal you gave by saying
% Find indexes of peaks around 130, 320, and 800
[~, indexesOfPeaks] = find(yourSignal > someValue);
indexesOfPeaks(indexesOfPeaks>400) = []; % Eliminate any peaks with x>400
I don't know what someValue is because you did not show the values along the Y axis.
  3 Comments
Wayne King
Wayne King on 24 Jul 2014
Do you have a priori knowledge about what part of the frequency range you want to limit your search to? Can you attach your time data along with the sampling frequency
Image Analyst
Image Analyst on 24 Jul 2014
Your peaks are extremely narrow (if you want those two precise thin lines you pointed to) so any smoothing will obliterate them. If you just want kind of the centroid of the hump, then you can smooth them, say with sgolayfilt() in the Signal Processing Toolbox, which find peaks is also in. Do you have that toolbox?

Sign in to comment.

Community Treasure Hunt

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

Start Hunting!