Mar 13, 2006 #1 Star1976 Materials Joined Jan 31, 2005 Messages 6 Location GB 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 !!!
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 !!!
Mar 14, 2006 #2 SomptingGuy Automotive Joined May 25, 2005 Messages 8,922 Location GB 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) Upvote 0 Downvote
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)