hi
lear about the function findpeak from matworks (some version of matlab contains this function).
this is a great function, with many parameters.
it will return you the sample number of a peak occurence.
look at this link for explaination
**broken link removed**