Continue to Site

Eng-Tips is the largest engineering community on the Internet

Intelligent Work Forums for Engineering Professionals

  • Congratulations waross on being selected by the Eng-Tips community for having the most helpful posts in the forums last week. Way to Go!

Finding the second peak

Status
Not open for further replies.

Star1976

Materials
Jan 31, 2005
6
Hi
I am facing a trouble in locating the second maximum peak in FFT spectrum. I used the following to find the maximum peak but was not able to find the second peak..

X = abs(fft(Ei));
X = fftshift(X);
Peak = find(X == max(X));

Any help is appreciated !!!
 
Replies continue below

Recommended for you

Assuming you aren't looking for local maxima (i.e. the second highest local maxima), just sort X:

[Xs,idx]=sort(X);

Peak1 = idx(1)
Peak2 = idx(2)
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor