×
INTELLIGENT WORK FORUMS
FOR ENGINEERING PROFESSIONALS

Log In

Come Join Us!

Are you an
Engineering professional?
Join Eng-Tips Forums!
  • Talk With Other Members
  • Be Notified Of Responses
    To Your Posts
  • Keyword Search
  • One-Click Access To Your
    Favorite Forums
  • Automated Signatures
    On Your Posts
  • Best Of All, It's Free!
  • Students Click Here

*Eng-Tips's functionality depends on members receiving e-mail. By joining you are opting in to receive e-mail.

Posting Guidelines

Promoting, selling, recruiting, coursework and thesis posting is forbidden.

Students Click Here

Jobs

Finding the second peak

Finding the second peak

Finding the second peak

(OP)
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 !!!

RE: Finding the second peak

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)

Red Flag This Post

Please let us know here why this post is inappropriate. Reasons such as off-topic, duplicates, flames, illegal, vulgar, or students posting their homework.

Red Flag Submitted

Thank you for helping keep Eng-Tips Forums free from inappropriate posts.
The Eng-Tips staff will check this out and take appropriate action.

Reply To This Thread

Posting in the Eng-Tips forums is a member-only feature.

Click Here to join Eng-Tips and talk with other members!


Resources