MATLAB: FindPeaks() of a 1024 x 116 Matrix

findpeaksMATLABSignal Processing Toolbox

I have a matrix that I read into MatLab that is 116 spectra (columns) each being 1024 elements (rows). Each spectrum has a peak and I'm looking to determine the following information from each spectrum:
– Peak value
– Peak position
– Peak width at a set height, like 10% or 30% of the peak height. What I'd really like is to know the first and last x element of each peak
I've completed the Signal Processing Toolbox course and it didn't go over the FindPeaks() function. Please, any help would be greatly appreciate. Even if it's direction to a good source on the function. Thank you!

Best Answer

findpeaks only works on vector input; just use a loop and pass each column of your array in turn.
There's a fair amount of background information and examples of using findpeaks in the documentation; I'm unaware of any other tutorial but the web if full of stuff.
I'd suggest "just try it" and see what you get. If the spectra are only one-peaked, it seems it could hardly go wrong.
ADDENDUM
Since findpeaks can return anything from an empty set to some large number of peaks, you'll probably want to use a cell array to store the results initially or else wrap the call into a routine that processes the results of each column to ensure expected results rather than just presume every column will give one and only one peak. Of course, if the data are very clean, that may actually happen....I was rarely that lucky. :)