How to determine peaks in a large set of data

13 views (last 30 days)
Ian
Ian on 8 Feb 2013
I am currently analysing a large set of data obtained from accelerometers attached to individuals as they jumped up and down on a bridge at certain frequencies. I want to determine the peaks (i.e. when they landed and achieved max accel) so that I can find out the level of synchronisation achieved. However, as the data is very busy I am struggling to find a way of extracting the correct peaks. I found a command on the old Matlab which was almost perfect which was the 'peakdet' command, however I cannot find a suitable alternative to use in the most recent version of matlab.
Can anyone help?
Thanks in advance

Answers (3)

Wayne King
Wayne King on 8 Feb 2013
You can use findpeaks with the available options like THRESHOLD, MINPEAKHEIGHT, and MINPEAKDISTANCE to help cut down on the "noise".

Image Analyst
Image Analyst on 8 Feb 2013
Edited: Image Analyst on 8 Feb 2013
If you don't have the Signal Processing Toolbox and thus can't use findpeaks(), then you can try http://billauer.co.il/peakdet.html or look in the File Exchange.
You may want to do some noise reduction on your signal first, for example with the median filter (also in the SPT) or conv(), or http://www.mathworks.com/matlabcentral/fileexchange/24443

Miroslav Balda
Miroslav Balda on 8 Feb 2013
Try the function extr.m from
www.mathworks.com/matlabcentral/fileexchange/10272
If vector a contains all samples of a signal, the code
L = extr(a); % creates logical array such that
amax = a(L{1}); % is a vector of all peaks (maxima). More to it
amin = a(L{2}); % is a vector of all valeys (minima). (You don't need it)

Community Treasure Hunt

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

Start Hunting!