Clear Filters
Clear Filters

Storing the peak values of a fft

4 views (last 30 days)
Gavin Lewis
Gavin Lewis on 12 Feb 2018
Commented: Gavin Lewis on 12 Feb 2018
I have produced a code that will analyse vibration data. What I want to do is record the peak values of the FFT and store them so I can produce a graph showing the peak values of various runs of vibration data.
  1 Comment
Adam
Adam on 12 Feb 2018
What is your problem in doing this? Isn't it just
max( abs( y ) )
where y is your fft result for a given input?

Sign in to comment.

Answers (1)

Matt
Matt on 12 Feb 2018
Hi Gavin
You can find local maxima by using the "findpeaks" function in MATLAB. Below is an example:
x = linspace(0,8*pi);
y = sin(x)./x;
[m,idx] = findpeaks(y);
plot(x,y)
hold on
plot(x(idx),y(idx),'ro')
hold off
You could apply this function to your fft output to find peaks.
Matt
  1 Comment
Gavin Lewis
Gavin Lewis on 12 Feb 2018
Thanks for the reply i keep getting this error = parse_inputs(isInMATLAB,Yin,varargin{:});

Sign in to comment.

Categories

Find more on Fourier Analysis and Filtering in Help Center and File Exchange

Tags

Community Treasure Hunt

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

Start Hunting!