SPHASEPICKER is a powerful tool for automatically picking S-phase onsets with high precision without requiring detection interval or threshold settings. The algorithm detects S-phase onset in single-component acceleration or broadband velocity records using the histogram method. It also computes signal-to-noise ratio (SNR).
A demo file is provided in zip file to show how to run SPHASEPICKER using a sample waveform. For your intended application, filter corner frequencies may need to be updated based on the frequency content of the input record.
If you find this code useful for your application, please don't forget to rate it.
For questions / suggestions / comments and bug reports: firstname.lastname@example.org
Dr. Erol Kalkan, P.E. (2020). An Automated S-phase Arrival Time Picker with SNR Output (https://www.mathworks.com/matlabcentral/fileexchange/70343-an-automated-s-phase-arrival-time-picker-with-snr-output), MATLAB Central File Exchange. Retrieved .
Thank you for updating this file, it is a very useful function. I just have three questions:
1- in function "PphasePicker" Revision 16, at line 206, when you are in "else" part of your if loop, it means that variable "loc" is always -1, and "dt" is positive, so "1:loc/dt" is always empty since from 1 incrementing to any negative number is always nan. So is that a typo in the code or it meant to be like that if it is not a typo why not just saying "snr_db=nan"
2- can this function be used when we are pulsing with ultrasonic and picking with Acoustic machines. that is, can this work in laboratory-scale where P-wave and S-waves are very close to each other?
3- Can this function also recognize the first arrival of the second S-wave with another polarity?
Picking algorithm is optimized for speed and accuracy, full debug option is added to plot two additional figures, notes updated. This version is more stable.
Added the missing integration function