Code covered by the BSD License  

Highlights from
Automated Failure Boundary Mapping

image thumbnail
from Automated Failure Boundary Mapping by Stuart Kozola
Demo files from July 21, 2009 webinar

findPeak(t,y)
function [freq, amp] = findPeak(t,y)
% Helper function to find peaks

%   Copyright 2009 The MathWorks, Inc.

N = 2^nextpow2(2*length(y));
Fs  = 1./mean(diff(t));
[Pyy,fy]=periodogram(y,[],N,Fs);
[amp,mi] = max(Pyy);
freq = fy(mi);

Contact us at files@mathworks.com